Rust RAG Toolchain
Overview
rust-rag-toolchain is a Rust native library designed to empower developers with seamless access to common Retrieval Augmented Generation (RAG) workflows. It provides functionalities for embedding generation, storage, and retrieval, allowing developers to build AI applications with their own data.
Features
-
Retrieval Augmented Generation (RAG): Enhance your AI applications with better prompt completions based on your own knowledge base. See BasicRagChain !
-
PG Vector Support Able to store and retrieve from a postgres database with pg_vector enabled !
-
OpenAI Support Able to generate chat completions and embeddings via OpenAI to use an your AI workflows
-
Token Chunking Able to chunk your text based on a token size.
Getting Started
Prerequisites
- Rust programming language installed. Visit rust-lang.org for installation instructions. You will also need an Async Runtime; we recommend Tokio.
Installation
Add the latest version of rust-rag-toolchain to your Cargo.toml file.
Structure
The library is structured into several modules, each responsible for a specific functionality:
-
chains: This module contains the implementation of the RAG workflows. -
chunkers: This module provides utilities for breaking down data into manageable chunks. -
clients: This module contains client implementations for interacting with various services. -
common: This module contains common utilities and helper functions used across the library. -
loaders: This module provides functionalities for loading and processing data. -
retrievers: This module contains implementations for retrieving data from various sources. -
stores: This module provides functionalities for storing and managing data.
Code Examples
const SYSTEM_MESSAGE: &'static str =
"You are to give straight forward answers using the supporting information you are provided";
async
Contributing
Contributions are welcome! If you have ideas for improvements or find any issues, please open an issue or submit a pull request.
Support
For any questions or assistance, feel free to contact the maintainers:
Please raise an issue and I will get back to you quickly
Enjoy leveraging the power of retrieval augmented generation and embedding generation with rust-rag-toolchain!