langchainrust 0.2.13

A LangChain-inspired framework for building LLM applications in Rust. Supports OpenAI, Agents, Tools, Memory, Chains, RAG, BM25, Hybrid Retrieval, LangGraph, HyDE, Reranking, MultiQuery, and native Function Calling.
[package]

name = "langchainrust"

version = "0.2.13"

edition = "2021"

license = "MIT OR Apache-2.0"

description = "A LangChain-inspired framework for building LLM applications in Rust. Supports OpenAI, Agents, Tools, Memory, Chains, RAG, BM25, Hybrid Retrieval, LangGraph, HyDE, Reranking, MultiQuery, and native Function Calling."

repository = "https://github.com/atliliw/langchainrust"

homepage = "https://github.com/atliliw/langchainrust"

documentation = "https://docs.rs/langchainrust"

readme = "README.md"

keywords = ["llm", "langchain", "ai", "rag", "agent"]

categories = ["algorithms", "asynchronous", "api-bindings", "science"]

authors = ["atliliw"]

exclude = [

    "/docs",

    "/.github",

    "/langchain",

    "/demo",

]



[dependencies]

reqwest = { version = "0.11", features = ["json", "stream", "multipart"] }

tokio = { version = "1.0", features = ["full"] }

serde = { version = "1.0", features = ["derive"] }

serde_json = "1.0"

async-trait = "0.1"

regex = "1"

uuid = { version = "1.10", features = ["v4", "v7", "serde"] }

futures-util = "0.3"

schemars = "0.8"

chrono = { version = "0.4", features = ["serde"] }

thiserror = "1.0"

qdrant-client = { version = "1.7", optional = true }

mongodb = { version = "2.8", optional = true }

pdf-extract = "0.7"

csv = "1.3"

bincode = "1.3"



[dev-dependencies]

tokio-test = "0.4"

tempfile = "3.0"



[features]

default = []

experimental = []

qdrant-integration = ["qdrant-client"]

mongodb-persistence = ["mongodb"]



[package.metadata.docs.rs]

all-features = true

rustdoc-args = ["--cfg", "docsrs"]



# ============================================================================

# 单元测试 - 不需要 API Key

# ============================================================================

[[test]]

name = "unit_schema"

path = "tests/unit/schema.rs"



[[test]]

name = "unit_prompts"

path = "tests/unit/prompts.rs"



[[test]]

name = "unit_tools"

path = "tests/unit/tools.rs"



[[test]]

name = "unit_memory"

path = "tests/unit/memory.rs"



[[test]]

name = "unit_retrieval"

path = "tests/unit/retrieval.rs"



[[test]]

name = "unit_loaders_csv"

path = "tests/unit/loaders_csv.rs"



[[test]]

name = "unit_vectorstores"

path = "tests/unit/vectorstores.rs"



[[test]]

name = "unit_callbacks"

path = "tests/unit/callbacks.rs"



[[test]]

name = "unit_tool_calling"

path = "tests/unit/tool_calling.rs"



[[test]]

name = "unit_ollama"

path = "tests/unit/ollama.rs"



# Phase 1 新增测试

[[test]]

name = "unit_parallel_tool_calls"

path = "tests/unit/parallel_tool_calls.rs"



[[test]]

name = "unit_file_handler"

path = "tests/unit/file_handler.rs"



[[test]]

name = "unit_runnable_stream"

path = "tests/unit/runnable_stream.rs"



[[test]]

name = "unit_conversation_chain"

path = "tests/unit/conversation_chain.rs"



[[test]]

name = "unit_summary_memory"

path = "tests/unit/summary_memory.rs"



[[test]]

name = "unit_router_chain"

path = "tests/unit/router_chain.rs"



[[test]]

name = "unit_retrieval_qa"

path = "tests/unit/retrieval_qa.rs"



[[test]]

name = "unit_summary_buffer_memory"

path = "tests/unit/summary_buffer_memory.rs"



[[test]]

name = "unit_providers"

path = "tests/unit/providers.rs"



[[test]]

name = "qdrant_tutorial"

path = "tests/qdrant_tutorial.rs"

required-features = ["qdrant-integration"]



# ============================================================================

# 整合测试 - 需要 API Key

# ============================================================================

[[test]]

name = "integration_agent_memory"

path = "tests/integration/agent_memory.rs"



[[test]]

