RecallAI is a cutting-edge Retrieval-Augmented Generation (RAG) framework designed for Large Language Models (LLMs). It enhances LLM responses by integrating real-time knowledge retrieval from structured and unstructured data sources.
Project description
RecallAI
Overview
RecallAI is a powerful Retrieval-Augmented Generation (RAG) framework designed to enhance the capabilities of Large Language Models (LLMs). It integrates real-time knowledge retrieval from structured and unstructured data sources, enabling more informed and accurate responses.
Features
- Retrieval-Augmented Generation (RAG): Enhances LLM responses with real-time information retrieval.
- Integration with OpenAI Models: Supports GPT-based models for improved text generation.
- Qdrant Vector Store: Efficient vector storage and retrieval for document embeddings.
- Document & Web Ingestion: Supports ingesting PDFs and web pages for knowledge retrieval.
Installation
Prerequisites
Install via PyPI
You can install RecallAI directly from PyPI:
pip install recall-ai
Manual Installation
- Clone the repository:
git clone https://github.com/AshishChandpa/RecallAI.git cd RecallAI
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
- Create a
.envfile in the project root. - Add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key
- Create a
- Ensure Qdrant is running:
docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant
Usage
Running the Example Script
Execute the script to see the RAG system in action:
python examples/example.py
Using RecallAI in Your Project
Import and use RecallAI in your Python scripts:
from recallai import RAGSystem, QdrantVectorStore, PromptManager
# Configure Qdrant connection
qdrant_store = QdrantVectorStore(
url="http://localhost:6333",
collection_name="my_rag_collection",
vector_size=1536, # adjust to your embedding dimension
)
# Initialize the RAG system
rag_system = RAGSystem(
vector_store=qdrant_store,
vector_namespace="<NameSpaceName>",
openai_api_key=os.getenv("OPENAI_API_KEY"),
)
# Retrieve documents and generate responses
user_query = "Explain the main concepts from the documents."
context = rag_system.retrieve_documents(user_query, "pdf")
instructions = "You are an expert assistant tasked with answering questions using the provided context."
prompt_manager = PromptManager(instructions=instructions)
full_prompt = prompt_manager.create_prompt(context, user_query)
answer = rag_system.chat(full_prompt, "gpt-4o-mini")
print("Answer:", answer)
Configuration
- Adjust the
QdrantVectorStoreparameters for different vector dimensions or collection names. - Modify the ingestion pipeline to include additional document sources.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License.
Contact
For questions or suggestions, reach out via email.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file recallaish-0.1.0.tar.gz.
File metadata
- Download URL: recallaish-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
479ef885215a3fb443ab4ad9df968f84b488857300e60b3d2b1766b48c4dd5de
|
|
| MD5 |
3b6fdcfb61230ba1c0c9c55bd2e60a31
|
|
| BLAKE2b-256 |
f85e56105f7f9088447ccc9c1228d90b8a104f6dd8d01adfaa74a0b18ccdc487
|
File details
Details for the file recallaish-0.1.0-py3-none-any.whl.
File metadata
- Download URL: recallaish-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9aa8148cec0aae93f5168beb86bf0cb98e42f3ba6592506e3c90d0faffd482b
|
|
| MD5 |
6765f6c635b976617e4994cc1b00fbd2
|
|
| BLAKE2b-256 |
73e4e1fce0a2db2f8f017bf49ce8b1fca80bee27553fd598d7ab66f1b8401036
|