# AgentPrism AgentPrism is a library, not a hosted service. Read this list before you write agent, run, tool, or evaluation code by hand: the capability is very likely already here. AgentPrism uses Microsoft Agent Framework types directly, so MAF documentation applies unchanged. ## Wiring ```csharp builder.Services.AddAgentPrism(); // required: catalog, runs, in-memory stores app.MapAgentPrism(); // optional: management HTTP API and console ``` Everything else is opt-in and named below. ## Packages - AgentPrism: meta package - AgentPrism.Abstractions: contracts and abstractions - AgentPrism.Anthropic: Anthropic (Claude) provider adapter - AgentPrism.AspNetCore: HTTP layer - AgentPrism.Azure: Azure OpenAI provider adapter - AgentPrism.Core: core runtime - AgentPrism.Google: Google Gemini provider adapter - AgentPrism.Mcp: Model Context Protocol client - AgentPrism.OpenAI: OpenAI provider adapter - AgentPrism.PostgreSql: PostgreSQL persistence layer - AgentPrism.Sqlite: SQLite persistence layer - AgentPrism.SqlServer: SQL Server persistence layer - AgentPrism.Templates: The dotnet new agentprism-api template - AgentPrism.Testing: Test helpers: a non-networked model… - AgentPrism.UI: embedded management UI - AgentPrism.Voice: Voice tools - AgentPrism.Workflows: Workflow execution engine ## Capabilities ### Agent design and model control - Declarative agents: IAgentPrismBuilder.AddAgent(AgentDefinition) - Factory agents: AddAgent(name, factory) - Database definitions: MapAgentPrism() - Definition validation: POST /api/agents/validate - Model binding: AgentDefinition.Model - Structured output: ModelBinding.ResponseFormat - Agent graph: CallableAgentNames - Harness mode: AgentDefinition.Harness - Context compaction: AgentDefinition.Compaction, AgentPrism:UtilityModel - Working memory: AgentDefinition.Memory - Rule: AgentPrism uses AIAgent, AgentSession, ChatMessage, and AIFunction directly. ### Model providers - UseOpenAI(): AgentPrism.OpenAI, binds openai, openai-responses - UseOpenAICompatible(name, ...): AgentPrism.OpenAI, binds name, name-responses - UseAnthropic(): AgentPrism.Anthropic, binds anthropic - UseGoogle(): AgentPrism.Google, binds google - UseAzureOpenAI(): AgentPrism.Azure, binds azure-openai - AddModelProvider(): Any package - Rule: Several providers can be active at the same time. ### Tools, skills, and context - Generated tools: [AgentPrismTool], AddGeneratedTools() - Direct tools: AddTool(AIFunction, requiresApproval) - Delegate tools: AddTool(delegate, ...) - Scanned tools: AddToolsFrom(), AddToolsFrom(Type) - Tool approval: RequiresApproval, AddToolApprovalPolicy() - Client-side tools: AddClientTool(name, description, jsonSchema) - Custom content guards: AddContentGuard() - Pattern guard: AddPatternContentGuard() - Skills: AddSkill() - Skill scripts: UseSkillScripts() - Remote MCP tools: UseMcp() - MCP resources: AgentDefinition.McpResourceUris - Knowledge search: IEmbeddingGenerator - Rule: Only application code defines executable tool logic. ### Runs, sessions, and media - Streaming runs: POST /api/agents/{name}/run - Non-streaming runs: .NET or an idempotent HTTP request - Run recording: Core decorator pipeline - Cancellation: Run API and cancellation registry - Replay: Recorded run input and replay service - Compare and score: HTTP API and console - Sessions: AgentSessionManager - Branching: Session branch API - Attachments: Attachment API and message references - Multimodal messages: MAF content types plus stored attachments - Speech tools: AgentPrism.Voice, UseVoice() - Live voice conversation: UseVoiceConversation(), MapAgentPrism() - Rule: A run is the unit of evidence. ### Workflows and background work - Multi-agent workflows: AgentPrism.Workflows, UseWorkflows() - Durable checkpoints: Workflow options and a SQL store - Human input: Workflow request and response endpoints - Job queue: AddAgentPrism() - Custom jobs: IServiceCollection.AddJobHandler() - Workflow functions: AddWorkflowFunction() - Schedules: Scheduling API, console, or store - Worker control: IServiceCollection.UseScheduling() - Async HTTP runs: Prefer: respond-async - Idempotency: Idempotency-Key - Singleton execution: AgentPrism:SingletonExecution - Run reconciliation: AgentPrism:RunReconciliation - Rule: In-memory stores make these contracts usable for local work. ### Evaluation and controlled change - Eval suites and cases: API, console, or stores - Built-in checks: Eval case configuration - Custom checks: AddEvalCheck(kind, check) - Run judges: IRunJudge, AddModelRunJudge() - Online evaluation: Judge registration plus enabled sampling - Experiments: Experiment API and console - Canary rollback: Explicit canary policy - Rule: AgentPrism reports evidence. ### Security and governance - Loopback restriction: All mapped management surfaces - Static bearer token: MapAgentPrism() - ASP.NET Core policy: RequireAuthorization(policy) - Reader, Operator, Admin roles: Endpoint groups - API keys: HTTP API and stores - Multi-tenancy: UseTenancy() - Quotas: Run admission - Rate limiting: HTTP requests - Approvals: Tool execution and queued resume - Audit trail: Administrative writes - Webhooks: Signed outbound events - Outbound network guard: AgentPrism:Egress - Configuration key prefixes: Stored secret references - Retention and archive: Stored operational data - Content inspection: Model input and output - External surface guard: MCP server and A2A - Cross-origin access: AgentPrismEndpointOptions.AllowedOrigins - Rule: An API-key scope never grants a role. ### Observability and operations - Run event stream: Gapless, ordered domain events - OpenTelemetry traces: ActivitySource - Metrics: Run counts, duration, tokens, cost, tools, errors… - Cost attribution: Per model, agent, run, child run, and voice usage - Provider health: Cached status and optional background polling - Health checks: AddAgentPrismHealthChecks() - Diagnostics report: GET /api/diagnostics - Retention preview: HTTP API and console - Rule: Observability never changes behavior. ### Integration surfaces - .NET API: AddAgentPrism(), IAgentCatalog - Management HTTP API: MapAgentPrism() - OpenAPI: AddOpenApi() - OpenAI compatibility: MapAgentPrism() - Embedded console: AgentPrism.UI, UseUI() - Embeddable chat widget: AgentPrism.UI, embed.js - MCP client: AgentPrism.Mcp, UseMcp() - MCP server: UseMcpServer(), MapAgentPrismMcpServer() - A2A server: UseA2A(), MapAgentPrismA2A() - Voice WebSocket: UseVoiceConversation(), MapAgentPrism() - Rule: MapAgentPrism() exposes the documented management and OpenAI operations. ### Coding-agent support - Agent map file: AgentPrismWriteAgentsFile - Local reference file: AgentPrismWriteLocalReference - Map for web agents: llms.txt, llms-full.txt - Usage diagnostics: AgentPrism.Core, AgentPrismUsageDiagnostics - Tool diagnostics: AgentPrism.Core - Rule: A coding agent working in your repository cannot use a capability it does not know exists. ### Storage and testability - Zero-infrastructure start: In-memory implementations for every required core… - PostgreSQL persistence: UsePostgreSql() - SQL Server persistence: UseSqlServer() - SQLite persistence: UseSqlite() - Store replacement: TryAdd* - Provider-free tests: AgentPrism.Testing.FakeModelProvider - Integrated tests: AgentPrismTestHost - Assertions: RunAssertions - Rule: In-memory stores make every contract usable before any database exists, and the consumer's own registration always wins over the built-in one. ## Where to look - Exact local paths for the version you have: AgentPrism.LocalReference.md, beside each project that references AgentPrism - Capability map, with the boundary of each capability: https://agentprism.doayen.web.tr/capabilities/ - Guides, concepts, and configuration reference: https://agentprism.doayen.web.tr/ - Which page answers what, one line per page: https://agentprism.doayen.web.tr/llms.txt - Full text of every hand-written page (about 400 KB - prefer one page above): https://agentprism.doayen.web.tr/llms-full.txt - HTTP API reference: https://agentprism.doayen.web.tr/http-api/ - .NET API reference: https://agentprism.doayen.web.tr/api/ ## Which page answers what One line per hand-written page. Read the page that matches your question rather than the concatenated full text, which is far larger and answers the same question with everything else attached. - [Capability map](https://agentprism.doayen.web.tr/capabilities/) — A complete map of AgentPrism capabilities, with the package, registration point, storage needs, and operational boundary of each feature. - [Agents and definitions](https://agentprism.doayen.web.tr/concepts/agents/) — An agent as data, where definitions come from, how they are compiled, and what versioning gives you. - [Evaluation and experiments](https://agentprism.doayen.web.tr/concepts/evaluation/) — Improve agents with regression suites, production-run promotion, online judges, human feedback, and controlled experiments. - [Governance](https://agentprism.doayen.web.tr/concepts/governance/) — Govern agents with tenant isolation, audit, approvals, quotas, retention, content guards, API keys, and webhooks. - [Architecture](https://agentprism.doayen.web.tr/concepts/) — The layers, the dependency direction, and the four rules that explain most of the API. - [Runs and recording](https://agentprism.doayen.web.tr/concepts/runs/) — Understand default-on run recording, ordered events, streaming, queues, errors, replay, comparison, and traces. - [Sessions and conversations](https://agentprism.doayen.web.tr/concepts/sessions/) — Learn how sessions carry conversation state, how branching copies history, and how attachments are owned and removed. - [Tools, skills, and MCP](https://agentprism.doayen.web.tr/concepts/tools/) — The ways an agent gains a capability, and the guards on the ones that cross the code-only boundary. - [Workflows](https://agentprism.doayen.web.tr/concepts/workflows/) — Five multi-agent patterns, checkpoints, and asking a human mid-execution. - [Your first agent](https://agentprism.doayen.web.tr/getting-started/first-agent/) — Build, run, inspect, and call your first AgentPrism agent from an empty folder in about five minutes. - [What AgentPrism is](https://agentprism.doayen.web.tr/getting-started/) — What the packages give you, what they deliberately do not, and how to decide whether it fits. - [Persistence](https://agentprism.doayen.web.tr/getting-started/persistence/) — Choose PostgreSQL, SQL Server, or SQLite and operate AgentPrism migrations safely from development to production. - [Securing the endpoints](https://agentprism.doayen.web.tr/getting-started/security/) — Protect AgentPrism with network boundaries, bearer tokens, scoped API keys, roles, tenancy, and outbound guards. - [Adding a tool](https://agentprism.doayen.web.tr/getting-started/tools/) — Register a tool so an agent can do something, and understand the one rule that trips people up. - [Background work](https://agentprism.doayen.web.tr/guides/background-work/) — Queue agent runs, schedule recurring work, operate workers, and understand leasing, retries, cancellation, and multi-instance behavior. - [Client-side tools and the embeddable widget](https://agentprism.doayen.web.tr/guides/client-side-tools/) — Register a tool whose body runs in the browser, answer its call over HTTP, and drop the pre-built chat widget into your own page. - [Coding agents](https://agentprism.doayen.web.tr/guides/coding-agents/) — Teach the coding agent working in your repository what AgentPrism already does, through a generated capability map, a local reference file, and build-time diagnostics. - [Context and memory](https://agentprism.doayen.web.tr/guides/context-and-memory/) — Control conversation history, compaction, working memory, MCP resources, and persistent knowledge without mixing their responsibilities. - [Connect and expose agents](https://agentprism.doayen.web.tr/guides/external-agents/) — Consume MCP tools and context, or publish selected AgentPrism agents through MCP and A2A with explicit security boundaries. - [Inbound triggers](https://agentprism.doayen.web.tr/guides/inbound-triggers/) — Let an external system such as Slack start a queued agent or workflow run over a signed HTTP request, with no bearer token. - [Knowledge and RAG](https://agentprism.doayen.web.tr/guides/knowledge/) — Ingest, chunk, embed, search, and bind tenant-scoped knowledge so agents can retrieve evidence through a controlled tool. - [Model providers](https://agentprism.doayen.web.tr/guides/model-providers/) — Register OpenAI, Anthropic, Google, Azure OpenAI, or a compatible endpoint, then bind each agent without storing credentials. - [Multimodal input](https://agentprism.doayen.web.tr/guides/multimodal/) — Upload images, documents, text, and audio safely, attach them to a run, and understand storage, model support, and lifecycle limits. - [Observability](https://agentprism.doayen.web.tr/guides/observability/) — Record and inspect runs, export OpenTelemetry signals, configure health checks, and diagnose storage, provider, and pricing failures. - [OpenAI-compatible API](https://agentprism.doayen.web.tr/guides/openai-api/) — Point OpenAI clients at AgentPrism, choose an agent with model, stream responses, and understand the exact compatibility boundary. - [Production deployment](https://agentprism.doayen.web.tr/guides/production/) — Deploy AgentPrism with durable storage, explicit access control, health checks, worker topology, retention, and safe secret handling. - [Reliable runs](https://agentprism.doayen.web.tr/guides/reliability/) — Configure circuit breaking, idempotency, singleton execution, cancellation, and orphan reconciliation without hiding failure. - [Structured output](https://agentprism.doayen.web.tr/guides/structured-output/) — Ask models for plain text, JSON, or JSON Schema output, validate definitions early, and treat every response as untrusted input. - [Test agents without model calls](https://agentprism.doayen.web.tr/guides/testing/) — Test agents without network model calls by using the in-memory host, scripted fake provider, recorded requests, and run assertions. - [Voice and live conversation](https://agentprism.doayen.web.tr/guides/voice/) — Add speech tools and an opt-in realtime WebSocket conversation with explicit formats, limits, cost, privacy, and deployment rules. - [HTTP API](https://agentprism.doayen.web.tr/http-api/) — Use the AgentPrism management and OpenAI-compatible APIs with clear rules for auth, streaming, paging, errors, and schemas. - [Choosing packages](https://agentprism.doayen.web.tr/packages/) — What each of the 17 packages does, which come with the meta package, and what enters your dependency graph. - [Compatibility](https://agentprism.doayen.web.tr/reference/compatibility/) — A verified compatibility matrix for target frameworks, packages, AOT, storage engines, model providers, UI ownership, and API-key scopes. - [Configuration](https://agentprism.doayen.web.tr/reference/configuration/) — Verified configuration sections and defaults for AgentPrism core services, providers, persistence, operations, security, and optional surfaces. - [Glossary](https://agentprism.doayen.web.tr/reference/glossary/) — Precise definitions for the AgentPrism terms used across agent design, execution, storage, security, evaluation, and operations. - [Versions and upgrades](https://agentprism.doayen.web.tr/reference/versioning/) — Understand which AgentPrism release these docs describe, pin preview packages safely, and upgrade the full package family without drift. - [Troubleshooting](https://agentprism.doayen.web.tr/troubleshooting/) — Symptom-first fixes for installation, providers, tools, storage, security, streaming, background work, MCP, voice, and the console. - [The console](https://agentprism.doayen.web.tr/ui/) — Tour the embedded AgentPrism console by task, understand its security model, and know which features remain code or HTTP only.