docs.rs failed to build langchainrust-0.2.9
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
langchainrust-0.2.0
langchainrust
A LangChain-inspired Rust framework for building LLM applications.
What it solves: Build Agents, RAG, BM25 keyword search, Hybrid retrieval, LangGraph workflows - all in pure Rust.
Core Features
| Component | Description |
|---|---|
| LLM | OpenAI / Ollama compatible, streaming, Function Calling |
| Agents | ReActAgent + FunctionCallingAgent |
| Memory | Buffer / Window / Summary / SummaryBuffer |
| Chains | LLMChain / SequentialChain / RetrievalQA |
| RAG | Document splitting, vector store, semantic retrieval |
| BM25 | Keyword search, Chinese/English tokenization, AutoMerging |
| Hybrid | BM25 + Vector hybrid retrieval, RRF fusion |
| LangGraph | Graph workflows, Human-in-the-loop, Subgraph |
| Tools | Calculator / DateTime / Math / URLFetch |
| MongoDB | Persistent storage backend (feature: mongodb-persistence) |
Full documentation: 中文文档 | English
Architecture
┌─────────────────────────────────────────────────────────────┐
│ langchainrust │
├─────────────────────────────────────────────────────────────┤
│ LLM Layer │
│ ├── OpenAIChat / OllamaChat │
│ ├── Function Calling (bind_tools) │
│ └── Streaming (stream_chat) │
├─────────────────────────────────────────────────────────────┤
│ Agent Layer │
│ ├── ReActAgent / FunctionCallingAgent │
│ ├── AgentExecutor │
│ └── LangGraph (StateGraph, Subgraph, Parallel) │
├─────────────────────────────────────────────────────────────┤
│ Retrieval Layer │
│ ├── RAG (TextSplitter, VectorStore) │
│ ├── BM25 (Keyword Search, AutoMerging) │
│ ├── Hybrid (BM25 + Vector, RRF Fusion) │
│ └── Storage (InMemory, MongoDB) │
├─────────────────────────────────────────────────────────────┤
│ Utility Layer │
│ ├── Memory (Buffer, Window, Summary) │
│ ├── Chains (LLMChain, SequentialChain) │
│ ├── Prompts (PromptTemplate, ChatPromptTemplate) │
│ ├── Tools (Calculator, DateTime, URLFetch) │
│ └── Callbacks (LangSmith, StdOut) │
└─────────────────────────────────────────────────────────────┘
Installation
[]
= "0.2.6"
= { = "1.0", = ["full"] }
# Optional features
= { = "0.2.6", = ["mongodb-persistence"] } # MongoDB storage
= { = "0.2.6", = ["qdrant-integration"] } # Qdrant vector DB
Quick Start
use ;
use Message;
async
BM25 Keyword Search
use ;
let mut retriever = new;
retriever.add_documents_sync;
let results = retriever.search;
for result in results
More examples in Usage Guide (中文).
Documentation
| Docs | Content |
|---|---|
| Usage Guide (中文) | LLM、Agent、Memory、RAG、BM25、Hybrid、LangGraph 详细用法 |
| Usage Guide (English) | Detailed usage for all components |
| API Docs | Rust API documentation |
Testing
Contributing
Contributions welcome! See CONTRIBUTING.md.
License
MIT or Apache-2.0, at your option.