1.3 KiB
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 v6streamTextwrapper 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
- Add
conversationActortosrc/actors/registry.ts. - Decide whether
userActorcreates conversation ids or frontend supplies them. - Replace stub memory tools in
agent.tswith actor-to-actor calls tomemoryActor[userId]. - Move inline migrations to generated Drizzle migrations if/when this becomes production code.