Examples
Examples
Common Anvia application patterns, organized by what you want to build.
Examples show common Anvia application shapes. They are not tiny API snippets and they are not long tutorials. Each page should answer a build question: “If I want to build this kind of agent, ingestion flow, tool boundary, or production loop, what does the Anvia shape look like?”
The examples use concrete defaults where a full flow is easier to understand with real adapters: OpenAI gpt-5.5 for support model examples, Anthropic claude-opus-4.8 for escalation or judge examples, Mistral OCR for scanned documents, OpenAI text-embedding-3-small for embeddings, and Chroma for the primary vector store.
Build Goals
| If you want to build… | Start with | Then add |
|---|---|---|
| An agent endpoint with auth, history, tools, traces, and persistence | Agent App Flow | Runtime State and Persistence |
| An agent runtime assembled from model, instructions, tools, context, memory, and observers | Agent Runtime Composition | Context Assembly |
| Durable memory and replayable runtime events in your application database | Memory and Events | Prisma Agent Memory, Prisma Agent Event Store |
| Tools that enforce user, tenant, and action permissions | Permissioned Tools | Tool Validation, Guarded Side Effects |
| Typed model output for classification, extraction, or workflow results | Structured Results | Testing Harness |
| RAG over PDFs, images, documents, and product knowledge | RAG Ingestion | Retrieval Agent, Document Grounding |
| A support agent with account tools and policy evidence | Support Agent | Permissioned Tools, Retrieval Agent |
| A browser UI that streams completions and agents from server routes | Fullstack Streaming | Streaming Events, Runtime State and Persistence |
| A background document or research workflow | Pipeline Worker | Long-running Jobs |
| A coding or file agent with command boundaries | Coding Agent | Sandbox Execution |
| A workflow that needs human approval before writes | Guarded Side Effects | Human Input |
| Runtime visibility for traces, events, logs, evidence, and final answers | Runtime State and Persistence | Observability Loop, Production Readiness |
| Repeatable evals for completions, streams, agents, and product runners | Eval Loop | Testing Harness, Observability Loop |
Common Flows
Agent applications usually start with Agent App Flow: a thin route or job calls a runner, the runner resolves product state, the agent runs with scoped tools and context, and the application persists the result.
Memory and event-backed applications usually start with Memory and Events to keep conversation context separate from replay/debug logs. Then choose the adapter that matches the product database layer: Prisma, Drizzle, or raw SQL.
Knowledge applications usually combine RAG Ingestion, Retrieval Agent, and Document Grounding. The important flow is source documents to OCR or text extraction, chunks, embeddings, Chroma-backed vector index, dynamic context or retrieval tools, then cited answers.
Action-taking applications usually combine Permissioned Tools, Tool Validation, Guarded Side Effects, and Human Input. The model can request work, but application code owns permissions, approval, idempotency, audit, and safe output.
Production applications usually add Runtime State and Persistence, Testing Harness, Observability Loop, Eval Loop, and Production Readiness. Observability records runtime evidence. Evals replay behavior through target adapters and check it with deterministic metrics first.
More Maps
- Capability Map maps Anvia features to the examples that use them.
- Example Anatomy explains the format each example should follow.
