CortexRAG library for quick search and creation of RAG systems
Project description
💡 Overview
CortexRAG is a sophisticated engine designed for automated Deep Research and Knowledge Base construction. By leveraging LangGraph for resilient multi-agent state management and LlamaIndex for high-performance data indexing, CortexRAG orchestrates the entire lifecycle: from real-time web exploration to structured RAG deployment.
Key Features:
- Multi-Model Orchestration: Seamlessly combine different LLMs for specialized tasks (e.g., fast models for search, reasoning models for synthesis).
- Graph-Based Reasoning: State-of-the-art agent coordination using directed acyclic graphs.
- Autonomous Pipeline: Automatic content cleaning, Markdown conversion, and vector storage.
- Developer-Centric: Built with clean architecture and Dishka Dependency Injection support.
🚀 Quick Start
Installation
Install the package via pip:
pip install cortexrag
Or using uv for lightning-fast dependency management:
uv add cortexrag
Usage Example
Get your research pipeline running with just a few lines of code:
from cortexrag import Engine
from cortexrag.models import Llama, Gemini
# 1. Initialize your AI Models
model_research = Llama() # Optimized for extraction
model_synthesis = Gemini() # Optimized for deep reasoning
topic = "The impact of Machine Learning on modern medicine"
# 2. Configure the Engine
engine = Engine(
topic=topic,
models=(model_research, model_synthesis)
)
# 3. Execute the Autonomous Research & Indexing
engine.build()
Library integration module
Gemini:
from cortexrag.integration.google import GeminiModel
from google import genai
client = genai.Client(
api_key=API_KEY,
)
model = GeminiModel(client, 'gemini-3-flash-preview')
Claude:
from cortexrag.integration.anthropic import ClaudeModel
ChatGPT:
from cortexrag.integration.openai import OpenAIModel
Transformers:
from cortexrag.integration.transformers import TransformersModel
from cortexrag import Engine
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_NAME = 'model_name'
model = AutoModelForCausalLM.from_pretrained(MODEL_NAME)
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
model = TransformersModel(tokenizer, model)
engine = Engine(
topic='Cars',
models=(model, model),
lang='ru'
)
engine.build()
Custom Models:
from cortexrag.integration import BaseChatModel
class CastomModel(BaseChatModel):
...
def generate(self, message: str):
...
🏗 System Architecture
CortexRAG breaks down the complexity into clear, agentic phases:
- Research Phase: Parallel web searching using DuckDuckGo or Crawl4AI.
- Processing Phase: Noise removal and structured Markdown extraction.
- Indexing Phase: Generating vector embeddings and persistent storage.
- Synthesis Phase: Final knowledge distillation and response generation.
🛠 Development
To set up the environment for development:
- Clone the repository:
git clone https://github.com/Dlzxn/CortexRAG.git
- Sync dependencies:
uv sync
Built for the future of Autonomous Intelligence.
Project details
Release history Release notifications | RSS feed
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 cortexrag-0.1.2.tar.gz.
File metadata
- Download URL: cortexrag-0.1.2.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6534d248cf5ab179e9bcf49fde4d182318114c20682824094da0c6baed20472e
|
|
| MD5 |
87f4d523f13921fc3adde344c2881226
|
|
| BLAKE2b-256 |
4ac340eff350937aa106ce904acec7960ab0cbbdaf342490538a9f17f660a079
|
File details
Details for the file cortexrag-0.1.2-py3-none-any.whl.
File metadata
- Download URL: cortexrag-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8199fd2bfd53b149e17317114bb6fb5342d70da5db56ed0d8930afa2ee25c3ff
|
|
| MD5 |
fa14efab3518205f01bdec1d45771a41
|
|
| BLAKE2b-256 |
49c01736b8f4879975dfba6a6a562e00564e8b278f8d4594cdd202177c44471f
|