🦜️🔗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
-
Agentes : Agent implementation for complex tasks
-
Streaming from a Chain : Streming example
Installation
This library heavily relies on serde_json
for its operation.
Step 1: Add serde_json
First, ensure serde_json
is added to your Rust project.
Step 2: Add langchain-rust
Then, you can add langchain-rust
to your Rust project.
Simple install
With Postgres
With SurrialDB
Please remember to replace the feature flags 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 postgres
and surrealdb
are optional features that may be added according to project needs.
Quick Start Conversational Chain
use ;
async