# ๐ค Agentic RAG
<div align="center">
<img src="assets/png/ai-prishtina.jpeg" alt="AI Prishtina Logo" width="200" height="auto">
</div>
[](https://www.python.org/downloads/)
[](https://www.gnu.org/licenses/agpl-3.0)
[](./htmlcov/index.html)
[](https://badge.fury.io/py/ai-prishtina-agentic-rag)
A **comprehensive, professional-grade agentic Retrieval-Augmented Generation (RAG) library** that combines the power of large language models with intelligent agents, advanced retrieval mechanisms, and tool integration for building sophisticated AI applications.
## โ Support This Project
If you find this project helpful, please consider supporting it:
[](https://coff.ee/albanmaxhuni)
## ๐ Key Features
### ๐ง **Agentic Intelligence**
- **Query Planning & Decomposition**: Intelligent multi-step query planning with reasoning
- **Working & Long-term Memory**: Persistent memory systems for context retention
- **Tool Integration**: Extensible tool ecosystem (web search, calculator, code execution)
- **Multi-step Reasoning**: Complex problem-solving with iterative refinement
### ๐ **Advanced Retrieval**
- **Multiple Vector Stores**: ChromaDB, Pinecone, Weaviate, FAISS support
- **Hybrid Retrieval**: Combines semantic and keyword-based search
- **Graph RAG**: Knowledge graph integration for enhanced context understanding
- **Smart Reranking**: Cross-encoder and ColBERT reranking capabilities
### ๐ **Document Processing**
- **Multi-format Support**: PDF, DOCX, TXT, Markdown, HTML, and more
- **Intelligent Chunking**: Fixed-size, semantic, and recursive chunking strategies
- **Metadata Extraction**: Automatic extraction of document metadata
- **Multi-modal Processing**: Image, audio, and video content support (optional)
### ๐ **LLM Integration**
- **Multiple Providers**: OpenAI, Anthropic, Cohere, and local models
- **Streaming Support**: Real-time response streaming
- **Prompt Management**: Advanced prompt templating and optimization
- **Response Generation**: Intelligent response synthesis and formatting
### ๐ **Evaluation & Monitoring**
- **Comprehensive Metrics**: Relevance, faithfulness, answer quality, and latency
- **Benchmarking Suite**: Performance evaluation and comparison tools
- **Real-time Monitoring**: System performance and quality tracking
### ๐ง **Developer Experience**
- **Plug-and-Play Architecture**: Modular components for easy customization
- **Type Safety**: Full type hints and Pydantic validation
- **Rich Configuration**: YAML, environment variables, and programmatic config
- **Extensive Examples**: Complete examples and tutorials
## ๐ Quick Start
### Installation
```bash
# Basic installation
pip install ai-prishtina-agentic-rag
# With all optional dependencies
pip install ai-prishtina-agentic-rag[all]
# Development installation
pip install ai-prishtina-agentic-rag[dev]
```
### Basic Usage
```python
from agentic_rag import AgenticRAG
from agentic_rag.utils.config import Config
# Initialize the system
config = Config()
rag = AgenticRAG(config=config, enable_agent=True)
# Add documents
documents = [
{"content": "Your document content here...", "metadata": {"source": "doc1.pdf"}},
# ... more documents
]
rag.add_documents(documents)
# Query with agentic capabilities
response = await rag.aquery(
"What are the key findings about climate change impacts?",
enable_planning=True,
use_tools=True
)
print(f"Answer: {response.answer}")
print(f"Sources: {response.sources}")
print(f"Reasoning: {response.reasoning_steps}")
```
## ๐ Documentation
### Core Components
#### ๐ค **AgenticRAG** - Main Interface
The central orchestrator that coordinates all components:
```python
from agentic_rag import AgenticRAG, Config
rag = AgenticRAG(
config=config,
enable_agent=True, # Enable agentic capabilities
enable_memory=True, # Enable memory systems
enable_tools=True, # Enable tool integration
enable_streaming=True # Enable response streaming
)
```
#### ๐ง **Memory Systems**
Persistent memory for context retention:
```python
from agentic_rag.core.memory import WorkingMemory, LongTermMemory
# Working memory for current session
working_memory = WorkingMemory(capacity=10)
# Long-term memory for persistent storage
long_term_memory = LongTermMemory(
storage_path="./memory",
embedding_model="sentence-transformers/all-MiniLM-L6-v2"
)
```
#### ๐ **Vector Stores**
Multiple vector database options:
```python
from agentic_rag.retrieval import (
ChromaVectorStore,
PineconeVectorStore,
WeaviateVectorStore,
FAISSVectorStore
)
# ChromaDB (great for development)
vector_store = ChromaVectorStore(collection_name="my_docs")
# Pinecone (production-ready)
vector_store = PineconeVectorStore(
api_key="your-key",
environment="us-west1-gcp",
index_name="my-index"
)
```
#### ๐ค **LLM Providers**
Support for multiple LLM providers:
```python
from agentic_rag.llm import OpenAIProvider, AnthropicProvider, LocalModelProvider
# OpenAI
llm = OpenAIProvider(
api_key="your-key",
model="gpt-4",
temperature=0.7
)
# Anthropic Claude
llm = AnthropicProvider(
api_key="your-key",
model="claude-3-sonnet-20240229"
)
# Local model
llm = LocalModelProvider(
model_path="./models/llama-2-7b",
device="cuda"
)
```
### Advanced Features
#### ๐ ๏ธ **Tool Integration**
Extend capabilities with tools:
```python
from agentic_rag.tools import WebSearchTool, CalculatorTool, CodeExecutorTool
# Register tools
rag.register_tool(WebSearchTool(api_key="your-search-api-key"))
rag.register_tool(CalculatorTool())
rag.register_tool(CodeExecutorTool(allowed_languages=["python", "javascript"]))
# Use tools in queries
response = await rag.aquery(
"Search for recent papers on transformer architectures and calculate the average citation count",
use_tools=True
)
```
#### ๐ **Graph RAG**
Knowledge graph integration:
```python
from agentic_rag.graph import KnowledgeGraph
# Enable graph RAG
graph = KnowledgeGraph()
rag = AgenticRAG(config=config, knowledge_graph=graph)
# Automatic entity extraction and relationship building
rag.add_documents(documents, extract_entities=True)
```
#### ๐ **Streaming Responses**
Real-time response streaming:
```python
async for chunk in rag.astream("Tell me about quantum computing"):
print(chunk.content, end="", flush=True)
```
## ๐๏ธ Architecture
The library follows a modular, plug-and-play architecture:
```
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ AgenticRAG โโโโโโ QueryPlanner โโโโโโ Memory โ
โ (Orchestrator)โ โ (Intelligence) โ โ (Context) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Retrieval โ โ LLM Providers โ โ Tools โ
โ (Vector/Graph)โ โ (OpenAI/etc) โ โ (Web/Calc) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Document โ โ Evaluation โ โ Configuration โ
โ Processing โ โ & Monitoring โ โ & Logging โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
```
## ๐ Performance & Evaluation
### Metrics & Benchmarking
```python
from agentic_rag.evaluation import ComprehensiveEvaluator, RAGBenchmark
# Comprehensive evaluation
evaluator = ComprehensiveEvaluator()
results = await evaluator.evaluate(
rag_system=rag,
test_queries=test_queries,
ground_truth=ground_truth
)
print(f"Relevance Score: {results.relevance_score:.3f}")
print(f"Faithfulness Score: {results.faithfulness_score:.3f}")
print(f"Answer Quality: {results.answer_quality:.3f}")
print(f"Average Latency: {results.avg_latency:.2f}s")
# Benchmark against standard datasets
benchmark = RAGBenchmark()
benchmark_results = await benchmark.run(rag_system=rag)
```
### Current Test Coverage
- **Overall Coverage**: 55% (actively improving)
- **Core Components**: Well tested (84-91% coverage)
- **Integration Tests**: Comprehensive test suite (183 tests)
- **Test Results**: 167 passed, 7 failed, 9 errors (91% pass rate)
- **Performance Tests**: Latency and throughput benchmarks
## ๐ง Configuration
### Environment Variables
```bash
# LLM Configuration
OPENAI_API_KEY=your_openai_key
ANTHROPIC_API_KEY=your_anthropic_key
COHERE_API_KEY=your_cohere_key
# Vector Store Configuration
PINECONE_API_KEY=your_pinecone_key
PINECONE_ENVIRONMENT=us-west1-gcp
WEAVIATE_URL=http://localhost:8080
# Tool Configuration
SERP_API_KEY=your_search_api_key
```
### YAML Configuration
```yaml
# config.yaml
llm:
provider: "openai"
model: "gpt-4"
temperature: 0.7
max_tokens: 2000
vector_store:
provider: "chroma"
collection_name: "documents"
retrieval:
top_k: 5
rerank: true
reranker_model: "cross-encoder/ms-marco-MiniLM-L-6-v2"
agent:
enable_planning: true
enable_memory: true
enable_tools: true
max_iterations: 5
tools:
- name: "web_search"
enabled: true
- name: "calculator"
enabled: true
```
## ๐ Examples
### Basic RAG System
```python
# examples/basic_example.py
from agentic_rag import AgenticRAG
from agentic_rag.document_processing import DocumentLoader
# Load documents
loader = DocumentLoader()
documents = loader.load_directory("./documents")
# Initialize RAG
rag = AgenticRAG()
rag.add_documents([doc.dict() for doc in documents])
# Query
response = await rag.aquery("What is the main topic of these documents?")
print(response.answer)
```
### Advanced Agentic RAG
```python
# examples/advanced_rag.py
from agentic_rag import AgenticRAG
from agentic_rag.tools import WebSearchTool, CalculatorTool
from agentic_rag.core.memory import LongTermMemory
# Setup with advanced features
rag = AgenticRAG(
enable_agent=True,
enable_memory=True,
memory_system=LongTermMemory(storage_path="./memory")
)
# Register tools
rag.register_tool(WebSearchTool(api_key="your-key"))
rag.register_tool(CalculatorTool())
# Complex multi-step query
response = await rag.aquery(
"Research the latest developments in quantum computing, "
"find the top 3 companies by investment, and calculate "
"the total funding amount",
enable_planning=True,
use_tools=True
)
```
### Plug-and-Play Components
```python
# examples/plug_and_play_demo.py
from agentic_rag import AgenticRAG
from agentic_rag.retrieval import PineconeVectorStore
from agentic_rag.llm import AnthropicProvider
# Custom component configuration
vector_store = PineconeVectorStore(
api_key="your-key",
environment="us-west1-gcp"
)
llm_provider = AnthropicProvider(
api_key="your-key",
model="claude-3-sonnet-20240229"
)
# Plug components together
rag = AgenticRAG(
vector_store=vector_store,
llm_provider=llm_provider,
enable_agent=True
)
```
## ๐งช Testing
Run the comprehensive test suite:
```bash
# Run all tests
pytest
# Run with coverage
pytest --cov=agentic_rag --cov-report=html
# Run specific test categories
pytest tests/test_vector_stores.py
pytest tests/test_llm_providers.py
pytest tests/test_complete_features.py
# Run performance benchmarks
pytest tests/test_evaluation.py -v
```
## ๐ค Contributing
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
### Development Setup
```bash
# Clone the repository
git clone https://github.com/your-org/ai-prishtina-agentic-rag.git
cd ai-prishtina-agentic-rag
# Install in development mode
pip install -e .[dev]
# Install pre-commit hooks
pre-commit install
# Run tests
pytest
```
### Code Quality
We maintain high code quality standards:
- **Type Safety**: Full type hints with mypy validation
- **Code Formatting**: Black and isort for consistent formatting
- **Linting**: Flake8 for code quality checks
- **Testing**: Comprehensive test suite with pytest
- **Documentation**: Detailed docstrings and examples
## ๐ License
This project is dual-licensed under:
- **GNU Affero General Public License v3 or later (AGPLv3+)** - for open source projects
- **Commercial License** - for proprietary/commercial use
### Open Source License (AGPLv3+)
This software is free for use in open source projects under the GNU Affero General Public License v3 or later. This means:
- โ
**Free to use** for open source projects
- โ
**Modify and distribute** with source code
- โ
**Network use** requires source disclosure
- โ ๏ธ **Copyleft**: Derivative works must also be AGPLv3+
### Commercial License
For commercial use, proprietary applications, or if you prefer not to comply with AGPLv3+ requirements:
- ๐ผ **Commercial licensing available** for proprietary use
- ๐ **No copyleft obligations** for your application
- ๐ **Priority support** and maintenance included
- ๐ **Contact**: info@albanmaxhuni.com
See the [LICENSE](LICENSE) file for complete details.
## ๐ Acknowledgments
- Built with โค๏ธ by the AI Prishtina team
- Inspired by the latest research in RAG and agentic AI systems
- Thanks to the open-source community for the foundational libraries
## ๐ Support & Contact
- **Documentation**: [https://ai-prishtina-agentic-rag.readthedocs.io](https://ai-prishtina-agentic-rag.readthedocs.io)
- **Issues**: [GitHub Issues](https://github.com/albanmaxhuni/ai-prishtina-agentic-rag/issues)
- **Discussions**: [GitHub Discussions](https://github.com/albanmaxhuni/ai-prishtina-agentic-rag/discussions)
- **Email**: info@albanmaxhuni.com
---
**Made with ๐ค by AI Prishtina** | **Empowering the future of intelligent information retrieval**
Raw data
{
"_id": null,
"home_page": "https://github.com/your-org/ai-prishtina-agentic-rag",
"name": "ai-prishtina-agentic-rag",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Alban Maxhuni, PhD",
"author_email": "\"Alban Maxhuni, PhD\" <info@albanmaxhuni.com>",
"download_url": "https://files.pythonhosted.org/packages/5f/24/d2adeea53f405d8146e75f0ab6967fa1c513c3b7f9d27c133d2071f76115/ai_prishtina_agentic_rag-0.1.2.tar.gz",
"platform": null,
"description": "# \ud83e\udd16 Agentic RAG\n\n<div align=\"center\">\n <img src=\"assets/png/ai-prishtina.jpeg\" alt=\"AI Prishtina Logo\" width=\"200\" height=\"auto\">\n</div>\n\n\n[](https://www.python.org/downloads/)\n[](https://www.gnu.org/licenses/agpl-3.0)\n[](./htmlcov/index.html)\n[](https://badge.fury.io/py/ai-prishtina-agentic-rag)\n\nA **comprehensive, professional-grade agentic Retrieval-Augmented Generation (RAG) library** that combines the power of large language models with intelligent agents, advanced retrieval mechanisms, and tool integration for building sophisticated AI applications.\n\n## \u2615 Support This Project\n\nIf you find this project helpful, please consider supporting it:\n\n[](https://coff.ee/albanmaxhuni)\n\n## \ud83c\udf1f Key Features\n\n### \ud83e\udde0 **Agentic Intelligence**\n- **Query Planning & Decomposition**: Intelligent multi-step query planning with reasoning\n- **Working & Long-term Memory**: Persistent memory systems for context retention\n- **Tool Integration**: Extensible tool ecosystem (web search, calculator, code execution)\n- **Multi-step Reasoning**: Complex problem-solving with iterative refinement\n\n### \ud83d\udd0d **Advanced Retrieval**\n- **Multiple Vector Stores**: ChromaDB, Pinecone, Weaviate, FAISS support\n- **Hybrid Retrieval**: Combines semantic and keyword-based search\n- **Graph RAG**: Knowledge graph integration for enhanced context understanding\n- **Smart Reranking**: Cross-encoder and ColBERT reranking capabilities\n\n### \ud83d\udcda **Document Processing**\n- **Multi-format Support**: PDF, DOCX, TXT, Markdown, HTML, and more\n- **Intelligent Chunking**: Fixed-size, semantic, and recursive chunking strategies\n- **Metadata Extraction**: Automatic extraction of document metadata\n- **Multi-modal Processing**: Image, audio, and video content support (optional)\n\n### \ud83d\ude80 **LLM Integration**\n- **Multiple Providers**: OpenAI, Anthropic, Cohere, and local models\n- **Streaming Support**: Real-time response streaming\n- **Prompt Management**: Advanced prompt templating and optimization\n- **Response Generation**: Intelligent response synthesis and formatting\n\n### \ud83d\udcca **Evaluation & Monitoring**\n- **Comprehensive Metrics**: Relevance, faithfulness, answer quality, and latency\n- **Benchmarking Suite**: Performance evaluation and comparison tools\n- **Real-time Monitoring**: System performance and quality tracking\n\n### \ud83d\udd27 **Developer Experience**\n- **Plug-and-Play Architecture**: Modular components for easy customization\n- **Type Safety**: Full type hints and Pydantic validation\n- **Rich Configuration**: YAML, environment variables, and programmatic config\n- **Extensive Examples**: Complete examples and tutorials\n\n## \ud83d\ude80 Quick Start\n\n### Installation\n\n```bash\n# Basic installation\npip install ai-prishtina-agentic-rag\n\n# With all optional dependencies\npip install ai-prishtina-agentic-rag[all]\n\n# Development installation\npip install ai-prishtina-agentic-rag[dev]\n```\n\n### Basic Usage\n\n```python\nfrom agentic_rag import AgenticRAG\nfrom agentic_rag.utils.config import Config\n\n# Initialize the system\nconfig = Config()\nrag = AgenticRAG(config=config, enable_agent=True)\n\n# Add documents\ndocuments = [\n {\"content\": \"Your document content here...\", \"metadata\": {\"source\": \"doc1.pdf\"}},\n # ... more documents\n]\nrag.add_documents(documents)\n\n# Query with agentic capabilities\nresponse = await rag.aquery(\n \"What are the key findings about climate change impacts?\",\n enable_planning=True,\n use_tools=True\n)\n\nprint(f\"Answer: {response.answer}\")\nprint(f\"Sources: {response.sources}\")\nprint(f\"Reasoning: {response.reasoning_steps}\")\n```\n\n## \ud83d\udcd6 Documentation\n\n### Core Components\n\n#### \ud83e\udd16 **AgenticRAG** - Main Interface\nThe central orchestrator that coordinates all components:\n\n```python\nfrom agentic_rag import AgenticRAG, Config\n\nrag = AgenticRAG(\n config=config,\n enable_agent=True, # Enable agentic capabilities\n enable_memory=True, # Enable memory systems\n enable_tools=True, # Enable tool integration\n enable_streaming=True # Enable response streaming\n)\n```\n\n#### \ud83e\udde0 **Memory Systems**\nPersistent memory for context retention:\n\n```python\nfrom agentic_rag.core.memory import WorkingMemory, LongTermMemory\n\n# Working memory for current session\nworking_memory = WorkingMemory(capacity=10)\n\n# Long-term memory for persistent storage\nlong_term_memory = LongTermMemory(\n storage_path=\"./memory\",\n embedding_model=\"sentence-transformers/all-MiniLM-L6-v2\"\n)\n```\n\n#### \ud83d\udd0d **Vector Stores**\nMultiple vector database options:\n\n```python\nfrom agentic_rag.retrieval import (\n ChromaVectorStore,\n PineconeVectorStore,\n WeaviateVectorStore,\n FAISSVectorStore\n)\n\n# ChromaDB (great for development)\nvector_store = ChromaVectorStore(collection_name=\"my_docs\")\n\n# Pinecone (production-ready)\nvector_store = PineconeVectorStore(\n api_key=\"your-key\",\n environment=\"us-west1-gcp\",\n index_name=\"my-index\"\n)\n```\n\n#### \ud83e\udd16 **LLM Providers**\nSupport for multiple LLM providers:\n\n```python\nfrom agentic_rag.llm import OpenAIProvider, AnthropicProvider, LocalModelProvider\n\n# OpenAI\nllm = OpenAIProvider(\n api_key=\"your-key\",\n model=\"gpt-4\",\n temperature=0.7\n)\n\n# Anthropic Claude\nllm = AnthropicProvider(\n api_key=\"your-key\",\n model=\"claude-3-sonnet-20240229\"\n)\n\n# Local model\nllm = LocalModelProvider(\n model_path=\"./models/llama-2-7b\",\n device=\"cuda\"\n)\n```\n\n### Advanced Features\n\n#### \ud83d\udee0\ufe0f **Tool Integration**\nExtend capabilities with tools:\n\n```python\nfrom agentic_rag.tools import WebSearchTool, CalculatorTool, CodeExecutorTool\n\n# Register tools\nrag.register_tool(WebSearchTool(api_key=\"your-search-api-key\"))\nrag.register_tool(CalculatorTool())\nrag.register_tool(CodeExecutorTool(allowed_languages=[\"python\", \"javascript\"]))\n\n# Use tools in queries\nresponse = await rag.aquery(\n \"Search for recent papers on transformer architectures and calculate the average citation count\",\n use_tools=True\n)\n```\n\n#### \ud83d\udcca **Graph RAG**\nKnowledge graph integration:\n\n```python\nfrom agentic_rag.graph import KnowledgeGraph\n\n# Enable graph RAG\ngraph = KnowledgeGraph()\nrag = AgenticRAG(config=config, knowledge_graph=graph)\n\n# Automatic entity extraction and relationship building\nrag.add_documents(documents, extract_entities=True)\n```\n\n#### \ud83d\udd04 **Streaming Responses**\nReal-time response streaming:\n\n```python\nasync for chunk in rag.astream(\"Tell me about quantum computing\"):\n print(chunk.content, end=\"\", flush=True)\n```\n\n## \ud83c\udfd7\ufe0f Architecture\n\nThe library follows a modular, plug-and-play architecture:\n\n```\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 AgenticRAG \u2502\u2500\u2500\u2500\u2500\u2502 QueryPlanner \u2502\u2500\u2500\u2500\u2500\u2502 Memory \u2502\n\u2502 (Orchestrator)\u2502 \u2502 (Intelligence) \u2502 \u2502 (Context) \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502 \u2502 \u2502\n \u25bc \u25bc \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Retrieval \u2502 \u2502 LLM Providers \u2502 \u2502 Tools \u2502\n\u2502 (Vector/Graph)\u2502 \u2502 (OpenAI/etc) \u2502 \u2502 (Web/Calc) \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n \u2502 \u2502 \u2502\n \u25bc \u25bc \u25bc\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Document \u2502 \u2502 Evaluation \u2502 \u2502 Configuration \u2502\n\u2502 Processing \u2502 \u2502 & Monitoring \u2502 \u2502 & Logging \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n## \ud83d\udcca Performance & Evaluation\n\n### Metrics & Benchmarking\n\n```python\nfrom agentic_rag.evaluation import ComprehensiveEvaluator, RAGBenchmark\n\n# Comprehensive evaluation\nevaluator = ComprehensiveEvaluator()\nresults = await evaluator.evaluate(\n rag_system=rag,\n test_queries=test_queries,\n ground_truth=ground_truth\n)\n\nprint(f\"Relevance Score: {results.relevance_score:.3f}\")\nprint(f\"Faithfulness Score: {results.faithfulness_score:.3f}\")\nprint(f\"Answer Quality: {results.answer_quality:.3f}\")\nprint(f\"Average Latency: {results.avg_latency:.2f}s\")\n\n# Benchmark against standard datasets\nbenchmark = RAGBenchmark()\nbenchmark_results = await benchmark.run(rag_system=rag)\n```\n\n### Current Test Coverage\n- **Overall Coverage**: 55% (actively improving)\n- **Core Components**: Well tested (84-91% coverage)\n- **Integration Tests**: Comprehensive test suite (183 tests)\n- **Test Results**: 167 passed, 7 failed, 9 errors (91% pass rate)\n- **Performance Tests**: Latency and throughput benchmarks\n\n## \ud83d\udd27 Configuration\n\n### Environment Variables\n\n```bash\n# LLM Configuration\nOPENAI_API_KEY=your_openai_key\nANTHROPIC_API_KEY=your_anthropic_key\nCOHERE_API_KEY=your_cohere_key\n\n# Vector Store Configuration\nPINECONE_API_KEY=your_pinecone_key\nPINECONE_ENVIRONMENT=us-west1-gcp\nWEAVIATE_URL=http://localhost:8080\n\n# Tool Configuration\nSERP_API_KEY=your_search_api_key\n```\n\n### YAML Configuration\n\n```yaml\n# config.yaml\nllm:\n provider: \"openai\"\n model: \"gpt-4\"\n temperature: 0.7\n max_tokens: 2000\n\nvector_store:\n provider: \"chroma\"\n collection_name: \"documents\"\n\nretrieval:\n top_k: 5\n rerank: true\n reranker_model: \"cross-encoder/ms-marco-MiniLM-L-6-v2\"\n\nagent:\n enable_planning: true\n enable_memory: true\n enable_tools: true\n max_iterations: 5\n\ntools:\n - name: \"web_search\"\n enabled: true\n - name: \"calculator\"\n enabled: true\n```\n\n## \ud83d\udcda Examples\n\n### Basic RAG System\n\n```python\n# examples/basic_example.py\nfrom agentic_rag import AgenticRAG\nfrom agentic_rag.document_processing import DocumentLoader\n\n# Load documents\nloader = DocumentLoader()\ndocuments = loader.load_directory(\"./documents\")\n\n# Initialize RAG\nrag = AgenticRAG()\nrag.add_documents([doc.dict() for doc in documents])\n\n# Query\nresponse = await rag.aquery(\"What is the main topic of these documents?\")\nprint(response.answer)\n```\n\n### Advanced Agentic RAG\n\n```python\n# examples/advanced_rag.py\nfrom agentic_rag import AgenticRAG\nfrom agentic_rag.tools import WebSearchTool, CalculatorTool\nfrom agentic_rag.core.memory import LongTermMemory\n\n# Setup with advanced features\nrag = AgenticRAG(\n enable_agent=True,\n enable_memory=True,\n memory_system=LongTermMemory(storage_path=\"./memory\")\n)\n\n# Register tools\nrag.register_tool(WebSearchTool(api_key=\"your-key\"))\nrag.register_tool(CalculatorTool())\n\n# Complex multi-step query\nresponse = await rag.aquery(\n \"Research the latest developments in quantum computing, \"\n \"find the top 3 companies by investment, and calculate \"\n \"the total funding amount\",\n enable_planning=True,\n use_tools=True\n)\n```\n\n### Plug-and-Play Components\n\n```python\n# examples/plug_and_play_demo.py\nfrom agentic_rag import AgenticRAG\nfrom agentic_rag.retrieval import PineconeVectorStore\nfrom agentic_rag.llm import AnthropicProvider\n\n# Custom component configuration\nvector_store = PineconeVectorStore(\n api_key=\"your-key\",\n environment=\"us-west1-gcp\"\n)\n\nllm_provider = AnthropicProvider(\n api_key=\"your-key\",\n model=\"claude-3-sonnet-20240229\"\n)\n\n# Plug components together\nrag = AgenticRAG(\n vector_store=vector_store,\n llm_provider=llm_provider,\n enable_agent=True\n)\n```\n\n## \ud83e\uddea Testing\n\nRun the comprehensive test suite:\n\n```bash\n# Run all tests\npytest\n\n# Run with coverage\npytest --cov=agentic_rag --cov-report=html\n\n# Run specific test categories\npytest tests/test_vector_stores.py\npytest tests/test_llm_providers.py\npytest tests/test_complete_features.py\n\n# Run performance benchmarks\npytest tests/test_evaluation.py -v\n```\n\n## \ud83e\udd1d Contributing\n\nWe welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.\n\n### Development Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/your-org/ai-prishtina-agentic-rag.git\ncd ai-prishtina-agentic-rag\n\n# Install in development mode\npip install -e .[dev]\n\n# Install pre-commit hooks\npre-commit install\n\n# Run tests\npytest\n```\n\n### Code Quality\n\nWe maintain high code quality standards:\n\n- **Type Safety**: Full type hints with mypy validation\n- **Code Formatting**: Black and isort for consistent formatting\n- **Linting**: Flake8 for code quality checks\n- **Testing**: Comprehensive test suite with pytest\n- **Documentation**: Detailed docstrings and examples\n\n## \ud83d\udcc4 License\n\nThis project is dual-licensed under:\n\n- **GNU Affero General Public License v3 or later (AGPLv3+)** - for open source projects\n- **Commercial License** - for proprietary/commercial use\n\n### Open Source License (AGPLv3+)\n\nThis software is free for use in open source projects under the GNU Affero General Public License v3 or later. This means:\n\n- \u2705 **Free to use** for open source projects\n- \u2705 **Modify and distribute** with source code\n- \u2705 **Network use** requires source disclosure\n- \u26a0\ufe0f **Copyleft**: Derivative works must also be AGPLv3+\n\n### Commercial License\n\nFor commercial use, proprietary applications, or if you prefer not to comply with AGPLv3+ requirements:\n\n- \ud83d\udcbc **Commercial licensing available** for proprietary use\n- \ud83d\ude80 **No copyleft obligations** for your application\n- \ud83d\udedf **Priority support** and maintenance included\n- \ud83d\udcde **Contact**: info@albanmaxhuni.com\n\nSee the [LICENSE](LICENSE) file for complete details.\n\n## \ud83d\ude4f Acknowledgments\n\n- Built with \u2764\ufe0f by the AI Prishtina team\n- Inspired by the latest research in RAG and agentic AI systems\n- Thanks to the open-source community for the foundational libraries\n\n## \ud83d\udcde Support & Contact\n\n- **Documentation**: [https://ai-prishtina-agentic-rag.readthedocs.io](https://ai-prishtina-agentic-rag.readthedocs.io)\n- **Issues**: [GitHub Issues](https://github.com/albanmaxhuni/ai-prishtina-agentic-rag/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/albanmaxhuni/ai-prishtina-agentic-rag/discussions)\n- **Email**: info@albanmaxhuni.com\n\n---\n\n**Made with \ud83e\udd16 by AI Prishtina** | **Empowering the future of intelligent information retrieval**\n",
"bugtrack_url": null,
"license": "AGPL-3.0-or-later OR Commercial",
"summary": "A comprehensive, professional-grade agentic Retrieval-Augmented Generation (RAG) library",
"version": "0.1.2",
"project_urls": {
"Documentation": "https://ai-prishtina-agentic-rag.readthedocs.io",
"Homepage": "https://github.com/your-org/ai-prishtina-agentic-rag",
"Issues": "https://github.com/your-org/ai-prishtina-agentic-rag/issues",
"Repository": "https://github.com/your-org/ai-prishtina-agentic-rag"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "3b20d8afe9e821716ae25d21d5bea8f2187e581f24ef1be7000eee77e8b78aa9",
"md5": "1168421e6dab0f465d485a11fff8ee17",
"sha256": "c565cc5b5e8ddb4b0a5e9a73a69ca877e776b3e6f5451a3a3a01dd6cddcf38bf"
},
"downloads": -1,
"filename": "ai_prishtina_agentic_rag-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1168421e6dab0f465d485a11fff8ee17",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 77814,
"upload_time": "2025-07-20T18:03:46",
"upload_time_iso_8601": "2025-07-20T18:03:46.933943Z",
"url": "https://files.pythonhosted.org/packages/3b/20/d8afe9e821716ae25d21d5bea8f2187e581f24ef1be7000eee77e8b78aa9/ai_prishtina_agentic_rag-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "5f24d2adeea53f405d8146e75f0ab6967fa1c513c3b7f9d27c133d2071f76115",
"md5": "8591073ac1b6e7a9cd870a9e04a7c510",
"sha256": "f4f0942be70a723800244055f1f4f4dba55cec64a40d7d31d70849d3f1aa996b"
},
"downloads": -1,
"filename": "ai_prishtina_agentic_rag-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "8591073ac1b6e7a9cd870a9e04a7c510",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 91141,
"upload_time": "2025-07-20T18:03:48",
"upload_time_iso_8601": "2025-07-20T18:03:48.888892Z",
"url": "https://files.pythonhosted.org/packages/5f/24/d2adeea53f405d8146e75f0ab6967fa1c513c3b7f9d27c133d2071f76115/ai_prishtina_agentic_rag-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-20 18:03:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "your-org",
"github_project": "ai-prishtina-agentic-rag",
"github_not_found": true,
"lcname": "ai-prishtina-agentic-rag"
}