Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Migration: v0.7 to v0.8

Version 0.8.0 introduced a major workspace restructure, migrating from a single-crate architecture to a multi-crate workspace. This guide covers what changed and how to migrate.

What Changed

Before (v0.7): Single Crate

All code lived in src/ of a single langchainrust crate.

After (v0.8): Workspace Architecture

The project is now organized as a Cargo workspace with a facade crate:

langchainrust/
├── crates/
│   ├── lc/               # Facade crate (package: langchainrust)
│   ├── lc-core/           # Runnable, BaseTool, output parsers, structured output
│   ├── lc-schema/         # Message types
│   ├── lc-shared/         # Shared utilities, Document type
│   ├── lc-providers/      # OpenAI, Ollama, DeepSeek, Anthropic, Gemini, etc.
│   ├── lc-agents/         # ReAct, FunctionCalling, PlanExecute, CRAG, etc.
│   ├── lc-chains/         # LLMChain, SequentialChain, RouterChain, etc.
│   ├── lc-memory/         # Buffer, Window, Summary, Persistent
│   ├── lc-embeddings/     # OpenAI, DeepSeek, Qwen, Local, Mock
│   ├── lc-vector-stores/  # InMemory, Qdrant, ChromaDB, Pinecone, etc.
│   ├── lc-rag/            # RAGPipeline, BM25, Hybrid, HyDE, GraphRAG
│   ├── lc-prompts/        # PromptTemplate, ChatPromptTemplate
│   ├── lc-callbacks/      # StdOut, LangSmith, File, OTel
│   ├── lc-tools/          # Calculator, DateTime, PythonREPL, etc.
│   ├── lc-tools-derive/   # #[tool] procedural macro
│   ├── lc-evaluation/     # 10 evaluators
│   ├── lc-guardrails/     # Input/output safety
│   ├── lc-sessions/       # Session management
│   ├── lc-langgraph/      # StateGraph, CompiledGraph
│   ├── lc-mcp/            # MCP client/server
│   └── lc-a2a/            # Agent-to-Agent protocol

Import Compatibility

The facade crate (lc) re-exports all public types under langchainrust::, so most import paths are unchanged:

#![allow(unused)]
fn main() {
// These still work exactly as before:
use langchainrust::OpenAIChat;
use langchainrust::agents::ReActAgent;
use langchainrust::memory::ConversationBufferMemory;
use langchainrust::chains::LLMChain;
}

Breaking Changes

Feature Flags

Some features moved or were renamed. Update your Cargo.toml:

Old (v0.7)New (v0.8)
features = ["qdrant"]features = ["qdrant-integration"]
features = ["mongo"]features = ["mongodb-persistence"]
features = ["redis"]features = ["redis-storage"]
features = ["sqlite"]features = ["sqlite-storage"]

Error Types

Error types are now defined in their respective sub-crates. The facade re-exports them, so most code compiles unchanged. If you referenced internal error paths directly, update to the re-exported names.

Internal Module Paths

If you used langchainrust::internal_module::... paths, they may have moved. Prefer the top-level re-exports:

#![allow(unused)]
fn main() {
// PREFER:
use langchainrust::{RAGPipeline, BM25Retriever, GraphRAG};

// AVOID (internal path may change):
use langchainrust::retrieval::pipeline::RAGPipeline;
}

New in v0.8+

  • LCEL (v0.9): pipe(), RunnableSequence, RunnableLambda, RunnableParallel, RunnableBranch, RunnableBinding
  • #[tool] macro (v0.10): Auto-generate tool implementations from functions
  • Fallbacks (v0.10): RunnableWithFallbacks for resilient pipelines
  • Assign (v0.10): RunnableAssign for injecting context into HashMap pipelines
  • Document chain streaming (v0.10): Stuff, Refine, MapReduce chains support streaming

Dependency Update

# Before (v0.7)
[dependencies]
langchainrust = "0.7"

# After (v0.8+)
[dependencies]
langchainrust = "0.11"  # Facade crate, all features available via feature flags