🦜️🔗LangChain Rust
⚡ Building applications with LLMs through composability, with Rust! ⚡
🤔 What is this?
This is the Rust language implementation of LangChain.
Examples
rcommit: rcommit allows you to create git commits with AI
Conversational chain : A chain design for conversation, with memory
LLM chain : the core chain, customisable
Secuential chain: run chain in secuential order, with the ouput of one being the input of the next one
Vectore Store with pgvector : And implementation of vector stroe with pgvector
Vectore Store with sqlite_vss : And implementation of vector stroe with sqlite_vss
Embedding with Ollama : Embedding with Ollama
Agentes : Agent implementation for complex tasks
Open AI Tools Agent : Agent using openAi Tools
Streaming from a Chain : Streming example
Q&A chian : Question answer Chain
Installation
This library heavily relies on serde_json
for its operation.
Step 1: Add serde_json
serde_json
First, ensure serde_json
is added to your Rust project.
Step 2: Add langchain-rust
langchain-rust
Then, you can add langchain-rust
to your Rust project.
Simple install
With Sqlite
Download additional sqlite_vss libraries from https://github.com/asg017/sqlite-vss
With Postgres
With SurrialDB
Please remember to replace the feature flags sqlite
, postgres
or surrealdb
based on your specific use case.
This will add both serde_json
and langchain-rust
as dependencies in your Cargo.toml
file. Now, when you build your project, both dependencies will be fetched and compiled, and will be available for use in your project.
Remember, serde_json
is a necessary dependencies, and sqlite
, postgres
and surrealdb
are optional features that may be added according to project needs.
Quick Start Conversational Chain
Last updated