← all repositories
Abraxas-365/langchain-rust

LLM chains and RAG for Rust developers who miss LangChain

It ports LangChain's LLM orchestration patterns to Rust so you can build pipelines without leaving the type system.

1.3k stars Rust Language ModelsRAG · Search
langchain-rust
Not currently ranked — collecting fresh signals.
star history

What it does

langchain-rust is a Rust reimplementation of the LangChain framework. It wraps providers like OpenAI, Azure, Anthropic, and Ollama into a common interface, then lets you chain prompts, vector searches, and tools into sequential or conversational workflows. The crate also handles document ingestion from PDFs, HTML, CSV, and even Git history, feeding them into backends like Postgres, Qdrant, or SQLite for RAG. Everything is async and built around macros and builder patterns that will feel familiar if you’ve used the Python original.

The interesting bit

The most notable choice is the heavy use of macros like message_formatter! and fmt_placeholder! to construct prompts at compile time, leaning into Rust’s metaprogramming rather than string templating. It also bundles a surprising breadth of vector stores and document loaders for a young community port, suggesting the maintainers are aiming for parity rather than a minimal subset.

Key highlights

  • Supports OpenAI, Azure, Anthropic Claude, and Ollama for both chat and embeddings
  • Vector store integrations include Qdrant, Postgres, OpenSearch, SQLite, and SurrealDB
  • Document loaders cover PDF, HTML, CSV, Pandoc conversions, Git commits, and source code
  • Built-in chains for Q&A, SQL generation, conversation, and retrieval-augmented generation
  • Optional feature flags (postgres, qdrant, sqlite-vss, etc.) keep compile times selective

Verdict

Worth a look if you are already committed to Rust and need standard LLM orchestration patterns like RAG and tool-calling agents under one crate. If you are in Python or JavaScript, the original LangChain ecosystems are still far larger and better documented.

Frequently asked

What is Abraxas-365/langchain-rust?
It ports LangChain's LLM orchestration patterns to Rust so you can build pipelines without leaving the type system.
Is langchain-rust open source?
Yes — Abraxas-365/langchain-rust is open source, released under the MIT license.
What language is langchain-rust written in?
Abraxas-365/langchain-rust is primarily written in Rust.
How popular is langchain-rust?
Abraxas-365/langchain-rust has 1.3k stars on GitHub.
Where can I find langchain-rust?
Abraxas-365/langchain-rust is on GitHub at https://github.com/Abraxas-365/langchain-rust.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.