Files
growqr-backend/src/actors/conversation/README.md
2026-06-02 19:08:31 +05:30

1.3 KiB

Conversation Actor Prototype

Standalone Rivet actor prototype based on Rivet's examples/ai-agent shape, but with actor-local SQLite + Drizzle.

This folder is intentionally not wired into src/actors/registry.ts yet.

Files

  • conversation-actor.ts — Rivet actor with queue-driven message processing and streaming AI SDK response events.
  • schema.ts — Drizzle SQLite schema for messages, tool calls, and summaries.
  • migrations.ts — tiny inline SQLite migration for this isolated prototype.
  • agent.ts — AI SDK v6 streamText wrapper and stub memory tools.
  • types.ts — public event/message/status types.

Actor key

Use a compound actor key when it is eventually wired:

client.conversationActor.getOrCreate([userId, conversationId])

Runtime env

The prototype expects:

OPENAI_API_KEY=...
CONVERSATION_ACTOR_MODEL=...

No default model is hardcoded so we do not accidentally freeze this prototype to a stale model id.

Next steps when wiring later

  1. Add conversationActor to src/actors/registry.ts.
  2. Decide whether userActor creates conversation ids or frontend supplies them.
  3. Replace stub memory tools in agent.ts with actor-to-actor calls to memoryActor[userId].
  4. Move inline migrations to generated Drizzle migrations if/when this becomes production code.