Skip to main content

RAGy

RAGy is a simple framework for building Retrieval-Augmented Generation (RAG) applications. It provides a set of tools and utilities to help you create RAG applications quickly and easily.

It ships with a simple interface for building RAG applications, as well as a set of pre-built components that you can use to get started quickly (OpenAI LLMs, Chroma vector stores, etc.).

Installation

You can install RAGy using pip:

pip install ragy

Usage

Here's a simple example of how to use RAGy to build a RAG application: For more examples please refer examples folder

from ragy.rag import RAG
from ragy.reasoning import OpenAIEmbeddingModel, OpenAIGPTEngine
from ragy.rawdoc import DirectoryRawDocumentRetriever
from ragy.vector import ChromaVectorStore

# Create a RAG interface with the necessary components
system_prompt = """
You are a helpful assistant that provides accurate and concise answers to user queries based on the retrieved documents.
Always cite the sources of your information and provide references when applicable.
Include the ID of the retrieved documents in your response to help users verify the information.
If you don't know the answer because the retrieved documents don't contain the information, say "I don't know" instead of making up an answer.
"""
embedding_model = OpenAIEmbeddingModel(model='text-embedding-3-small')
raw_document_retriever = DirectoryRawDocumentRetriever(dir='./docs')
vector_store = ChromaVectorStore(path="./chroma", collection_name='my_collection')
ai_engine = OpenAIGPTEngine(model='gpt-5.2')

rag = RAG(
    system_prompt=system_prompt,
    embedding_model=embedding_model,
    raw_document_retriever=raw_document_retriever,
    vector_store=vector_store,
    ai_engine=ai_engine
)

# Use the RAG interface to ingest documents into the vector store
rag.ingest(chunk_size=512, chunk_overlap=128)

# Use the RAG interface to generate a response to a query
response = rag.generate('What is the capital of France?')
print(response)

Contributing

Contributions to RAGy are welcome! If you have an idea for a new feature or improvement, please open an issue or submit a pull request.

Full AI generated contributions are not accepted. If you use AI to assist in writing code, please ensure that you review and understand the code before submitting it. You should also provide a clear explanation of the changes you made and the reasoning behind them in your pull request.

AI is a powerful tool that can help you write code faster and more efficiently, but it is not a substitute for human creativity and judgment. When contributing to RAGy, please use AI as a tool to assist you, rather than relying on it to do all the work for you.

We encourage you to contribute in the simplest way possible, avoiding unnecessary complexity and over-engineering. Focus on making meaningful contributions that improve the functionality and usability of RAGy, rather than trying to impress others with complex code.

What things to consider when contributing:

  • Ensure that your code is well-documented and follows the existing code style.
  • Write tests for any new features or changes you make.
  • Be respectful and considerate when communicating with other contributors.

License

RAGy is licensed under the MIT License. See the LICENSE file for more information.

Metadata

Release files for ragy 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ragy 0.3.0
File Size Uploaded
ragy-0.3.0.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ragy 0.3.0
File Interpreter ABI Platform
ragy-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.9 kB

Release files / ragy-0.3.0.tar.gz

Download URL ragy-0.3.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e6735ede609bc034255f7d2e89e6f885d5fa301972dc1eaf82e725d704de337a
BLAKE2b-256 checksum
How to use checksums
887347546a8da4dc5e0f19933b998645bce84f369a20a06cde820bff03c12fb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / ragy-0.3.0-py3-none-any.whl

Download URL ragy-0.3.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37bc3c7c3adb7e89018197c30d4453ed2b2a082504fed27ca32a446ff11d8787
BLAKE2b-256 checksum
How to use checksums
b9f71c17b87937d89ed11801dee5c5514bfeb502d456ba1e4fd819de795dc42f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page