Skip to content

Add SQL-backed Effect chat persistence wiring #147

Description

@lloydrichards

Parent

Part of #139.

What to build

Add an optional chat persistence module that wires Effect Chat.Persistence to the SQL persistence layer provided by db-sqlite.

This module should provide minimal boilerplate for persisted Effect chat history. It should not introduce app-specific chat metadata, chat list/get/delete APIs, titles, models, users, threads, or durable active-run metadata.

Helpful context

  • SQLite foundation: Add reusable db-sqlite foundation module #146
  • Effect Chat persistence: .reference/effect/packages/effect/src/unstable/ai/Chat.ts
  • Effect Persistence SQL layers: .reference/effect/packages/effect/src/unstable/persistence/Persistence.ts
  • Current chat runtime: packages/catalog/src/registry/content/chat.ts

Acceptance criteria

  • Add an optional chat persistence module that depends on db-sqlite.
  • Provide Effect Persistence.layerSql or the appropriate SQL-backed Effect Persistence layer using the generated SQLite foundation.
  • Provide Chat.layerPersisted({ storeId: "chat" }) or equivalent generated layer wiring.
  • Keep chat_ask and chat-react-client unchanged.
  • Do not add chat metadata tables, chat list/get/delete APIs, titles, models, users, threads, or durable active-run metadata.
  • Document where a future stable chat/thread persistence key would plug into ChatRuntime or a future RPC.
  • Add tests or generated-workspace validation proving the persistence layer composes with the generated server runtime.

Blocked by

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions