An easy-to-use python package for building Retrieval-Augmented Generation (RAG) applications.
pip install git+https://github.com/ajthr/RAG.gitInstall specific extras based on your needs:
# For OpenAI support
pip install rag[openai]@git+https://github.com/ajthr/RAG.git
# For Ollama support
pip install rag[ollama]@git+https://github.com/ajthr/RAG.git
# For All features
pip install rag[all]@git+https://github.com/ajthr/RAG.gitHere is a minimal example to get you started:
from rag.rag_pipeline import RAGPipeline
from rag.vectordbs import ChromaDB
from rag.embeddings import SentenceTransformerEmbedding
from rag.llms import OpenAILLM
# 1. Setup Components
llm = OpenAILLM(api_key="your-api-key")
vectordb = ChromaDB(collection_name="my_rag_app")
embedding = SentenceTransformerEmbedding()
# 2. Create Pipeline
pipeline = RAGPipeline(
llm=llm,
vectordb=vectordb,
embedding=embedding
)
# 3. Index & Query
pipeline.index_documents(["RAG is powerful.", "Python is great."])
response = pipeline.query("What is RAG?")
print(response)Check the examples/ directory for more usage examples.
See the API Documentation for detailed class references.