AI in Causet
Causet is useful anywhere state changes matter. AI agents make the problem worse because their decisions, memory, tool calls, and side effects need to be inspectable.
AI is not the only use case. It is the sharpest version of the problem.
Causet gives backend workflows and AI agents the same thing: a durable, replayable timeline of meaningful state changes.
You declare decisions, vector memory, providers, and prompts in the same DSL as entities, events, and actions. LLM calls run as op: decision in side_effects, emit typed domain events, and appear in the Timeline beside every other step.
Building a normal API workflow first? Start with Retrofit an Existing App. Come back here when an agent decision needs the same audit trail.
What AI gets from Causet
| Concept | Framing |
|---|---|
| Memory as state | Memories have origin events, scope, and retrieval history — not only a vector blob |
| Decisions as events | Structured outputs emit domain events (TICKET_AI_TRIAGED, …) |
| Tool calls as inspectable side effects | External actions show up on the timeline; design them for idempotent retry |
| Approvals as explicit events | Human override is an intent/event, not a silent admin click |
| Emitted business events | Downstream apps update their DB from the same events as any other workflow |
| Replayability and auditability | Inspect which memory and prompt version produced a decision |
What problem it solves
| Without Causet | With Causet |
|---|---|
| Ad-hoc OpenAI calls in app code | Declared in .causet; validated at compile time |
| Prompt strings scattered across services | prompts: templates with bindings |
| RAG context assembled manually | memories: ingest ledger events → retrieve at decision time |
| AI output shape unchecked | output: schema validated before emit |
| No audit trail | Decision steps + emitted events on the timeline |
In this section
| Page | What it covers |
|---|---|
| Concept | Four DSL pieces, core vs side_effects, memory types |
| Defining Decisions | decisions: block, op: decision, listeners |
| Providers & Prompts | BYOK, templates, mock executor |
| Secrets & Keys | Provider API keys in Causet Cloud |
| Vector Memory | Ingestion, partitioning, prompt injection |
| Best Practices | Schema design, cost, common mistakes |
| Example | Support Copilot — end-to-end triage |
| AI agent decision with memory | Compact example: old flow vs Causet timeline |
End-to-end flow
Your existing app can treat TICKET_AI_TRIAGED like any other business event — update the ticket row via webhook / event bridge.
Next steps
- Mental model — shared primitives with non-AI workflows
- Support Copilot — full walkthrough
- When Not to Use Causet