Problem
Current implementation is stateless - no memory between runs. This limits:
- Conversation continuity
- Review history
- Multi-document tracking
Proposed Solution
Add a lightweight database (SQLite) to store:
- Document review history
- Conversation threads
- Applied/rejected suggestions
- User preferences
Schema (Draft)
```sql
CREATE TABLE documents (
id TEXT PRIMARY KEY,
title TEXT,
last_reviewed_at TIMESTAMP
);
CREATE TABLE reviews (
id INTEGER PRIMARY KEY,
document_id TEXT,
created_at TIMESTAMP,
prompt TEXT,
response JSON
);
CREATE TABLE conversations (
id INTEGER PRIMARY KEY,
document_id TEXT,
thread_id TEXT,
messages JSON
);
```
Technical Considerations
- SQLite is sufficient for local CLI use
- Consider better-sqlite3 for sync API
- Migration strategy for schema changes
Problem
Current implementation is stateless - no memory between runs. This limits:
Proposed Solution
Add a lightweight database (SQLite) to store:
Schema (Draft)
```sql
CREATE TABLE documents (
id TEXT PRIMARY KEY,
title TEXT,
last_reviewed_at TIMESTAMP
);
CREATE TABLE reviews (
id INTEGER PRIMARY KEY,
document_id TEXT,
created_at TIMESTAMP,
prompt TEXT,
response JSON
);
CREATE TABLE conversations (
id INTEGER PRIMARY KEY,
document_id TEXT,
thread_id TEXT,
messages JSON
);
```
Technical Considerations