Expand description
§entelix
Web-service-native Rust agentic AI SDK — LangChain + LangGraph parity,
Anthropic managed-agent shape, production-grade observability. This crate
is the facade: it re-exports the sub-crates behind feature flags
(see Cargo.toml).
Surface includes the composition spine (Runnable, .pipe()), prompt
primitives (PromptTemplate, ChatPromptTemplate,
MessagesPlaceholder), the IR (ir), every codec
(codecs::AnthropicMessagesCodec and siblings), transports
(DirectTransport plus optional cloud transports under feature flags),
the ChatModel bundle (ChatModel), the Tool hand contract, and
optional sub-crates for memory, persistence, MCP, policy,
observability, the HTTP server, and agent recipes.
Architectural canon: see CLAUDE.md (22 invariants + naming taxonomy)
and docs/architecture/principles.md.
Modules§
- auth
- Credential resolution for transports.
- cancellation
- Cancellation primitive for entelix.
- codecs
- Provider codecs (invariant 4).
- events
EventBus— ephemeral broadcast pub-sub for SDK observability.- ir
- Provider-neutral intermediate representation (invariant 4).
- prelude
- Common imports for typical SDK usage.
- sandbox
Sandbox— sandbox-agnostic isolated execution environment.- service
tower::Servicespine for entelix model + tool calls.- skills
- Skills — packaged, progressively-disclosed agent capabilities .
- stream
StreamAggregator— accumulates streaming model deltas into a coherentModelResponse.- tools
- The Hand surface —
Tooltrait +ToolRegistry(layeredtower::Servicedispatch path) +ToolDispatchScope/ScopedToolLayer(operator hook for ambient request-scope state, e.g. tokio task-locals seeding RLS settings). - transports
- Stateful HTTP carriers —
Transporttrait + concrete impls — and theRetryLayermiddleware that wraps any retry-classifiedService.
Structs§
- Activate
Skill Tool - T1 → T2 transition — load one skill’s full instructions and the
list of resource keys it exposes. Resource bytes are not
included; they are read separately via
ReadSkillResourceTool. - Advisory
Key postgresorredis - 64-bit hashed key used for distributed lock derivation.
- Agent
- Production agent runtime.
- Agent
Builder - Fluent builder for
Agent<S>. - Agent
Context - Per-run carrier of infra context + typed operator-side
dependencies.
Ddefaults to()so deps-less agents pay no type-system tax. - Agent
Entry - One named sub-agent in a
create_supervisor_agentgraph. - Agent
Router Builder server - Fluent builder that produces an
axum::Routermounted at/v1. - Agent
RunResult - Terminal artifact of one agent run.
- Always
Approve - Always returns
Approve— useful as the supervised-mode default when an operator wants the supervised event sequence (ToolCallApproved→ToolStart) but no actual gating logic. - Annotated
- Newtype that bundles a value
Twith the reducerRthat should merge it. The wrapper is a standalone helper users compose into their state types; it does not hook intoStateGraph::add_nodedirectly. - Append
- Append:
currentfollowed byupdate. Specialised forVec<U>whereU: Clone + Send + Sync + 'static. - Approval
Layer tower::Layer<S>that gates aService<ToolInvocation, Response = Value, Error = Error>through anApprover. Construct viaApprovalLayer::new; attach to aToolRegistryviaentelix_core::tools::ToolRegistry::layer.- Approval
Request - Read-only context the
Approversees for each decision. - Approval
Service tower::Service<ToolInvocation>produced byApprovalLayer. Public so operators that wire dispatch paths manually can compose it directly.- Audit
Sink Handle Arc-shaped handle thecrate::context::ExecutionContextextension carries. WrapsArc<dyn AuditSink>in a newtype so theExtensionsslot lookup byTypeIdis unambiguous.- Bedrock
Credential Provider aws - Chain-aware credential provider for
crate::bedrock::BedrockTransport. - Bedrock
Signer aws - Stateless SigV4 signer for Bedrock requests.
- Bedrock
Transport aws - AWS Bedrock Runtime transport.
- Bedrock
Transport Builder aws - Fluent builder for
BedrockTransport. - Broadcast
Sink - Multi-consumer broadcast sink. Each subscriber gets its own
Receiver; slow consumers receiveLaggederrors but the agent never blocks. Suitable forSSEfan-out +OTelexporter - Budget
policy - Per-tenant cumulative spend ceiling. Compared against
CostMeter::spent_by(tenant)at pre-request time. - Buffer
Memory - Bounded conversation buffer.
- Byte
Count Token Counter - Zero-dependency conservative counter —
bytes.div_ceil(4). - Cached
Token Provider - Cache + single-flight wrapper around a
TokenRefresher. - Calculator
calculatortool — generated fromcalculatorby#[tool]. Register via [SchemaToolExt::into_adapter].- Calculator
Input - Typed input for the
Calculatortool. - Calculator
Output - Typed output of
calculator— surfaces both the original expression (for round-trip diagnostics) and the evaluatedf64. - Capture
Sink - In-memory capture sink for integration tests. Every emitted
event is appended to an
Arc<Mutex<Vec<_>>>; tests inspect the vector to assert ordering and content. - Channel
Approver - Production-shape approver backed by an
mpscchannel. - Channel
Approver Config - Configurable timeout for waiting on operator decisions.
- Channel
Sink - Single-consumer mpsc sink. Construct via
Self::new— the caller keeps thetokio::sync::mpsc::Receiverfor downstream consumption (HTTP SSE driver, file logger, etc.). - Chat
FewShot Prompt Template - Chat-shape few-shot prompt.
- Chat
Model - Configurable chat model — codec + transport + layer stack.
- Chat
Model Config - Builder-side configuration that flows into every
ModelRequesttheChatModelissues. Stored separately from the leaf service so layers / streaming / future surfaces share one source of truth. - Chat
Model Sampling Provider mcp-chatmodel - Adapter from
SamplingProvidertoentelix_core::ChatModel<C, T>. Cheap to clone — the underlying chat model isArc-backed. - Chat
Prompt Template - Heterogeneous list of templated messages and placeholders. Renders to
Vec<Message>— the input type expected byentelix_core::ChatModel. - Chat
State - State for
crate::create_chat_agentand the simplest single-turn recipes — just the conversation so far. - Checkpoint
- One snapshot of graph progress for a particular
(tenant_id, thread_id).next_node = Noneindicates the graph terminated cleanly (a finish point ran or a conditional edge routed toEND). - Checkpoint
Id - Stable identifier for a checkpoint. Backed by UUID v7 — time-ordered and globally unique across processes.
- Compacted
History - Compacted view over a
SessionGraph’s event log. - Compiled
Graph - Frozen graph ready to execute.
- Conditional
Edge - One conditional-edge dispatch.
- Configured
Runnable<I, O>adapter that runsconfigureron a clonedExecutionContextbefore forwarding to the inner. The originalctxthe parent passed in is left untouched.- Consolidating
Buffer Memory - Layered memory: a
BufferMemoryfor recent turns, aSummaryMemoryfor the running summary, and aSummarizerthat bridges the two when the buffer’s policy fires. - Consolidation
Context - Inputs that a
ConsolidationPolicyconsults when deciding whether to consolidate. Carries the buffer plus optional signals (last-consolidated-at, current/available context tokens) so non-trivial policies — for example, “summarise once we use 80 % of the model’s context window” or “throttle consolidation to at most once per hour” — can express their decision without embedding their own clock or token counter. - Contextual
Chunker - Anthropic Contextual Retrieval chunker. Each chunk’s content is
rewritten as
<contextual prefix>\n\n<original chunk>where<contextual prefix>is a model-generated 50-100 token summary of how the chunk relates to its parent document. - Contextual
Chunker Builder - Builder for
ContextualChunker. Construct viaContextualChunker::builder; chain config setters; finalise withSelf::build. - Contributing
Node Adapter Runnable<S, S>adapter that snapshots the inbound state, runs an innerRunnable<S, S::Contribution>to produce only the slots the node touched, and folds that contribution into the snapshot viaS::merge_contribution.- Corrective
RagState - State the corrective-RAG graph drives across nodes. Carries the original + current query, the rewrite history, the last retrieval batch + verdicts, the surviving correct subset, and the terminal answer.
- Cost
Calculator Adapter - Adapter that bridges any
CostCalculator(ChatModelpricing source) into theEmbeddingCostCalculatorsurface. - Cost
Meter policy - Per-tenant cost ledger. Records the cumulative spend for every tenant that has ever been charged.
- Crag
Config - Operator-tunable knobs for the corrective-RAG recipe. Construct
via
Self::neworSelf::default; chainwith_*setters. - Document
- The unit a RAG pipeline moves around — content plus everything downstream needs to know about where it came from.
- Document
Id - Stable identifier for a
Documentwithin itsNamespace. Loaders mint these from the source’s natural id (S3 object key, Notion page id, file path); splitters derive child ids by suffixing the parent id with:<chunk_index>. - Dropping
Sink - No-op sink — the agent runs to completion without surfacing per-event telemetry. Default when no sink is configured.
- EdgeId
- Stable, opaque edge identifier minted by the backend.
- Elicitation
Request mcp - Elicitation request as it arrives from the server. Both
fields ride straight from the JSON-RPC
paramsblock. - Embedding
- One embedded text’s vector plus optional usage metadata.
- Embedding
Retriever - Adapter that combines an
Embedderand aVectorStore(scoped to oneNamespace) into aRetriever. - Embedding
Usage - Token-accounting metadata an
Embedderreports alongside the computed vector. Mirrors theChatModelUsageshape so cost meters can charge embedding calls with the same machinery they use for completions. - Entity
Memory - Map of
entity_name → EntityRecordkeyed by namespace. - Entity
Record - One entity’s recorded fact plus provenance metadata.
- Episode
- One time-stamped episode of operator-shaped payload.
- Episode
Id - Stable identifier for one episode. Backed by UUID v7 so two ids minted in order compare in the same order — the audit trail and external correlation paths stay consistent without a separate sequence column.
- Episodic
Memory - Time-ordered append-only episode store keyed by
Namespace. - Error
Envelope - Typed wire shape of an
Error— the canonical inspector at sink / SSE / audit boundaries. Built byError::envelope; never constructed externally so the field set evolves under the same patch-version-stability guarantee aswire_codeitself. - Execution
Context - Carrier for request-scope state that every
Runnable,Tool, and codec sees. - Extensions
- Type-keyed cross-cutting state attached to an
crate::ExecutionContext. Operators add their own values viacrate::ExecutionContext::add_extensionand read them back viacrate::ExecutionContext::extension. - Fail
Open Sink - Composition adapter that swallows the inner sink’s errors and
always returns
Ok(()). - Fallback
Runnable<I, O>adapter that falls back through a list of alternatives when the primary returns a classifier-approved transient error.- FanOut
Sink - Callback-shaped fan-out — every emitted event reaches every inner sink in registration order.
- FewShot
Prompt Template - String-shape few-shot prompt.
- Fixed
Example Selector - Returns the configured examples verbatim, regardless of input.
- Foundry
Credential Provider azure - Azure-credential-backed refresher. Generic over any
Arc<dyn TokenCredential>— the caller picks the chain. - Foundry
Transport azure - Azure AI Foundry HTTP transport.
- Foundry
Transport Builder azure - Fluent builder for
FoundryTransport. - GenAi
Metrics otel - Pre-built per-call instrument set.
- Graph
Hop - One traversal hop produced by
GraphMemory::traverseorGraphMemory::find_path. - Head
Drop Compactor - Reference compactor: drop oldest turns until the rendered
character count fits under
budget_chars. Tool round-trips stay paired by construction; the strategy never partially includes a turn. - HfToken
Counter tokenizer-hf TokenCounterbacked by a HuggingFaceTokenizer.- Host
Allowlist - Host allowlist. Fail-closed: empty allowlist rejects everything.
- Http
Fetch Tool - HTTP fetch
Toolfor agentic workflows. - Http
Fetch Tool Builder - Builder for
HttpFetchTool. - Http
McpClient mcp - Production
McpClient— JSON-RPC 2.0 over MCP streamable-http. - Identity
Reranker - No-op
Reranker: returns the firsttop_kcandidates in the order the underlyingVectorStoreproduced them, copying the retrieval score intoRerankedDocument::rerank_scoreso downstream consumers see a uniform shape. - InMemory
Checkpointer - In-process checkpointer backed by a
HashMap<(tenant_id, thread_id), Vec<Checkpoint>>. The composite key encodes Invariant 11 (multi-tenant isolation): the samethread_idunder two tenants resolves to two distinct histories. - InMemory
Graph Memory - In-process
GraphMemorybacked byBTreeMapadjacency lists, sharded per namespace. - InMemory
Session Log - In-process
SessionLogfor single-binary deployments and tests. - InMemory
Skill Skillwhose body lives in struct fields. Construct viaInMemorySkillBuilder.- InMemory
Skill Builder - Fluent builder for
InMemorySkill. - InMemory
Store - In-process
Store<V>backed by aHashMapkeyed by(rendered_namespace, key). Cheap to clone — internal state isArc<Mutex<...>>-shared. - InMemory
Vector Store - In-process
VectorStorebacked by a per-namespaceVec<Slot>. - Ingest
Error - One per-document failure recorded during ingestion. Carries the originating document id (when known) and a stage label identifying which pipeline phase failed.
- Ingest
Report - Outcome counters and per-document failure list a single
IngestionPipeline::runproduces. - Ingestion
Pipeline - End-to-end RAG ingestion pipeline. Construct via
Self::builder; finalise withIngestionPipelineBuilder::build; drive withSelf::run. - Ingestion
Pipeline Builder - Builder for
IngestionPipeline. Required components (loader / splitter / embedder / store) come in viaIngestionPipeline::builder; optionalChunkerentries accumulate viaSelf::add_chunker. - Json
Output Parser - Parses an assistant
Messageas JSON intoT. - Length
Based Example Selector - Selector that caps the rendered example total at a character budget.
- Lineage
- Split-history — survives every transformation. A leaf chunk’s
Lineagedescribes which parent it came from, which split produced it, and which chunkers ran over it. Audit / debug flows reconstruct the path from a retrieval hit back to the ingestion source by walking the lineage chain (parent_id → loader’s source URI). - List
Skills Tool - T1 listing — returns
[{name, description, version}, ...]for every skill registered in the boundSkillRegistry. - LlmFacing
Schema - JSON-Schema sanitiser — strips schemars / draft-meta keys that vendor APIs ignore but that still cost tokens to ship.
- LlmQuery
Rewriter - Reference LLM-driven
QueryRewriter. Asks the suppliedRunnable<Vec<Message>, Message>model for a corrected query, then trims surrounding whitespace and quote marks. - LlmQuery
Rewriter Builder - Builder for
LlmQueryRewriter. - LlmRetrieval
Grader - Reference LLM-driven
RetrievalGrader. Asks the suppliedRunnable<Vec<Message>, Message>model to classify relevance, then parses the reply into aGradeVerdict. Operators inheriting from this default tune the prompt viaLlmRetrievalGraderBuilder::with_instructionor write their own grader from scratch. - LlmRetrieval
Grader Builder - Builder for
LlmRetrievalGrader. - Lock
Guard postgresorredis - Owned proof that the holder currently has exclusive access to a key.
- Mapping
Runnable<I, P>adapter applying a pure synchronous function to the inner’s output.- Markdown
Structure Splitter - Heading-aware markdown splitter.
- Max
- Keep the larger of
current/updateperT: Ord. Useful for “highest score wins” reducers andusizestep counters merged across parallel branches. - McpCompletion
Argument mcp - Argument being completed.
- McpCompletion
Result mcp - Response to a
completion/complete. - McpManager
mcp - Per-tenant pool of
McpClientinstances. - McpManager
Builder mcp - Builder for
McpManager. Records configurations only — no I/O, no connection attempts. - McpPrompt
mcp - One prompt template published by an MCP server.
- McpPrompt
Argument mcp - One argument expected by a prompt.
- McpPrompt
Invocation mcp - Result of a
prompts/getinvocation — a description plus an ordered transcript of messages the agent should add to its context. - McpPrompt
Message mcp - One message in a
prompts/gettranscript. - McpPrompt
Resource Ref mcp - Resource block embedded inside a
McpPromptContent::Resource. - McpResource
mcp - One resource published by an MCP server.
- McpRoot
mcp - One workspace / filesystem root the client exposes to the server.
- McpServer
Config mcp - Connection details for one MCP server.
- McpTool
Adapter mcp - Adapter that exposes one MCP tool through the entelix
Tooltrait. - McpTool
Definition mcp - One tool published by an MCP server.
- Merge
Map - Merge two
HashMap<K, V>s, right-biased — entries fromupdateoverwrite collisions incurrent. (Right-bias matches typical LangGraph / dict-update semantics.) - Merge
Node Adapter Runnable<S, S>that runs an innerRunnable<S, U>and merges the resultingUback into a fresh copy of the inboundSvia the supplied closure.- Messages
Placeholder - Placeholder whose value at render time is a
Vec<Message>(typically chat history). - Metered
Embedder Embedderdecorator that emits OTel-compatible telemetry per call (and optional cost viaEmbeddingCostCalculator).- MmrReranker
- Maximal Marginal Relevance reranker.
- Model
Hint mcp - One model hint (a name string the server suggests).
- Model
Preferences mcp - Operator hints + priorities the server passes to bias model selection. All fields optional — the provider chooses how to honour them (or ignores them entirely).
- Model
Pricing policy - Per-model pricing, in cost units per 1000 tokens. The unit is
caller-defined (USD cents, GBP pence, internal credits) — the
meter is unit-blind and just sums
Decimals. - Namespace
- Hierarchical key prefix for memory operations.
- Namespace
Prefix - Hierarchical prefix used by
crate::Store::list_namespaces. - Never
Consolidate - Never trigger. Useful as a default when consolidation is wired but the operator wants to disable it temporarily without rebuilding the agent graph.
- NodeId
- Stable, opaque node identifier minted by the backend.
- OnMessage
Count - Trigger consolidation once the buffer reaches
max_messages. - OnToken
Budget - Trigger consolidation when the buffer’s total text length
(summed UTF-8 byte length of every
ContentPart::Text) exceedsmax_bytes. Approximates a token-budget gate without needing a tokenizer in the SDK. - Open
AiEmbedder embedders-openai - Concrete
Embedderbacked by OpenAI’s/v1/embeddingsHTTPS endpoint. Stateless beyond the connection pool insidereqwest::Client; clone freely or wrap inArcper F10. - Open
AiEmbedder Builder embedders-openai - Builder for
OpenAiEmbedder. - Otel
Layer otel - Layer that emits GenAI semconv events around the wrapped
service. Cloning is cheap (
Arcs internally). - Otel
Service otel Serviceproduced byOtelLayer. SpecialisedService<ModelInvocation>andService<ToolInvocation>impls below.- Pending
Approval - One in-flight approval — the operator side. Read these from
the
Receiverpaired withChannelApprover; resolve by sending anApprovalDecisionon the embeddedreply. - Pending
Approval Decisions - Resume-side mapping from
tool_use_idto the operator’s decision. Attached toExecutionContext::extensionso the agent’s approval layer reads the decision during a re-fired dispatch and short-circuits the approver for anytool_use_idwhose decision is present. - PgGraph
Memory graphmemory-pg - Postgres-backed
GraphMemory<N, E>. - PgGraph
Memory Builder graphmemory-pg - Fluent builder for
PgGraphMemory. UsePgGraphMemory::builder. - PgVector
Store vectorstores-pgvector - Concrete
VectorStorebacked by Postgres + pgvector. - PgVector
Store Builder vectorstores-pgvector - Builder for
PgVectorStore. - PiiPattern
policy - One named redaction pattern.
- Policy
Extras - Optional signals fed into
BufferMemory::should_consolidate_with. Operators that don’t track tokens or last-consolidated time can passSelf::defaultand the policy will see the buffer plus whatever the buffer itself tracks viaBufferMemory::mark_consolidated. - Policy
Layer policy - Layer that wraps an inner service with per-tenant policy enforcement.
- Policy
Registry policy - Runtime registry mapping
tenant_id→TenantPolicy. - Policy
Service policy Serviceproduced byPolicyLayer. Generic over the inner service type; specialisedService<ModelInvocation>andService<ToolInvocation>impls below.- Postgres
Checkpointer postgres - Postgres-backed
Checkpointer<S>. - Postgres
Lock postgres - Postgres-backed distributed lock.
- Postgres
Persistence postgres - Postgres-backed persistence bundle. Cheap to clone — the pool is reference-counted internally.
- Postgres
Persistence Builder postgres - Fluent builder for
PostgresPersistence. UsePostgresPersistence::builder(). - Postgres
Session Log postgres - Postgres-backed
SessionLog. - Postgres
Store postgres - Postgres-backed
Store<V>. - Pricing
Table policy - Lookup of model name →
ModelPricing. Keys are the same model strings the codecs send to the wire (e.g."claude-opus-4-7","gpt-4.1"). Lookup is exact; aliases are the caller’s responsibility. - Prompt
Template - A Jinja2-syntax template that renders to
Stringfrom a variables map. - PutOptions
- Per-write knobs the operator may attach when calling
Store::put_with_options.Default::default()corresponds to the simpleStore::putpath: no TTL, no extra metadata. - Qdrant
Vector Store vectorstores-qdrant - Concrete
VectorStorebacked by a single qdrant collection. - Qdrant
Vector Store Builder vectorstores-qdrant - Builder for
QdrantVectorStore. - Quota
Limiter policy - Composite quota gate.
- ReAct
Agent Builder - Fluent builder for a ReAct-style
Agent<ReActState>. - ReAct
State - State for
crate::create_react_agent— messages plus a step count to make traces easier to inspect. - Read
Skill Resource Tool - T2 → T3 transition — read one resource from one skill.
- Recursive
Character Splitter - Recursive character-budget splitter.
- Redis
Checkpointer redis - Redis-backed
Checkpointer<S>. - Redis
Lock redis - Redis-backed distributed lock.
- Redis
Persistence redis - Redis-backed persistence bundle. Cheap to clone — the connection manager is reference-counted internally.
- Redis
Persistence Builder redis - Fluent builder for
RedisPersistence. - Redis
Session Log redis - Redis-backed
SessionLog. - Redis
Store redis - Redis-backed
Store<V>. - Regex
Redactor policy - Regex-driven PII redactor.
- Rendered
ForLlm - Sealed carrier for a model-facing value of type
T. Constructed only byLlmRenderable::for_llm’s default impl — the constructor ispub(crate), so an external crate that implementsLlmRenderable<T>for its own type can overriderender_for_llm(the raw producer) but cannot overridefor_llm(the carrier-producing wrapper) because it has no way to reachRenderedForLlm::new. Emit sites that acceptRenderedForLlm<T>therefore receive a value that structurally must have come through the trait funnel. - Replace
- Last-write-wins. Matches the current
StateGraphdefault — included so users who explicitly opt into reducer machinery have a no-op option. - Request
Overrides ModelRequest-shaped sampling overrides — temperature, top-p, max tokens, stop sequences, reasoning effort, tool choice, response format. Patched onto the call’scrate::context::ExecutionContextviaadd_extension.- Reranked
Document - One reranked document paired with the score the
Rerankerassigned. - Retrieval
Query - Declarative description of one retrieval call.
- Retrieved
Document - One retrieved document with optional similarity score.
- Retrying
Runnable<I, O>adapter applying aRetryPolicyto the inner runnable on every invocation.- RunBudget
- Six-axis usage cap shared across one logical run (parent
agent + every sub-agent it dispatches). Cloning the budget —
done implicitly per
ExecutionContextclone — bumps the internalArcrefcount; sub-agent calls accumulate into the same counters as the parent’s. - RunOverrides
- Agent-loop overrides — model identifier, system prompt, recursion
cap. Patched onto the call’s
crate::context::ExecutionContextviaadd_extension. - Runnable
Compacting Runnable<Vec<Message>, Message>wrapper that compacts the input message slice through an operator-suppliedCompactorwhen the total character count meets or exceedsthreshold_chars. Below the threshold the wrapper is a no-op delegate — the inner runnable receives the originalVec<Message>unchanged.- Runnable
Lambda Runnable<I, O>backed by a user-supplied async closure.- Runnable
Parallel Runnable<I, HashMap<String, O>>that runs every registered branch in parallel against the same input.- Runnable
Passthrough Runnable<T, T>that returns its input unchanged.- Runnable
Router Runnable<I, O>that picks one of several runnables based on a predicate over the input.- Runnable
Sequence - Two
Runnables composed end-to-end.RunnableSequence<I, M, O>reads “input I → middle M → output O”. Created with.pipe(). - Runnable
ToSummarizer Adapter Summarizerthat delegates to anyRunnable<Vec<Message>, Message>— the same shape as a chat model. Prepends a configurable system instruction so the model understands the task even when the buffer itself contains only raw user/assistant turns.- Sampling
Message mcp - One conversation message in a sampling request.
- Sampling
Request mcp - Sampling request as it arrives from the server. Mirrors
the spec’s
sampling/createMessageparams block. - Sampling
Response mcp - Sampling response the client sends back. Mirrors the spec’s
sampling/createMessageresult block. - Schema
Tool Adapter - Adapter that exposes any
SchemaToolthrough the erasedTooltrait. - Search
Result - One search hit.
- Search
Tool Toolwrapper around aSearchProvider.- Semantic
Memory Embedder + VectorStore + Namespacebundle.- Send
Edge - Parallel fan-out edge.
- Session
Audit Sink - Adapter that fans
AuditSink::record_*calls into a durableSessionLog. - Session
Graph - Append-only event log for a single conversation thread.
- Session
Schema Version postgresorredis - Schema version tag for persisted payloads.
- Source
- Where a
Documentoriginated. Survives every split and chunker pass — the leaf chunk knows the source URI of the parent document and which loader produced it. - Ssrf
Safe DnsResolver reqwest::dns::Resolveimpl that vets every resolved IP againstis_ssrf_blockedbefore handing addresses back to the HTTP connector. See module docs for the threat model.- State
Erasure Sink - Adapter that erases an agent’s state type so a single
AgentEventSink<()>can fan in from heterogeneous agents (Agent<ReActState>,Agent<SupervisorState>, operator-defined state types) in a multi-agent system. - State
Graph - Builder for a state-machine graph parameterised over its state type
S. - Static
Elicitation Provider mcp - In-memory
ElicitationProviderreturning a fixed response. - Static
Resource SkillResourcewhose payload lives in a struct field — the natural shape for embedded resources and tests.- Static
Roots Provider mcp - In-memory
RootsProviderholding a fixed slice of roots. - Static
Sampling Provider mcp - In-memory
SamplingProviderreturning a fixed response. - Structured
Output Adapter - Adapts a
ChatModel<C, T>toRunnable<Vec<Message>, O>by routing everyinvokethroughChatModel::complete_typed::<O>. - Subagent
- A bounded brain↔hand pairing.
- Subagent
Builder - Builder for
Subagent. Construct viaSubagent::builder(model, &parent_registry). - Subagent
Metadata - Compact metadata snapshot of a
Subagentfor parent-side inspection — the LLM-facing identity (name,description) plus the tool surface bound at construction. Operators that list available sub-agents in a parent agent’s system prompt reach for this struct rather than calling each accessor individually. - Subagent
Tool - Wrapper exposing a
crate::agent::Agentas aTool. Built viaSubagent::into_tool. - Summary
Compactor - LLM-summary
Compactor— drops the oldest turns pastkeep_recent_turnsinto a single summarisedTurn::User, leaving the most recent turns verbatim. - Summary
Memory - Single-string summary keyed by
Namespace. - Supervisor
State - State for
crate::create_supervisor_agent— messages plus the last-active sub-agent identifier for traceability. - System
Clock Clockbacked bytokio::time::Instant. Honourstokio::time::pauseso test harnesses can simulate elapsed time without real waits.- Tenant
Id - Validating wrapper around the per-tenant scope identifier.
- Tenant
Policy policy - Per-tenant aggregate of policy handles.
- Thread
Key - Canonical addressing tuple for every tenant-scoped persistence
operation —
(tenant_id, thread_id). Encodes Invariant 11 (multi-tenant isolation) at the type level so impls cannot accidentally drop the tenant scope. Thetenant_idcarries the validatingTenantIdnewtype, so aThreadKeywhose serde payload arrived with an empty tenant is rejected at deserialize time rather than constructed and then silently mis-routed. - Tiktoken
Counter tokenizer-tiktoken TokenCounterimpl backed bytiktoken-rs.- Timed
Runnable<I, O>adapter that aborts the inner withError::DeadlineExceededif it does not complete withintimeout.- Token
Bucket Limiter policy - Per-key token-bucket limiter. Buckets are created lazily on first
try_acquire; a key never seen before starts full. - Token
Count Splitter - Recursive token-budget splitter.
- Token
Counter Registry - Routing table from
(provider, model)pairs to a vendor-accurateTokenCounter. - Token
Snapshot - One refresh result.
- Tool
Approval Event Sink Handle - Refcounted handle for
ToolApprovalEventSink. Stored inentelix_core::ExecutionContextextensions soApprovalLayerfinds the sink without taking it as a constructor argument. - Tool
Event Layer - Layer that emits per-tool
AgentEventvariants to the configured sink. - Tool
Event Service Serviceproduced byToolEventLayer. Generic over the inner service so the layer composes with any tower-stacked tool path.- Tool
Hook Layer - Layer that applies a
ToolHookRegistryaround tool dispatch. - Tool
Hook Registry - Ordered collection of tool hooks.
- Tool
Hook Request - Immutable snapshot of one tool dispatch as seen by hooks.
- Tool
Hook Service Serviceproduced byToolHookLayer.- Tool
Pair - One matched
ToolCall/ToolResultpair. Sealed: the only path to construction isCompactor::compactinternal grouping, so a pair without both halves cannot exist. - Tool
ToRunnable Adapter - Wraps any
ToolasRunnable<serde_json::Value, serde_json::Value>. - Trace
Context Transport otel Transportdecorator that stamps W3C Trace Context headers on every outbound request before delegating to the inner transport.- Typed
Model Stream - Streaming counterpart to a
complete_typedcall — raw deltas onstream, the aggregated typed payload oncompletion. - Usage
Snapshot - Frozen snapshot of
RunBudgetcounters at one point in time. Carried inAgentRunResult<S>::usage(B-5) so callers see the final tally without needing to clone the budget. - Vertex
Credential Provider gcp gcp_auth-backed token refresher.- Vertex
Transport gcp - GCP Vertex AI HTTP transport.
- Vertex
Transport Builder gcp - Fluent builder for
VertexTransport. - With
Name - Wraps any
tower::Layer<S>with a static name so external middleware participates in thecrate::ChatModel::layer_namesintrospection channel. The wrapper is transparent at thetower::Layerboundary —WithName::new("concurrency", ConcurrencyLimitLayer::new(10)).layer(inner)produces the same service the underlying layer would.
Enums§
- Agent
Event - Runtime events emitted by the agent during a single
execute/execute_streamcall. - Approval
Decision - Outcome of a single tool-dispatch approval decision.
- Bedrock
Auth aws - Auth strategy for
BedrockTransport. - Chat
Prompt Part - One slot in a
ChatPromptTemplate: either a templated message (role + text template) or a placeholder for aVec<Message>variable. - Checkpoint
Granularity - How often the compiled graph writes a checkpoint when a
Checkpointeris attached. - Cloud
Error - Failures emitted by cloud-layer machinery (credential resolution, signing, refreshable token plumbing, binary frame parsing).
- Command
- Resume directive supplied to
CompiledGraph::resume_with. - Debug
Event - Lifecycle marker for
StreamMode::Debug. - Direction
- Direction of edge traversal — outgoing edges leave a node,
incoming edges arrive at it.
Bothreturns the union. - Effect
Gate - Selector for which tool dispatches the
ApprovalLayergates through theApprover. Routes by the calling tool’sToolMetadata::effectso operators express intent once at metadata time and the layer honours it without per-tool wiring. - Elicitation
Response mcp - Operator’s answer to an elicitation. Three explicit cases — the spec distinguishes them, callers should too.
- Error
- Aggregate error returned from public entelix-core APIs.
- Error
Class - Coarse responsibility class for an
Error. Two values by design — “transient” / “permanent” is a retry-policy axis, orthogonal to responsibility, and surfaced viaError::Provider’sretry_afterfield plus theRetryClassifierpolicy surface. - Execution
Mode - Agent-level switch between immediate and human-supervised tool execution.
- Failure
Policy - Per-chunk failure policy — picks how the chunker reacts when the underlying model call fails on one chunk. See module docs for the trade-off matrix.
- Foundry
Auth azure - Auth strategy for
FoundryTransport. - Grade
Verdict - Three-way verdict the grader emits per
(query, document)pair, matching the CRAG paper’s relevance classes. - Graph
Event - One audit-log entry.
- HfTokenizer
Error tokenizer-hf - Errors raised when constructing an
HfTokenCounter. - Host
Rule - One allowlist rule.
- Include
Context mcp - How much surrounding context the server wants the client to include in the sampling call. The client decides how to honour this (the spec is intentionally vague — it’s a hint, not a contract).
- Interruption
Kind - Why a dispatch paused. SDK variants carry typed structured data
the resumer needs to thread the decision back; operator-defined
pauses surface as
Self::Customwith arbitrary payload. - Interruption
Phase - Phase at which a graph-scheduled pause fires — before the marked
node runs (
Before) or after it returns Ok (After). - McpClient
State mcp - Lifecycle position of an
crate::McpClient. - McpCompletion
Reference mcp - Reference target for a completion query.
- McpError
mcp - MCP-layer failures.
- McpPrompt
Content mcp - Content inside a
McpPromptMessage. - McpResource
Content mcp - One block of content returned by
resources/read. The MCP spec allows a singlereadto return multiple blocks (e.g. a file plus its metadata). - Open
AiEmbedder Error embedders-openai - Errors that can surface from
OpenAiEmbedder. - Operation
Kind otel - What kind of operation produced the metric. Mirrors the
gen_ai.operation.namesemconv attribute. - Persistence
Error postgresorredis - Errors that the persistence layer surfaces to its callers.
- PgGraph
Memory Error graphmemory-pg - Errors that can surface from
PgGraphMemory. - PgVector
Distance Metric vectorstores-pgvector - Distance metric used for vector similarity. Mirrors pgvector’s
own taxonomy 1:1 — operators familiar with
<=>/<->/<#>pick the metric they would have picked there. - PgVector
Index Kind vectorstores-pgvector - ANN index kind. HNSW is the production default; IVFFlat is selected when build time matters more than query latency.
- PgVector
Store Error vectorstores-pgvector - Errors that can surface from
PgVectorStore. - Policy
Error policy - Policy-layer failures.
- Prompt
Value - A variable’s value: either text (for templated parts) or a list of messages (for placeholders).
- Provider
Error Kind - Provider failure category — distinguishes transport-class
failures (the SDK never received a complete HTTP framing) from
HTTP-class failures (the vendor responded with a status). Retry
classifiers use this to make typed decisions rather than
pattern-matching on
status: 0sentinels (invariant #17). - Qdrant
Distance Metric vectorstores-qdrant - Distance metric used for vector similarity. Mirrors qdrant’s own taxonomy 1:1 — operators familiar with qdrant pick the metric they would have picked there.
- Qdrant
Store Error vectorstores-qdrant - Errors that can surface from
QdrantVectorStore. - Resource
Bound Kind mcp - Names the resource bound that fired in
McpError::ResourceBounded.#[non_exhaustive]so future bounds (per-method quota, total session bytes, …) can ship without breaking match arms. - Runnable
Event - Runtime event for
StreamMode::Events. - Sampling
Content mcp - Body of one
SamplingMessage. Tagged bytypefield on the wire — matches the MCP spec’s content-block shape. - Server
Build Error server - Construction-time failure surfaced by
crate::AgentRouterBuilder::build. - Server
Error server - HTTP-layer error returned by request handlers.
- Stream
Chunk - One chunk of a streaming
Runnableinvocation. - Stream
Mode - Which stream shape the caller wants.
- Supervisor
Decision - Decision a supervisor router emits each turn.
- Tenant
Mode server - How the router resolves the
tenant_idfor an incoming request. - Tiktoken
Encoding tokenizer-tiktoken - OpenAI BPE encoding family. Pick the variant matching the target model — see the crate-level docs for the model-to-encoding table.
- Tiktoken
Error tokenizer-tiktoken - Errors raised when constructing a
TiktokenCounter. - Token
Counter Resolution - Outcome of
TokenCounterRegistry::resolve— surfaces whether a registered entry actually matched(provider, model)or the registry’s fallback counter was returned because no entry matched. - Tool
Error - Tool-layer failures.
- Tool
Hook Decision - Decision returned by
ToolHook::before_tool. - Tool
IoCapture Mode otel - How the tool side of the layer surfaces
gen_ai.tool.inputandgen_ai.tool.outputon the dispatch span events. - Turn
- One turn in a compacted conversation. Sealed so a
Turn::Assistantcan only carryToolPairs constructed via the compactor’s internal grouping code (paired calls + results). - Unknown
Model Policy policy - Behavior when
CostMeter::chargeis called with amodelthat has no entry in thePricingTable. - Usage
Limit Breach - One
RunBudgetaxis breach — typed pair of axis-discriminator and magnitude. Each variant carries the magnitude shape the axis uses (u64count for token / request / tool-call axes,DecimalUSD for the cost axis), so axis-magnitude pairing is type-enforced rather than runtime-validated. - Vector
Filter - Predicate against
Document::metadataused byVectorStore::search_filtered. Backends translate this into their native filter language (pgvectorWHERE, qdrantFilter, lancedbwhere); backends that cannot honour a given variant fall back to filterless search and emit aLossyEncode-style warning at the operator layer.
Constants§
- CLOUD_
DEFAULT_ REFRESH_ BUFFER - Default lead time before a token’s expiry triggers a refresh.
- CONTEXTUAL_
CHUNKER_ DEFAULT_ INSTRUCTION - Default operator-facing instruction prepended to every model call. Verbatim from Anthropic’s published Contextual Retrieval recipe — lifts the model into the right framing without requiring per-corpus tuning.
- CORRECTIVE_
RAG_ AGENT_ NAME - Stable agent name surfaced on every emitted
entelix_agents::AgentEventand OTelentelix.agent.runspan. - DEFAULT_
CHUNK_ OVERLAP_ CHARS - Default overlap between consecutive chunks. ~10% of
DEFAULT_CHUNK_SIZE_CHARSpreserves enough trailing context for retrieval grounding without bloating the index. - DEFAULT_
CHUNK_ OVERLAP_ TOKENS - Default overlap between consecutive chunks in tokens. ~12.5% of
DEFAULT_CHUNK_SIZE_TOKENSpreserves enough trailing context for retrieval grounding without bloating the index. - DEFAULT_
CHUNK_ SIZE_ CHARS - Default chunk size in characters. ~1000 chars maps to roughly
200-300 tokens for English under
cl100k_base, comfortably under every shipping vendor’s per-message ceiling. - DEFAULT_
CHUNK_ SIZE_ TOKENS - Default chunk size in tokens.
512matches the typical embedding context window (text-embedding-3-smalland-largeboth cap at 8191 tokens; chunking under 512 leaves headroom for query + instruction tokens at retrieval time). - DEFAULT_
GENERATOR_ SYSTEM_ PROMPT - Default system prompt the generator node prepends to every answer-generation call. Vendor-neutral, focused on grounded answer style.
- DEFAULT_
GRADER_ INSTRUCTION - Default instruction prepended to every model call. Frames the task verbatim in the CRAG-paper terms so the model emits one of the three canonical labels.
- DEFAULT_
MARKDOWN_ HEADING_ LEVELS - Default ATX heading levels that open a new chunk.
[1, 2, 3]splits at#,##,###; deeper sub-headings (####+) stay inline. - DEFAULT_
MAX_ REWRITE_ ATTEMPTS - Default cap on rewrite-loop attempts before the recipe
surrenders and generates over whatever was retrieved last.
3is the CRAG paper’s reported sweet spot (retrieval rarely improves beyond the third rewrite). - DEFAULT_
MIN_ CORRECT_ FRACTION - Default minimum fraction of retrieved documents that must
grade
GradeVerdict::Correctfor the recipe to skip rewriting and proceed directly to generation.0.5matches the CRAG paper’s mid-confidence threshold — operators tuning for higher retrieval precision raise it; tuning for lower model spend (fewer rewrites at the cost of weaker grounding) lower it. - DEFAULT_
RECURSION_ LIMIT - Default cap on node executions per
invoke(F6 mitigation — guards against infinite cycles). - DEFAULT_
RECURSIVE_ SEPARATORS - Default separator priority list. Paragraph break → line break → word boundary → character. The empty-string fallback guarantees termination even on pathological input (one giant unbroken token).
- DEFAULT_
RETRIEVAL_ TOP_ K - Default top-k passed into the retriever on every retrieval
pass. Operator-overridable via
CragConfig::with_retrieval_top_k. - DEFAULT_
REWRITER_ INSTRUCTION - Default instruction prepended to every model call. Verbatim matches the CRAG-paper rewriter framing — the model produces one corrected query string, no surrounding explanation.
- DEFAULT_
SUMMARY_ KEEP_ RECENT_ TURNS - Default count of newest turns the
SummaryCompactorkeeps verbatim before summarising the older history into one synthetic turn. Four matches the typical LLM-agent rhythm (most recent user/assistant pair plus one preceding pair) — small enough that summarisation kicks in early, large enough that adjacent context survives. - DEFAULT_
SUMMARY_ SYSTEM_ PROMPT - Default system prompt the
SummaryCompactorsends to its summariser model when the operator does not override. Phrased as a neutral compress-the-prior-conversation instruction so it works across vendors that route system prompts identically. - DEFAULT_
TENANT_ ID - Default tenant identifier — applied when callers do not specify
one explicitly via
crate::ExecutionContext::with_tenant_id. Single-tenant deployments rely on this and never construct aTenantIdthemselves. - DEFAULT_
TOOL_ IO_ TRUNCATION otel - Default truncation cap for tool I/O capture (4 KiB). Chosen so
the typical
{"task": "..."}/{"output": "..."}payload surfaces in full while a 50 KB HTTP-fetch response truncates before ballooning the span. Operators override viaOtelLayer::with_tool_io_capture. - END
- Sentinel target meaning “terminate without running another node”. Use
in
add_conditional_edgesmapping when a branch should end the graph. - FOUNDRY_
SCOPE azure - Standard scope for Azure OpenAI / Foundry data plane access.
- HTTP_
FETCH_ DEFAULT_ MAX_ REDIRECTS - Default cap on redirect chain length.
- HTTP_
FETCH_ DEFAULT_ MAX_ RESPONSE_ BYTES - Default cap on response body size (1 MiB).
- HTTP_
FETCH_ DEFAULT_ TIMEOUT - Default per-call timeout.
- MCP_
DEFAULT_ IDLE_ TTL mcp - Default idle TTL for cached MCP clients. Operators schedule
crate::McpManager::prune_idle(typically on atokio::time::interval) to evict clients whose last use exceeded this threshold. - MCP_
DEFAULT_ LISTENER_ CONCURRENCY mcp - Default cap on the number of in-flight server-initiated dispatches per client — 32.
- MCP_
DEFAULT_ MAX_ FRAME_ BYTES mcp - Default cap on a single SSE frame’s accumulated byte length — 1 MiB.
- MCP_
DEFAULT_ TIMEOUT mcp - Default request timeout for MCP HTTP calls. MCP servers are usually local-network or sidecar deployments; 30s is generous for tools that include LLM calls themselves.
- MCP_
PROTOCOL_ VERSION mcp - MCP protocol revision this client speaks.
- OPENAI_
EMBEDDINGS_ BASE_ URL embedders-openai - Default OpenAI API base URL. Override via
OpenAiEmbedderBuilder::with_base_urlfor proxies, regional endpoints, or test fixtures. - POLICY_
DEFAULT_ MAX_ TENANTS policy - Default cap on distinct tenant ledger entries.
- POLICY_
MAX_ WARNED_ MODELS policy - Cap on distinct model names tracked under
WarnOnce. - PROVENANCE_
METADATA_ KEY - Reserved key on the persisted
metadatamap under which the pipeline stampsSource+Lineage+namespace. Carries theentelixprefix so an operator’s own metadata fields never collide. Retrieval-side consumers reach back to provenance through this nested object. - QDRANT_
CONTENT_ KEY vectorstores-qdrant - Payload key carrying the document’s content text.
- QDRANT_
DOC_ ID_ KEY vectorstores-qdrant - Payload key carrying the operator-supplied
doc_id. Distinct from qdrant’s internalPointIdso filters / scrolls can surface the operator id without a server-side reverse mapping. - QDRANT_
METADATA_ KEY vectorstores-qdrant - Payload key carrying the document’s metadata (flat map). User
metadata fields ride here as nested JSON; filter expressions
targeting metadata reference them via
metadata.<key>paths. - QDRANT_
NAMESPACE_ KEY vectorstores-qdrant - Payload key under which the rendered
Namespaceis stamped on every point. Indexed at collection-create time so themust-clause that always rides on every search/count/list query is a single index probe rather than a full scan. - SEARCH_
DEFAULT_ MAX_ RESULTS - Default cap on results returned per query.
- SERVER_
DEFAULT_ TENANT_ HEADER server - Header name conventionally used when the operator opts into
multi-tenant mode. Pass to
AgentRouterBuilder::with_tenant_header. - TEXT_
EMBEDDING_ 3_ LARGE embedders-openai - OpenAI’s higher-quality embedding model. Native dimension 3072;
can be reduced via the
dimensionsrequest parameter. - TEXT_
EMBEDDING_ 3_ LARGE_ DIMENSION embedders-openai - Native dimension of
TEXT_EMBEDDING_3_LARGE. - TEXT_
EMBEDDING_ 3_ SMALL embedders-openai - OpenAI’s lower-cost embedding model. Native dimension 1536; can
be reduced via the
dimensionsrequest parameter (operatorwith_dimensionon the builder). - TEXT_
EMBEDDING_ 3_ SMALL_ DIMENSION embedders-openai - Native dimension of
TEXT_EMBEDDING_3_SMALL. - VERTEX_
SCOPE gcp - Standard GCP IAM scope for Vertex AI generative models.
Traits§
- Agent
Event Sink - Consumer trait the agent calls for every emitted event.
- Agent
Observer - Turn-level agent-lifecycle observer.
- AnyRunnable
- Object-safe variant of
Runnablethat operates onserde_json::Valueat the public interface. Useful for tool registries, dispatch tables, and dynamic plug-in points. - Approver
- Decision-maker for supervised tool execution.
- Audit
Sink - Typed audit-event channel. See module docs.
- Budget
Cost Estimator - Precision-accurate cost projection for
crate::RunBudgetaxis enforcement. - Chat
Model Ext - Extension methods on
ChatModelthat produce typedRunnableadapters. - Checkpointer
- Persistent (or in-memory) store of
Checkpoint<S>s addressed byThreadKey. - Chunker
- Async transform applied to a sequence of chunks after a
TextSplitterran. Implementations may issue LLM calls, embedding lookups, or external metadata enrichment; theExecutionContextsupplies cancellation, deadline, and anyentelix_core::RunBudgetcaps the parent pipeline configured. - Clock
- Monotonic-clock abstraction. Implementors must produce strictly non-decreasing values; jitter or skew breaks any consumer that computes elapsed time from the difference of two reads (rate-limit buckets, exponential backoff, TTL windows).
- Compactor
- Operator-supplied compaction strategy.
- Consolidation
Policy - Decides whether the current buffered conversation should be consolidated.
- Cost
Calculator - Compute a monetary cost for one model invocation.
- Distributed
Lock postgresorredis - Acquire-then-release primitive over a distributed key.
- Document
Loader - Source-side trait the ingestion pipeline pulls documents from.
- Elicitation
Provider mcp - Async source-of-truth for elicitation answers. Mirrors the
*Providertaxonomy — async, single-purpose, replaceable. - Embedder
- Text → vector encoder.
- Embedding
Cost Calculator - Compute a monetary cost for one embedder call.
- Example
Selector - Strategy that picks which examples to inject into a few-shot prompt.
- Graph
Memory - Generic graph-of-knowledge memory. Trait so backends (Neo4j,
ArangoDB, Postgres-with-recursive-CTE) can plug in without
touching the consumer code; reference in-process impl is
InMemoryGraphMemory. - LlmRenderable
- Render a value (typically an error, sub-agent result, or
memory-recall summary) into the short, actionable form the
model is allowed to see. Implementors define
Self::render_for_llm(the raw producer); the defaultSelf::for_llmwraps the result in a sealedRenderedForLlmcarrier whose constructor is private to this crate, so emit sites that accept the carrier receive a value that structurally went through the trait. - McpClient
mcp - Backend-agnostic MCP client surface.
- Message
Runnable Compaction Ext - Extension trait that attaches
RunnableCompactingto anyRunnable<Vec<Message>, Message>. Blanket-impl’d for every such runnable so a model accepting messages — including layered models (OtelLayer,PolicyLayer,RetryService) — can chain.with_compaction(.)without a separate import per concrete type. - Named
Layer - Static identity for a
tower::Layerparticipant incrate::ChatModel::layer/ToolRegistry::layercomposition. - Output
Validator - Post-decode validator. Implementors return
Error::ModelRetryto signal theChatModelretry loop should re-prompt the model with corrective feedback. Other error variants bubble unchanged. - PiiRedactor
policy - Bidirectional PII redaction surface.
- Query
Rewriter - Async trait the corrective-RAG recipe calls when retrieval quality requires another attempt with a different query. Implementations may be LLM-driven, heuristic (query-expansion / synonym-bag), classifier-routed, or any hybrid — the recipe takes whatever string comes back and re-runs retrieval with it.
- Rate
Limiter policy - Backend-agnostic rate-limit surface.
- Reducer
- Combines a current value and an incoming update into the next value.
- Reranker
- Re-rank a candidate document set against the originating query.
- Retrieval
Grader - Async trait the corrective-RAG recipe consults for every
retrieved document. Implementations may be LLM-driven (the
canonical case, see
LlmRetrievalGrader) or keyword / heuristic / classifier-model based — the recipe doesn’t care as long as the verdict is one of the threeGradeVerdictvariants. - Retriever
- Returns documents ranked by relevance to a
RetrievalQuery. - Roots
Provider mcp - Async source-of-truth for the roots a server may discover via
roots/list. Mirrors the*Providertaxonomy — async, single-purpose, replaceable. - Runnable
- One end of a composable computation.
- Runnable
Ext - Ergonomic composition surface, blanket-implemented for every
Runnable<I, O>. - Sampling
Provider mcp - Async source-of-truth for sampling completions. Mirrors
the
*Providertaxonomy — async, single-purpose, replaceable. - Schema
Tool - Typed-I/O sibling of
Tool. Implementors getInput/Outputtyped against the model’s tool dispatch without giving up the erased trait the rest of the SDK speaks. - Schema
Tool Ext - Provided extension methods on every
SchemaTool. Lives in a separate trait so blanket-impls (e.g.Box<dyn SchemaTool>) don’t fight with the user-implementedSchemaTooltrait associated types. - Search
Provider - Adapter trait the
SearchTooldispatches to. - Semantic
Memory Backend - Object-safe consumer trait — tier 3 of the semantic-memory
layering documented at the module level. Consumers (tools,
orchestration code, recipes) take
Arc<dyn SemanticMemoryBackend>to operate on a namespace-scoped embed-and-search surface without parameterising over the concrete embedder / vector-store types. - Session
Log - Persistent durable session-event log.
- State
Merge - State-level merge: how an incoming update folds into the current
state. The dispatch-loop counterpart to
Reducer<T>, one level up — implemented on the wholeSshape rather than a single slot. - Store
- Persistent (or in-memory) key/value store, scoped by
Namespace. - Summarizer
- Reduces a buffer of conversation messages to a summary string.
- Text
Splitter - Pure-algorithm slice of a
Documentinto smaller documents. - Token
Counter - Counts tokens for budget enforcement, splitter sizing, and content-economy estimation.
- Token
Refresher - Source-of-truth that yields a fresh
Tplus its absolute expiry time when called. - Tool
Approval Event Sink - Type-erased sink for tool-approval events. The agent runtime
produces an implementation by adapting its
Arc<dyn AgentEventSink<S>>(seeToolApprovalEventSinkHandle::for_agent_sink); operators implementing custom downstream observability (OTel direct, audit-log direct) can implement this trait directly without going throughAgentEventSink<S>. - Tool
Cost Calculator - Compute a monetary cost for one tool dispatch.
- Tool
Hook - Hook for tool lifecycle policy and audit extensions.
- Unknown
Model Sink policy - Observer notified on every unknown-model charge attempt.
- Vector
Store - Vector index keyed by
Namespace. Backed by qdrant, lancedb, pgvector, etc. in companion crates.
Functions§
- build_
chat_ graph - Build the single-node chat graph (system message prepend → model
→ finish) without wrapping it into an
Agent. Use this when you want to configure the agent surface (name, sink, approver, observers) viaAgent::builderdirectly. - build_
corrective_ rag_ graph - Compile the corrective-RAG graph from operator-supplied
primitives. Use this when you need to embed the graph as a
node in a larger
StateGraph; for a ready-to-execute agent, prefercreate_corrective_rag_agent. - build_
react_ graph - Builds the compiled ReAct graph (planner ↔ tools ↔ finish loop)
without wrapping it into an
Agent. Use this when you want to configure the agent-level surface (name, sink, approver, observers) directly viaAgent::builder: - build_
supervisor_ graph - Build a supervisor graph that picks among
agentseach turn. - create_
chat_ agent - Build a single-turn chat agent: prepends
system(if non-empty) to the conversation, callsmodel, appends the reply, and finishes. - create_
corrective_ rag_ agent - Build a ready-to-execute corrective-RAG
Agent. Wrapsbuild_corrective_rag_graphin the standardAgent<S>shape so the full lifecycle (AgentEventstream, sink fan-out, observer hooks, supervisor handoff) integrates uniformly with every other recipe (create_react_agent,create_supervisor_agent,create_chat_agent). - create_
react_ agent - Builds a ReAct-style agent: model decides; if it emits tool calls, dispatch and loop back; otherwise finish.
- create_
supervisor_ agent - Build a supervisor graph that picks among
agentseach turn. - default_
pii_ patterns policy - A small starter set of PII patterns. Production deployments
almost always extend or replace these per jurisdiction; this
list exists so a
RegexRedactor::default()is non-trivial out of the box. - default_
token_ counter_ registry - Build a
TokenCounterRegistrypre-populated with every counter the enabled tokenizer features can supply. - erase
- Wrap a typed
Runnable<I, O>as anAnyRunnableby transcoding I/O throughserde_json::Value. ReturnsArc<dyn AnyRunnable>so the result drops directly into a registry. - first_
non_ finite_ vector_ value - Return the first non-finite vector element, if any.
- install_
default_ tls - Install the default
rustlscrypto provider for entelix transports. Call once near the top ofmain, before anyTransport::sendruns. - interrupt
- Pause the current dispatch with a
InterruptionKind::Customreason. The most common HITL primitive — wrap any tool-body branch, node body, or layer hook that needs to hand control back to the caller for human review. - interrupt_
with - Pause the current dispatch with a typed
InterruptionKind. Used by SDK-internal sites (the agent runtime’sApprovalLayerraisesInterruptionKind::ApprovalPendingthis way) and by operators with structured pause-reasons of their own. - is_
ssrf_ blocked - Returns
truefor IPs the SDK refuses to connect to by default. - luhn_
valid policy - Luhn-checksum validator — reject candidate runs that aren’t well-formed payment-card numbers. Strips spaces, dashes, and non-digit noise before computing.
- messages_
char_ size - Character-length proxy for the token cost of a message slice. Same
metric
HeadDropCompactoruses to compare againstbudget_chars, so threshold-driven auto-compaction can use the same yardstick. - messages_
to_ events - Render an in-flight
Vec<Message>(the shape an agent’s working state carries) into aVec<GraphEvent>thatCompactor::compactcan consume. Inverse ofCompactedHistory::to_messages. - qualified_
name mcp - Build the canonical
mcp:{server}:{tool}namespaced name. - team_
from_ supervisor - Adapt a supervisor
Agent<SupervisorState>into aRunnable<Vec<Message>, Message>so it can be embedded as oneAgentEntryinside a parent supervisor — the nested-supervisor pattern. - trace_
context_ injector otel - Build an
Arc<Fn(&mut HeaderMap)>that injects the active W3C trace-context (traceparent/tracestate/baggage) into any outboundhttp::HeaderMap. - validate_
server_ name mcp - Validate an MCP server name against the documented format.
- validate_
vector_ shape - Validate vector dimension and finite values for vector-store calls.
- with_
session_ lock postgresorredis - Acquire a session lock keyed by
(tenant, thread), run the caller’s closure, then release the lock. The lock is released even iffreturns an error.
Type Aliases§
- AnyRunnable
Handle - Convenience
Arc<dyn AnyRunnable>alias for registries / dispatch tables. - BoxStream
- Boxed
Streamalias used by everystream()return type. - Document
Stream - Boxed stream type alias for documents produced by a
DocumentLoader. Items areResultso a partial-success stream can yield successful documents while reporting per-item errors — a single mid-walk failure does not abort the whole ingestion run. - DynObserver
- Convenience type alias for the dynamic-dispatch handle the agent stores internally.
- Edge
Selector - Closure that picks a conditional-edge target by inspecting state.
- Example
- One few-shot example: a map of example-prompt variable name → value.
- McpResult
mcp - Result alias used inside
entelix-mcp. - Open
AiEmbedder Result embedders-openai - Result alias used inside
entelix-memory-openai. - Persistence
Result postgresorredis - Result alias used inside
entelix-persistence. - PgGraph
Memory Result graphmemory-pg - Result alias used inside
entelix-graphmemory-pg. - PgVector
Store Result vectorstores-pgvector - Result alias used inside
entelix-memory-pgvector. - Policy
Result policy - Result alias used inside
entelix-policy. - Prompt
Vars - Map of variable name → value, accepted by
ChatPromptTemplate::renderand theRunnableimpl. - Qdrant
Store Result vectorstores-qdrant - Result alias used inside
entelix-memory-qdrant. - Request
Decorator mcp - Hook that decorates outgoing MCP requests with extra HTTP headers.
- Result
- Convenience alias used across
entelix-coreand re-exported by the facade. - Retrieved
Document Id - Stable identifier for an indexed document. Backends mint these
at insertion time; passing the same id to
VectorStore::updateorVectorStore::deleteis the canonical way to mutate or remove a previously-indexed document. - Send
Merger - Two-state merger applied per branch result during a send-edge
fold — the dispatch loop calls it once per branch with
(folded_so_far, branch_state) -> next_folded. - Send
Selector - Closure returning the parallel branches a send edge dispatches.
Each pair is
(target_node_name, branch_state); target nodes run concurrently with their respective branch states. - Server
Build Result server - Result alias used by
crate::AgentRouterBuilder::build. - Server
Result server - Result alias used by every handler in
entelix-server. - Shared
Example Selector - Convenience type-alias for selectors handed around as trait objects.
- Tool
Result - Result alias used inside
entelix-tools.
Attribute Macros§
- tool
- Generate an
entelix_tools::SchemaToolimpl from an async fn. See the crate-level docs for the contract and an example.
Derive Macros§
- State
Merge - Derive
entelix_graph::StateMergeand generate the<Name>Contributioncompanion struct.