name = "integration_rag_pipeline"

path = "tests/integration/rag_pipeline.rs"



[[test]]

name = "integration_chain_workflow"

path = "tests/integration/chain_workflow.rs"



[[test]]

name = "integration_agent"

path = "tests/integration/agent_test.rs"



[[test]]

name = "integration_agent_react"

path = "tests/integration/agent_react.rs"



[[test]]

name = "integration_chains"

path = "tests/integration/chains.rs"



[[test]]

name = "integration_embeddings"

path = "tests/integration/embeddings.rs"



[[test]]

name = "integration_llm_chat"

path = "tests/integration/llm_chat.rs"



[[test]]

name = "integration_rag"

path = "tests/integration/rag.rs"



[[test]]

name = "integration_rag_full"

path = "tests/integration/rag_full.rs"



[[test]]

name = "integration_callbacks"

path = "tests/integration/callbacks_integration.rs"



[[test]]

name = "integration_callbacks_llm"

path = "tests/integration/callbacks_llm_integration.rs"



[[test]]

name = "integration_tool_callbacks"

path = "tests/integration/tool_callbacks_integration.rs"



[[test]]

name = "integration_ollama"

path = "tests/integration/ollama_chat.rs"



[[test]]

name = "langsmith_connection"

path = "tests/integration/langsmith_connection.rs"



# ============================================================================

# 端到端测试 - 完整应用流程

# ============================================================================

[[test]]

name = "e2e_full_application"

path = "tests/e2e/full_application.rs"



# ============================================================================

# Function Calling 测试 - 使用原生 Function Calling

# ============================================================================

[[test]]

name = "function_calling_agent"

path = "tests/function_calling/agent_fc.rs"



# ============================================================================

# LangGraph 测试

# ============================================================================

[[test]]

name = "langgraph_basic"

path = "tests/langgraph/basic.rs"



[[test]]

name = "langgraph_conditional"

path = "tests/langgraph/conditional.rs"



[[test]]

name = "langgraph_state"

path = "tests/langgraph/state.rs"



[[test]]

name = "langgraph_recursion"

path = "tests/langgraph/recursion.rs"



[[test]]

name = "langgraph_edge"

path = "tests/langgraph/edge.rs"



[[test]]

name = "langgraph_checkpointer"

path = "tests/langgraph/checkpointer.rs"



[[test]]

name = "langgraph_example"

path = "tests/langgraph/example.rs"



[[test]]

name = "langgraph_subgraph"

path = "tests/langgraph/subgraph.rs"



[[test]]

name = "langgraph_persistence"

path = "tests/langgraph/persistence.rs"



[[test]]

name = "langgraph_parallel"

path = "tests/langgraph/parallel.rs"



[[test]]

name = "langgraph_openai_demo"

path = "tests/langgraph/openai_demo.rs"



[[test]]

name = "langgraph_subgraph_mechanism"

path = "tests/langgraph/subgraph_mechanism.rs"



[[test]]

name = "unit_bm25"

path = "tests/unit/bm25.rs"



[[test]]

name = "bm25_chunked"

path = "tests/bm25/chunked.rs"



[[test]]

name = "bm25_rag"

path = "tests/bm25/rag.rs"



[[test]]

name = "bm25_llm_integration"

path = "tests/bm25/llm_integration.rs"



[[test]]

name = "bm25_hybrid_rag"

path = "tests/bm25/hybrid_rag.rs"



[[test]]

name = "integration_bm25_real_docs"

path = "tests/integration/bm25_real_docs.rs"



# ============================================================================

# Document Loaders 测试

# ============================================================================

[[test]]

name = "unit_loaders_text"

path = "tests/loaders/text_loader_test.rs"



[[test]]

name = "unit_loaders_json"

path = "tests/loaders/json_loader_test.rs"



[[test]]

name = "unit_loaders_markdown"

path = "tests/loaders/markdown_loader_test.rs"



# ============================================================================

# MultiQuery Retriever 测试

# ============================================================================

[[test]]

name = "unit_multi_query"

path = "tests/multi_query/multi_query_test.rs"



# ============================================================================

# HyDE & Reranking 测试

# ============================================================================

[[test]]

name = "unit_hyde"

path = "tests/hyde_reranking/hyde_test.rs"



[[test]]

name = "unit_reranking"

path = "tests/hyde_reranking/reranking_test.rs"