AIOverview

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

ConceptFraming
Memory as stateMemories have origin events, scope, and retrieval history — not only a vector blob
Decisions as eventsStructured outputs emit domain events (TICKET_AI_TRIAGED, …)
Tool calls as inspectable side effectsExternal actions show up on the timeline; design them for idempotent retry
Approvals as explicit eventsHuman override is an intent/event, not a silent admin click
Emitted business eventsDownstream apps update their DB from the same events as any other workflow
Replayability and auditabilityInspect which memory and prompt version produced a decision

What problem it solves

Without CausetWith Causet
Ad-hoc OpenAI calls in app codeDeclared in .causet; validated at compile time
Prompt strings scattered across servicesprompts: templates with bindings
RAG context assembled manuallymemories: ingest ledger events → retrieve at decision time
AI output shape uncheckedoutput: schema validated before emit
No audit trailDecision steps + emitted events on the timeline

In this section

PageWhat it covers
ConceptFour DSL pieces, core vs side_effects, memory types
Defining Decisionsdecisions: block, op: decision, listeners
Providers & PromptsBYOK, templates, mock executor
Secrets & KeysProvider API keys in Causet Cloud
Vector MemoryIngestion, partitioning, prompt injection
Best PracticesSchema design, cost, common mistakes
ExampleSupport Copilot — end-to-end triage
AI agent decision with memoryCompact 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