Documentation Index
Fetch the complete documentation index at: https://cognis.vasanth.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Build LLM agents in Rust without the duct tape.
TypedRunnable<I, O> flows from your prompt to your parsed struct. Tool schemas are checked at compile time. Memory, retries, fallbacks, rate limits, prompt caching, evals — all in the box. Six providers behind one client. Six vector stores behind one trait. One umbrella crate.
COGNIS_PROVIDER between openai, anthropic, google, ollama, azure, or openrouter — same code.
Real apps you can ship today
Research assistant
Planner → researcher (with web search) → writer. Sequential multi-agent in 80 lines.
Code Q&A over a repo
Walk a Rust repo, embed code chunks, answer questions with file:line citations.
Streaming UI backend
axum SSE endpoint streaming agent tokens, tool starts, and tool results to the browser.What you can build
Tool-calling agents
A model with tools, memory, and a loop that knows when to stop. Add middleware for retry, fallback, rate limits, PII redaction, and human approval.
Multi-agent systems
Sequential pipelines, supervisor routers, parallel-vote ensembles, round-robin load balancing, hierarchical trees. Or wire your own
HandoffStrategy.RAG pipelines
Documents → splitters → embeddings → vector store → retriever → prompt. Six vector store backends. An indexing pipeline that only re-embeds what changed.
Stateful graphs
Graph<S> with typed state and per-field reducers. Time-travel through checkpoints, pause for human approval, fan out in parallel — all type-checked at compile time.Production observability
LLM-aware tracing into Langfuse out of the box. Token counts, USD cost per run, prompt versioning, evaluation scores — one feature flag.
Local-first apps
Run entirely against Ollama with no API keys. Swap to a hosted provider later — the agent code doesn’t change.
Why Rust
- Compile-time guarantees. Tool schemas, message types, and graph state transitions are checked before your code runs. No “unknown variant at runtime” surprises.
- Pay only for what you use. Every external integration is feature-gated. Your binary doesn’t include OpenAI code if you only use Anthropic.
- Async-native. Built on
tokioandfutures::Stream. Streaming tokens, events, and graph state updates uses one consistent API. - One umbrella, full stack.
cognisre-exports the foundation, LLM, RAG, and graph layers. Most apps need a singleuse cognis::prelude::*;.
What’s not here yet
Honest about the gaps so you can decide whether to wait or contribute:- LangSmith and OpenTelemetry exporters — Langfuse is the supported production backend; OTel + others are on the roadmap. The
TraceExportertrait is one async method, so building your own is fast. - A hosted gateway / managed deployment — bring your own infra. Production patterns are documented; managed runtime isn’t shipping today.
- A wider provider matrix — six are battle-tested; others (Groq, Together, Bedrock direct, Cohere) are open issues looking for owners.
Where to next
Quickstart
From zero to a running agent in five minutes.
Installation
Workspace setup, feature flags, secrets handling.
Core ideas
Mental models for
Runnable, graphs, and the agent loop.Patterns
Real applications you can copy: research assistants, code Q&A, multi-agent debate, more.
API reference
Per-crate rustdoc-friendly summaries. Cross-linked to docs.rs.
Contribute
Bugs, features, integrations, docs — every contribution lane.
Like what you see? Star the repo.
Cognis is open source under MIT. Stars help other Rust devs find it.