Chronicle (Personal Data Warehouse & Digital Twin Engine)
Role: Solo, end-to-end
Tech Stack: Python 3.11, SQLModel (SQLAlchemy), Typer/Click (CLI), Rich (TUI), OpenAI/Anthropic APIs
Repository: Private. Demo available on request
Overview
Chronicle pulls in your chat history, GitHub commits, and Reddit activity, normalizes everything into a single local database, and exports it as fine-tuning datasets.
The idea is simple: your writing style, your reasoning patterns, your decision-making, all of it is scattered across dozens of platforms and completely untapped. Chronicle aggregates that data into a training corpus you can actually use to fine-tune a model on how you think and write.
System Architecture
The system is a modular ETL pipeline controlled via a CLI. Everything stays on your machine, and all data gets normalized into a common schema.
graph TD
subgraph "Ingestion Layer (Extract)"
A[ChatGPT Export] --> D
B[GitHub API] --> D
C[Claude/Gemini Logs] --> D
end
D{Ingestor Strategy} -->|Normalize| E[Standardized Event Schema]
subgraph "Core Database (Transform/Load)"
E --> F[(SQLModel / SQLite)]
end
subgraph "Application Layer"
F --> G[CLI Controller]
G --> H[Corpus Generator]
G --> I[Analytics Engine]
end
H -->|Export| J[Fine-Tuning JSONL]
I -->|Visualize| K[Rich TUI Dashboard]
Components
- Universal Ingestors: a plugin-based system that parses disparate data formats (JSON exports, API responses, CSVs) and maps them to a single
ConversationorEventschema. - The Corpus Engine: filters and cleans historical data to create high-quality datasets for LLM fine-tuning.
- CLI Dashboard: a polished Terminal User Interface using the
Richlibrary to visualize storage stats, sync status, and conversation history.
How It Works
1. The Polymorphic Ingestion Pattern
Every data source has a different shape. ChatGPT exports are nested JSON trees. GitHub commits are flat API lists. Reddit comments are threaded. No single parser handles all of them.
So I implemented a strict Strategy Pattern for ingestion.
- Abstract
BaseIngestorclass defines the contract. - Concrete implementations (
ChatGPTIngestor,GitHubIngestor) handle the source-specific parsing. - The core database doesn’t care where data came from. A commit message and a chat prompt are both just
Entriesonce they’re normalized.
2. Local-First Data Sovereignty
Users are (rightfully) hesitant to connect personal archives to cloud tools. So the entire architecture is built on SQLite and local file systems.
- No data leaves the machine unless the user explicitly runs a
syncorexportcommand. - PII scrubbing utilities sanitize datasets before they get used for external model training.
3. Contextual Search & Retrieval
Searching through 100,000+ lines of chat history and code is slow and imprecise with standard regex. SQLModel with full-text search capabilities handles the scale.
- Schema separates
Sessions(metadata) fromEntries(content), allowing fast filtering by date, source, or semantic tags.
Code Snippet: The Ingestion Strategy
How the parsing logic is decoupled from database storage.
class BaseIngestor(ABC):
"""
Abstract interface for all data sources.
Enforces a consistent return type (List[Entry]) regardless of input format.
"""
@abstractmethod
def parse(self, source_path: Path) -> Generator[Entry, None, None]:
"""Yields normalized Entry objects from the raw source file."""
pass
def validate_schema(self, data: Dict) -> bool:
"""Ensures the source file matches expected version/format."""
try:
# Pydantic validation logic
return SchemaModel(**data)
except ValidationError:
return False
# Concrete Implementation
class ChatGPTIngestor(BaseIngestor):
def parse(self, source_path):
with open(source_path) as f:
raw_json = json.load(f)
for conversation in raw_json:
yield self._normalize_conversation(conversation)
Use Cases
- Personal AI Assistant: “talk to yourself.” Train an LLM on this data and the model can predict how I’d respond to an email or write a function.
- Portfolio Generation: the
showcasemodule generates documentation by pulling relevant project history and code snippets. - Memory Extension: a searchable “second brain” for everything I’ve ever written or coded.
Tech Stack
- Language: Python 3.11+
- ORM: SQLModel (SQLAlchemy + Pydantic)
- CLI Framework: Typer / Click
- UI Library: Rich (terminal tables and progress bars)
- Testing: Pytest