docs.rs failed to build langchainrust-0.2.15
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 / DeepSeek / Moonshot / Zhipu / Qwen / Anthropic Claude |
| Embeddings | OpenAI / DeepSeek / Qwen embeddings |
| 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 |
| Vector DB | InMemory / Qdrant / MongoDB |
Full documentation: 中文文档 | English
Architecture
┌─────────────────────────────────────────────────────────────┐
│ langchainrust │
├─────────────────────────────────────────────────────────────┤
│ LLM Layer │
│ ├── OpenAIChat / OllamaChat │
│ ├── DeepSeek / Moonshot / Zhipu / Qwen (OpenAI compatible) │
│ ├── AnthropicChat (Claude API) │
│ ├── Function Calling (bind_tools) │
│ └── Streaming (stream_chat) │
├─────────────────────────────────────────────────────────────┤
│ Embeddings Layer │
│ ├── OpenAIEmbeddings / DeepSeekEmbeddings │
│ └── QwenEmbeddings / MockEmbeddings │
├─────────────────────────────────────────────────────────────┤
│ Agent Layer │
│ ├── ReActAgent / FunctionCallingAgent │
│ ├── AgentExecutor │
│ └── LangGraph (StateGraph, Subgraph, Parallel) │
├─────────────────────────────────────────────────────────────┤
│ Retrieval Layer │
│ ├── RAG (TextSplitter, VectorStore) │
│ ├── BM25 (Keyword Search, AutoMerging) │
│ ├── Hybrid (BM25 + Vector, RRF Fusion) │
│ └── HyDE / MultiQuery / Reranking │
│ └── Storage (InMemory, Qdrant, MongoDB) │
├─────────────────────────────────────────────────────────────┤
│ Utility Layer │
│ ├── Memory (Buffer, Window, Summary) │
│ ├── Chains (LLMChain, SequentialChain) │
│ ├── Prompts (PromptTemplate, ChatPromptTemplate) │
│ ├── Tools (Calculator, DateTime, URLFetch) │
│ └── Callbacks (LangSmith, StdOut, multipart batch) │
└─────────────────────────────────────────────────────────────┘
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
Multi-Provider Support
use ;
let deepseek = from_env;
let moonshot = with_model;
let claude = from_env;
let ollama = new;
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.