entelix
English | 한국어
Where every agent realizes its purpose.
General-purpose agentic-AI SDK in Rust. Build any agent that runs an LLM-driven control loop with tools, memory, and durable state. Multi-tenant from day 1. OpenTelemetry GenAI semconv-native. Architectural invariants enforced by CI. Anthropic managed-agents shape. LangChain + LangGraph parity.
Why entelix?
- Multi-tenant first —
TenantIdmandatory at every persistence boundary; PostgresFORCE ROW LEVEL SECURITYis defense-in-depth on every backend; cross-tenant leakage is structurally impossible by API design. - Type-enforced architecture — sealed
RenderedForLlm<T>carrier (compile-time LLM / operator channel separation); sealedCompactedHistory(tool_call/tool_resultpair invariant impossible to break);TenantIdnewtype with validating constructor. - Production observability from day 1 — OpenTelemetry GenAI semconv
gen_ai.*attributes; cost emits transactionally (Okbranch only); typedAuditSinkchannel for sub-agent dispatch, supervisor handoff, wake-resume, memory recall, usage-limit breach, context-compaction, tool-error termination, and HITL pause-resume. - Cross-vendor IR — Anthropic Messages, OpenAI Chat, OpenAI Responses, Gemini, Bedrock Converse codecs route across Direct, Bedrock (SigV4), Vertex (gcp_auth), Foundry (api-key + AAD).
LossyEncodewarnings on every coerced field,Other { raw }for unknown vendor signals — no silent fallback. - MCP first-class — every server-initiated channel (
Roots,Elicitation,Sampling); per-tenant(tenant_id, server_name)pool isolation; HTTP-only by design. - CI-enforced invariants —
cargo xtask invariantsruns typed-AST visitors per push: filesystem-free, naming taxonomy, silent-fallback, lock-ordering, public-API drift, supply-chain, feature-matrix.
Quick Start
use Arc;
use ApiKeyProvider;
use AnthropicMessagesCodec;
use Message;
use DirectTransport;
use ;
async
Highlights
Cross-vendor IR + typed structured output
let model = new
.with_validation_retries; // schema-mismatch retry budget
let reply: Translation = model
. // typed structured output
.await?;
LCEL composition
use ;
let chain = prompt.pipe.pipe; // compile-time I/O checking
let result = chain.invoke.await?;
StateGraph control flow (LangGraph parity)
use ;
let graph = new
.add_contributing_node // typed delta + per-field merge
.add_send_edges // parallel fan-out
.add_conditional_edges
.set_entry_point
.with_checkpointer // resume after crash
.compile?;
Auto-compaction
use ;
// Drop oldest turns when context approaches threshold.
let model = my_model.with_compaction;
// Or LLM-summary compaction.
let summariser = new;
let model = my_model.with_compaction;
Production HTTP server
use ;
let router = new
.with_checkpointer
.with_tenant_header // multi-tenant strict mode
.build?;
let listener = bind.await?;
serve.await?;
Endpoints: POST /v1/threads/{thread_id}/runs, GET /v1/threads/{thread_id}/stream, POST /v1/threads/{thread_id}/wake, GET /v1/health.
Tools — built-in + #[tool] macro
use tool;
/// Add two numbers. // first paragraph → LLM-facing description
async
// Generates `Add` unit struct + `SchemaTool` impl + JSON Schema.
Built-ins: HttpFetchTool (layered SSRF defense — allowlist, DNS resolver, redirect / size caps), CalculatorTool, SchemaTool typed-I/O adapter. Sandboxed shell / file / code tools live in the entelix-tools-coding companion crate and delegate every syscall through the Sandbox trait.
Memory patterns
BufferMemory (sliding window), SummaryMemory (rolling LLM summary), ConsolidatingBufferMemory (auto-summary on size threshold), EntityMemory, EpisodicMemory<V>, SemanticMemory<E, V> (vector retrieval), GraphMemory<N, E> (typed nodes + timestamped edges, BFS + shortest-path).
MCP — every server-initiated channel
use ;
let server = http
.with_roots_provider
.with_sampling_provider;
What entelix is NOT
- No direct filesystem / shell calls in first-party crates — sandboxed wrappers live in
entelix-tools-coding; every syscall delegates through theSandboxtrait. ConcreteSandboximpls (Landlock / Seatbelt / e2b / modal) ship as companion crates. - No local inference — application-layer SDK; pair with
candle/mistral.rsif needed. - No vector DB reimplementation — production
VectorStoreimpls ship asentelix-memory-qdrant/entelix-memory-pgvector; bring your own via the trait. - No document loaders — that's
swiftide's job. - No Python interop — Rust-first.
Workspace
entelix-core is the DAG root and depends on no other entelix crate. The facade entelix crate gates optional sub-crates behind feature flags.
- Canonical crate list + feature flags →
crates/entelix/Cargo.toml(fullenables every feature) - Per-crate guidance → each
crates/<name>/CLAUDE.md - Frozen public API per crate →
docs/public-api/(facade excluded by design)
Examples
Working examples under crates/entelix/examples/ — quickstart through end-to-end production workflow.
Inspirations
- Anthropic Managed Agents — Session / Harness / Hand decoupling, cattle-not-pets, lazy provisioning
- LangChain LCEL —
Runnable+.pipe()composition primitive - LangGraph — typed state-graph control flow +
Annotated[T, reducer]+ Checkpointer + HITL - OpenTelemetry GenAI semconv — vendor-neutral observability vocabulary
Reading order
CLAUDE.md— invariants, lock ordering, error conventions, managed-agent shapedocs/architecture/principles.md— living design contract- Per-crate
crates/<name>/CLAUDE.md— surface, crate-local rules, forbidden patterns docs/public-api/— frozen per-crate API baselines
Support
License
MIT.
English | 한국어
Made with Rust 🦀