cognis-rag
Retrieval-Augmented Generation (RAG) primitives for Cognis v2, including embeddings, vector stores, and document processing.
Purpose
cognis-rag provides the building blocks for creating RAG pipelines. It includes tools for loading documents from various formats, splitting them into manageable chunks, generating vector embeddings, and storing/retrieving them from vector databases.
Key Features
- Document Loaders: Support for Text, Markdown, JSON, CSV, PDF, HTML, and directory-based loading.
- Text Splitters: Smart splitting strategies including
RecursiveCharSplitterandMarkdownSplitter. - Embeddings: Interface for generating text embeddings with support for OpenAI, Ollama, and more.
- Vector Stores: Pluggable vector database support (Chroma, Qdrant, Pinecone, Weaviate) plus a fast
InMemoryVectorStore. - Retrievers: Advanced retrieval logic like
VectorRetriever,BM25Retriever, andEnsembleRetriever. - Indexing Pipeline: A streamlined way to load, split, embed, and store documents in one operation.
Usage
Add this to your Cargo.toml:
[]
= "0.1.0"
Basic Example: Vector Search
use *;
async