RedBase Documentation

Welcome to the RedBase documentation portal. Browse the API reference, explore code examples, and learn how to build with REDB.

API Reference

Browse the REDB API documentation. Select a namespace or type from the tree on the left, or click on items below.

Showing: redb.Route.Llm Show all

redb.Route.Llm

Classes

C LlmCallbackOptions Configuration for .
C LlmCallbackProcessor Processes inbound webhook callbacks from async-batch LLM APIs (Anthropic
C LlmComponent LLM transport component for redb.Route.
C LlmConnectionFactory Connection factory configuration for the LLM connector. Register in the route
C LlmConsumer LLM consumer. Fires the connection factory on a fixed interval and pushes
C LlmEndpoint LLM endpoint. The URI host is interpreted as the connection-factory name.
C LlmEndpointOptions Typed options for . Bound from URI query parameters via reflection.
C LlmHeaders Header keys used by the LLM connector. All keys are lowercase to match
C LlmKeys Property keys placed on IExchange.Properties by the LLM connector
C LlmProducer LLM producer. Treats the inbound exchange as a single user turn, runs the

Enums

E LlmStreamMode How an llm: step streams (stream=).

redb.Route.Llm.Abstractions.Tools

Classes

C DelegateToolClaimsSource Claims source backed by a delegate — the seam for deployments that resolve claims from their own
C ExchangePrincipalClaimsSource Default : the claims of the caller an exchange came from.
C ExposeAsLlmToolAttribute Marks a class, method, or route definition as exposable to an LLM as a tool.
C LlmToolCapability Capability descriptor for a tool exposed to the LLM. The engine projects the
C LlmToolSafety Governance metadata attached to every . These are declarations:
C ToolDescriptorRegistry Default in-memory .
C ToolResultErrors Model-facing tool_result error codes: what a tool call that could not execute reports back
C ToolSkipReasons Stable SkipReason values the engine reports to IAgentObserver when a tool call is

Interfaces

I ILlmToolDescriptor A tool exposable to the LLM. Implementations are declarative — they carry the
I IToolClaimsSource Resolves the claims held by the principal of an agent run. The engine consults it before
I IToolDescriptorRegistry Registry of tool descriptors available to the agent engine. Resolved by name at dispatch time.

Enums

E ToolCachingPolicy Result-caching policy for . Enforced for read-only tools: the engine
E ToolCostClass Cost class hint for budget-aware scheduling. Reserved — budgets are computed from
E ToolSideEffect Side-effect classification declared by a tool author. Read by the engine for two decisions: a tool

redb.Route.Llm.Embeddings

Classes

C EmbedComponent Embedding transport. Scheme: embed. Producer-only, symmetric with
C EmbedEndpoint Embedding endpoint. URI path = connection-factory name.
C EmbedEndpointOptions Options for an embed:// endpoint.
C EmbedProducer Embedding producer: embeds the exchange body and writes the vector(s) to

redb.Route.Llm.Engine

Classes

C AgentEngine Default implementation. Drives the tool-loop with
C AgentRequest Single agent execution request. Carries the user message, optional system prompt,
C AgentResponse Final agent response.
C ToolHeaderPolicy Decides which headers of the agent's exchange are visible to a tool route.

Interfaces

I IAgentEngine Drives the tool-loop: provider call → tool dispatch → provider call → ... until

redb.Route.Llm.Engine.Eval

Classes

C LlmEvalCase Declarative description of a single eval case. Combines the inputs the harness
C LlmEvalResult Outcome of a single evaluated case.
C LlmEvalRunner Drives a batch of through an ,

Structs

S LlmEvalCaseScore Outcome of a custom scorer. Pass=false marks the case as failed regardless of

redb.Route.Llm.Engine.Governance

Classes

C ApprovalDecision Outcome of an approval decision.
C ApprovalRequest Pending tool-call approval request handed to the gate.
C AutoApproveGate Default gate that auto-approves every request — used in development and in
C DenyAllGate Gate that denies every approval request. Opt-in: it is not registered by default
C InMemoryBudgetEnforcer In-process budget enforcer — checks components against the running
C NoopBudgetEnforcer Default no-op budget enforcer — always allows execution.
C NoopRedactionFilter Default redaction filter — returns the input untouched.
C NoopShadowRunner Default no-op shadow runner — disabled, never executes anything.
C NullCostCalculator Default calculator: prices nothing. Registered by AddRedbRouteLlm() so the engine always has
C StoreBudgetEnforcer Budget enforcement that survives the run: usage is accumulated per conversation in an

Interfaces

I IApprovalGate Gate that blocks a tool call until an approver responds. The agent loop calls
I IBudgetEnforcer Enforces token and cost budgets on agent runs. Called before and after each
I ICostCalculator Prices one provider response so a cost budget can be enforced. The engine asks this once per
I IRedactionFilter Removes secrets / PII from strings before they are logged, persisted to
I IShadowRunner Optional shadow runner — when enabled, every primary provider call is also

Structs

S AgentBudget Per-run budget. Components ≤ 0 disable that dimension of enforcement.
S AgentUsage Running usage measured against an .
S BudgetDecision Outcome of a budget enforcement decision.

Enums

E RedactionContext Context flags that influence how a piece of text is redacted.

redb.Route.Llm.Engine.Observability

Classes

C AgentDeltaContext One piece of a streamed model call.
C AgentIterationContext Per-iteration snapshot — usage, stop reason, content shape.
C AgentRunCompletedContext Final state of an agent run.
C AgentRunContext Common identifiers passed to every observer call within one agent run.
C AgentToolInvocationContext Tool invocation outcome.
C CompositeAgentObserver Composite observer — fans out events to every registered .
C NoopAgentObserver Default observer — discards all events.

Interfaces

I IAgentObserver Receives lifecycle notifications about an agent run. Implementations are

Enums

E AgentDeltaKind What a streamed piece is.

redb.Route.Llm.Engine.Storage

Classes

C ApprovalRecord An approval decision joined with the request that triggered it.
C BatchJobRecord A persisted batch-submission record.
C ConversationMessage A persisted conversation message with its tree placement and metadata.
C ConversationMessageMeta Queryable metadata that lives on the message node — hoisted from
C EvalIterationRecord Per-iteration metric inside an .
C EvalRunRecord An evaluation run snapshot.
C InMemoryApprovalStore In-memory approval store — sufficient for tests and demos.
C InMemoryBatchStore In-memory — entries live only for the process lifetime.
C InMemoryConversationStore In-memory conversation store — suitable for unit tests and demos.
C InMemoryCostBudgetStore In-memory cost/token store. Replace with the redb-backed implementation in production.
C InMemoryEvalRunStore In-memory eval run store — used by unit tests; production swaps in the redb implementation.
C InMemoryKnowledgeStore In-memory knowledge store — does an O(N) cosine-similarity scan on every
C InMemoryPromptTemplateRegistry In-memory registry — registered templates live only for the process lifetime.
C InMemoryToolCacheStore In-memory tool cache. TTL is honoured lazily — entries are dropped on read.
C InMemoryToolIdempotencyStore In-memory idempotency store backed by a thin
C KnowledgeChunk A single embedded knowledge chunk.
C KnowledgeSearchResult A chunk returned by , with score.
C PromptTemplate A versioned prompt template.
C ToolIdempotencyReservation Outcome of .

Interfaces

I IApprovalStore Persists approval decisions for audit and replay. Every call answered by
I IBatchStore Tracks async-batch jobs submitted to LLM providers (Anthropic Message
I IConversationStore Persists conversation transcripts so that an agent run can be resumed,
I ICostBudgetStore Persists running cost / token usage per conversation so that an
I IEvalRunStore Persists the outcome of a recorded evaluation run. Used by the eval harness
I IKnowledgeStore Persists embedding-backed knowledge chunks for retrieval-augmented agent
I IPromptTemplateRegistry Resolves a named prompt template into the actual system / user text the
I IToolCacheStore Caches deterministic / read-only tool outputs by a content-hash key so repeated calls can skip
I IToolIdempotencyStore Tracks tool invocations so that retried or duplicated tool calls produce a

redb.Route.Llm.Expressions

Classes

C LlmConversationContext Snapshot of the current conversation visible to the
C LlmExpressionKeys Well-known exchange property keys used by the LLM expression integration.
C LlmExpressionResolverSetup Registers \({conversation.*}</code> and <code>\){tool.*} resolvers with
C LlmToolContext Snapshot of the tool currently being dispatched, visible to the

redb.Route.Llm.Extensions

Classes

C LlmCallBuilder Builder for the inline step.
C LlmRouteDefinitionExtensions Inline LLM step for . Pure syntactic sugar over
C LlmServiceCollectionExtensions Extension methods for registering the LLM transport, governance defaults
C LlmToolBuilderDefinition Metadata builder for . Collects the tool capability
C LlmToolDsl Apache-Camel-style DSL aspect that registers the current route as an

redb.Route.Llm.Fluent

Classes

C Llm Fluent API for LLM endpoints.
C LlmBuilder Fluent builder for LLM endpoint URIs.

redb.Route.Llm.Knowledge

Classes

C KnowledgeChunker Deterministic character-window chunker: fixed chunkChars
C KnowledgeComponent Ingest transport for the knowledge base. Scheme: knowledge.
C KnowledgeEndpoint Knowledge ingest endpoint. URI path = collection name.
C KnowledgeEndpointOptions Options for a knowledge:// endpoint (URI query auto-binds by name).
C KnowledgeProducer Ingest producer: chunks the exchange body, (optionally) embeds, and upserts
C KnowledgeRetrievalDsl DSL step that retrieves top-K knowledge chunks for the current message and
C KnowledgeRetrievalOptions Options for the step.

redb.Route.Llm.Mcp

Classes

C McpComponent MCP component. Scheme: mcp. Endpoint URI: mcp://serverName/toolName.
C McpDiscoveryService Hosted service that brings up registered MCP servers, runs the
C McpEndpoint MCP endpoint — a single (server, tool) coordinate. Producer-only.
C McpEndpointOptions Endpoint options for the mcp:// scheme. The URI parser maps
C McpException Thrown when an MCP server returns a JSON-RPC error, the transport fails,
C McpProducer MCP producer — translates an exchange into an MCP tools/call RPC.
C McpRegistry Default in-memory thread-safe .
C McpRestartPolicy Restart policy for an MCP stdio server.
C McpSafetyOverride Per-tool safety override. The first matching wins.
C McpServerOptions Configuration for a single MCP server entry. Built via
C McpServerOptionsBuilder Mutable builder for .
C McpServiceCollectionExtensions DI registration helpers for redb.Route.Llm.Mcp.
C McpToolDescriptor backed by a remote MCP tool. Capability built once

Interfaces

I IMcpClient Transport-agnostic MCP client. Implementations spawn / hold the connection,
I IMcpRegistry Registry of singletons keyed by server name.

Enums

E McpClientStatus Health state of an . Surfaced by

redb.Route.Llm.Mcp.Protocol

Classes

C CallToolResult Result of tools/call.
C InitializeResult Result of the initialize handshake.
C JsonRpcError JSON-RPC error object.
C JsonRpcNotification JSON-RPC 2.0 server-initiated notification (no response expected).
C JsonRpcRequest JSON-RPC 2.0 request envelope.
C JsonRpcResponse JSON-RPC 2.0 response envelope.
C ListToolsResult Result of tools/list.
C McpClientBase Shared client logic: per-id registry,
C McpProtocol MCP protocol DTOs and JSON-RPC envelope types. Pinned to MCP protocol version
C ServerInfo Server identification block returned during initialize.
C ToolDefinition One tool entry as returned by tools/list.

redb.Route.Llm.Mcp.Transport

Classes

C HttpSseMcpClient HTTP + SSE transport. POSTs JSON-RPC requests to the base URL, opens a parallel
C McpTransport Configuration for an MCP server transport. Built via
C StdioMcpClient Stdio transport — spawns an external process, exchanges newline-delimited

Enums

E McpTransportKind Transport flavor for an MCP server.

redb.Route.Llm.Providers

Classes

C AnthropicProvider Transport for Anthropic's Messages API (POST {baseUrl}/v1/messages).
C LlmContentBlock Base type for content blocks (text, tool-use, tool-result, thinking).
C LlmHttpErrors Turns a failed HTTP response into the right provider exception. One place, because the
C LlmMessage Single message in the conversation transcript sent to the provider.
C LlmRateLimitException Provider signalled rate limiting (HTTP 429). Distinct from
C LlmRequest Single completion request sent to a provider.
C LlmResponse Single completion response from a provider.
C LlmStreamChunk Single chunk yielded by . Non-final chunks have =
C LlmTextBlock Plain text block.
C LlmThinkingBlock Thinking / reasoning block returned by a provider that exposes its chain of thought —
C LlmTimeoutException A limit of the call to the model ran out ().
C LlmToolResultBlock Tool-result block sent back to the assistant on the next turn.
C LlmToolUseBlock Tool-use block emitted by the assistant — engine must dispatch the tool and
C LlmTransientException Transient provider failure that is safe to retry (HTTP 5xx, Anthropic's
C LlmUsage Token usage reported by the provider.
C OpenAiEmbeddingProvider Transport for any OpenAI-compatible embeddings endpoint
C OpenAiProvider Transport for any OpenAI-compatible Chat Completions endpoint
C OpenAiTranscriptionProvider Transport for any OpenAI-compatible speech endpoint
C ReplayProvider Deterministic backed by a JSON fixture on disk.
C StubProvider Deterministic provider for tests, demos, and Phase-0 smoke. Echoes the last

Interfaces

I IEmbeddingProvider Pure transport over an embeddings API — turns text into vectors. The sibling
I ILlmProvider Pure transport abstraction over an LLM API. Implementations are responsible
I ITranscriptionProvider Pure transport over a speech-to-text API — turns recorded audio into text. The

Structs

S AnthropicModelProfile Capability descriptor for an Anthropic model: which request fields the target
S TranscriptionRequest One recording to transcribe.
S TranscriptionResult What came back.

Enums

E AnthropicModelTier Contract generation of an Anthropic model, as it affects how a Messages-API
E AnthropicSamplingPolicy How the target model accepts the sampling knobs (temperature/top_p).
E LlmStopReason Reason the provider stopped generating.
E LlmTimeoutKind Which limit of a model call ran out.
E ReplayMode Mode for .

redb.Route.Llm.Storage.Redb

Classes

C RedbApprovalStore REDB-backed . One
C RedbAuditObserver REDB-backed that persists one
C RedbBatchStore REDB-backed . One row
C RedbConversationStore REDB-backed . Tree integrity is enforced by
C RedbCostBudgetStore REDB-backed . One
C RedbEvalRunStore REDB-backed . One
C RedbKnowledgeStore REDB-backed . One row per chunk; every chunk
C RedbPromptTemplateRegistry REDB-backed . One
C RedbToolIdempotencyStore REDB-backed . Reservations are tracked by a
C RedbToolResultCache REDB-backed . Cache entries are keyed on the

redb.Route.Llm.Storage.Redb.Schemas

Classes

C ApprovalProps Persisted decision from an IApprovalGate. The combination of
C ConversationProps Root record of a single LLM conversation. Top-level scalar fields are
C CostBudgetProps Running cost / token totals scoped to a conversation. One row per
C EvalIterationMetric Per-iteration metric inside an run.
C EvalRunProps A persisted eval-harness run. Scenario / fingerprint / score are top-level
C KnowledgeChunkProps Marker scheme for embedding-backed knowledge chunks. Intentionally
C LlmBatchProps A submitted async-batch job tracked by .
C MessageContentBlock Typed nested representation of an LlmContentBlock. Discriminated
C MessageProps A single message node within a conversation tree. Persisted as a
C PromptTemplateProps A versioned prompt template. (, )
C ToolAuditProps One row per tool invocation, written by the audit observer. The scheme is built around the dimension...
C ToolCacheProps Cached deterministic tool output. The key is built by Tools/ToolCacheKey.StoreKey and shaped
C ToolIdempotencyProps Persisted tool-call idempotency record. Distinct from

redb.Route.Llm.Telemetry

Classes

C LlmMetrics LLM-specific counters and histograms. Published on the same shared meter

redb.Route.Llm.Tools

Classes

C HttpFetchDsl DSL extension that wires an HTTP-GET fetcher into a route step. Reads
C HttpFetchOptions Configuration for . Defaults are conservative so
C HttpFetchTool Standalone RouteBuilder wrapper that mounts
C JsonPathDsl DSL extension that wires a JsonPath query into a route step. Reads
C JsonPathOptions Configuration for .
C JsonPathTool Standalone RouteBuilder wrapper that mounts
C KnowledgeSearchDsl DSL step that answers a knowledge_search tool call: reads
C KnowledgeSearchOptions Options for the knowledge_search LLM tool / step.
C KnowledgeSearchTool Self-contained RouteBuilder that mounts knowledge_search as an
C LlmTool Homeless static builder for . Use when the
C LlmToolStaticBuilder Fluent builder produced by . Call
C MathEvalDsl DSL extension that wires an expression evaluator into a route step. Reads
C MathEvalOptions Configuration for .
C MathEvalTool Standalone RouteBuilder wrapper that mounts
C RegexExtractDsl DSL extension that wires a regex-extraction step into a route. Reads
C RegexExtractOptions Configuration for .
C RegexExtractTool Standalone RouteBuilder wrapper that mounts
C RouteToolBridge Bridges a fixed redb.Route endpoint into the LLM tool surface as an
C TavilyWebSearchDsl DSL extension that wires a Tavily (https://tavily.com/) web-search call
C TavilyWebSearchOptions Configuration for .
C TavilyWebSearchTool Standalone RouteBuilder wrapper that mounts
C XPathDsl DSL extension that wires an XPath query into a route step. Reads
C XPathOptions Configuration for .
C XPathTool Standalone RouteBuilder wrapper that mounts

redb.Route.Llm.Transcription

Classes

C SttComponent Speech-to-text transport. Scheme: stt. Producer-only, symmetric with
C SttEndpoint Speech-to-text endpoint. URI path = connection-factory name.
C SttEndpointOptions Options for an stt:// endpoint.
C SttProducer Speech-to-text producer: transcribes the exchange body and writes the recognised