LangChain for Rust: a library for building LLM-powered applications with composable chains, agents, tools, and vector stores.
tryAGI/LangChain
C# implementation of LangChain for building LLM applications with composable chains, vector search and document loaders on .NET.
- Stars
- 1,080
- Forks
- 147
- Open issues
- 50
- Last commit
- 4 days ago
What is it?
LangChain .NET is a C# port of the LangChain framework for building applications on top of large language models. It follows the original's abstractions where possible, so developers familiar with LangChain in Python or JavaScript can map concepts directly, while staying open to new entities where the .NET ecosystem calls for them.
The library provides model provider integrations, embedding models, vector database connectors such as SQLite, and document loaders such as a PDF loader. Developers can load documents, store embeddings, retrieve similar documents for a question, and pass them to an LLM, either through direct async method calls or by composing steps into a chain with a pipe-style syntax.
The project is MIT licensed and distributed as NuGet packages, with a wiki, examples and integration tests in the repository.
Key features
- 01Composable chains that pipe retrieval, prompt templating and LLM calls together
- 02Vector database integration with SQLite, plus embedding model support
- 03Document loading from PDFs and URLs, with configurable text splitting
- 04Async methods for direct use without chains
- 05Distributed as NuGet packages for .NET projects
Use cases
- Building question-answering over your own PDF or document collection in a .NET app
- Prototyping retrieval-augmented generation pipelines in C#
- Porting LangChain-style LLM workflows from Python to a .NET codebase
Quick start
- 1
Install the LangChain NuGet package
dotnet add package LangChain - 2
Read the wiki for getting started guidance
Things to know
- Requires an API key from a model provider such as OpenAI to run the sample code.
Topics
FAQ
- What is LangChain?
- C# implementation of LangChain for building LLM applications with composable chains, vector search and document loaders on .NET. LangChain .NET is a C# port of the LangChain framework for building applications on top of large language models. It follows the original's abstractions where possible, so developers familiar with LangChain in Python or JavaScript can map concepts directly, while staying open to new entities where the .NET ecosystem calls for them.
- Is LangChain free to use? What license does it have?
- LangChain is open source under the MIT license. Check the license terms before using it in commercial products.
- Is LangChain still maintained?
- Actively maintained. The last commit to LangChain was on Nov 2, 2026.
- What can I use LangChain for?
- Building question-answering over your own PDF or document collection in a .NET app Prototyping retrieval-augmented generation pipelines in C# Porting LangChain-style LLM workflows from Python to a .NET codebase
- How do I install LangChain?
- Install the LangChain NuGet package: dotnet add package LangChain Read the wiki for getting started guidance
- Where can I get LangChain?
- The source code and installation instructions are on GitHub: https://github.com/tryAGI/LangChain
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
An SDK for building AI agents and multi-agent systems in Python, .NET and Java, with model, plugin and vector database integrations.
A Dart and Flutter port of LangChain for building LLM-powered apps with pluggable model providers, RAG, and agents.
FastAPI backend for a conversational RAG agent that embeds documents into Qdrant, runs semantic and hybrid search, and answers questions with LLMs.
A Chinese-language tutorial that teaches beginner developers to build LLM applications, centered on a personal knowledge-base assistant using LangChain and RAG.
Open-source deep research tool that searches and reasons over private data using LLMs and vector databases.