Introduction
Synaptic is a Rust agent framework with LangChain-compatible architecture.
Build production-grade AI agents, chains, and retrieval pipelines in Rust with the same mental model you know from LangChain -- but with compile-time safety, zero-cost abstractions, and native async performance.
Why Synaptic?
- Type-safe -- Message types, tool definitions, and runnable pipelines are checked at compile time. No runtime surprises from mismatched schemas.
- Async-native -- Built on Tokio and
async-traitfrom the ground up. Every trait method is async, and streaming is a first-class citizen viaStream. - Composable -- LCEL-style pipe operator (
|), parallel branches, conditional routing, and fallback chains let you build complex workflows from simple parts. - LangChain-compatible -- Familiar concepts map directly:
ChatPromptTemplate,StateGraph,create_react_agent,ToolNode,VectorStoreRetriever, and more.
Features at a Glance
| Area | What you get |
|---|---|
| Chat Models | OpenAI, Anthropic, Gemini, Ollama adapters with streaming, retry, rate limiting, and caching |
| Messages | Typed message enum with factory methods, filtering, trimming, and merge utilities |
| Prompts | Template interpolation, chat prompt templates, few-shot prompting |
| Output Parsers | String, JSON, structured, list, enum, boolean, XML parsers |
| Runnables (LCEL) | Pipe operator, parallel, branch, assign/pick, bind, fallbacks, retry |
| Tools | Tool trait, registry, serial/parallel execution, tool choice |
| Memory | Buffer, window, summary, token buffer, summary buffer strategies |
| Graph | LangGraph-style state machines with checkpointing, streaming, and human-in-the-loop |
| Retrieval | Loaders, splitters, embeddings, vector stores, BM25, multi-query, ensemble retrievers |
| Evaluation | Exact match, regex, JSON validity, embedding distance, LLM judge evaluators |
| Callbacks | Recording, tracing, composite callback handlers |
Quick Links
- What is Synaptic? -- Concept mapping from LangChain Python to Synaptic Rust
- Architecture Overview -- Layered crate design and dependency graph
- Installation -- Add Synaptic to your project
- Quickstart -- Your first Synaptic program in 30 lines
- Tutorials -- Step-by-step guides for common use cases
- API Reference -- Full API documentation