Skip to content

Add database for state management #6

Description

@gsiener

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions