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.Engine Show all

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