Beyond Static RAG. Meet HyDRA.
An advanced, agentic AI framework that transforms Retrieval-Augmented Generation into a dynamic, learning reasoning system.
Why HyDRA?
HyDRA fuses the best ideas from groundbreaking research into a single, cohesive, and practical framework. It's an answer to building a RAG system that is not just powerful, but intelligent and adaptive.
Hierarchical Structure
Adopts the robust, three-layer agentic structure from HiRA for a clean separation of strategy and execution.
Multi-Source Retrieval
Implements the multi-agent, multi-source philosophy of HM-RAG for comprehensive data gathering.
Semantic Bridge
Leverages the HyDE technique to bridge the gap between user queries and stored documents.
Unified Backend
Powered by Milvus and BGE-M3 for state-of-the-art hybrid search and agent memory.
The HyDRA Approach
HyDRA's intelligence is built on three foundational pillars that work in concert.
1. Hierarchical Agents
A clear separation of concerns: The Meta-Planner strategizes, the Coordinator manages, and Executors perform specialized tasks.
2. Iterative Reasoning (ReAct)
A dynamic Reason-Act-Observe loop allows HyDRA to tackle multi-hop questions, recover from failures, and adjust its strategy on the fly.
3. Autonomous Learning (HELP)
A long-term memory and self-improvement cycle: Observe, Critique, Memorize, and Adapt, making the system smarter with every interaction.
Core Features
Three-Layer Agentic Architecture
Planner for strategy, Coordinator for delegation, and Executors for tasks.
Iterative ReAct-style Agents
Moves beyond static plans to dynamic, multi-step reasoning.
Continuous Self-Improvement
A learning loop that analyzes past performance to optimize future actions.
State-of-the-Art Retrieval
Combines Hybrid Search (dense + sparse), RRF, and a BGE Reranker.
Adaptive Retrieval Strategies
Autonomously uses techniques like HyDE for conceptual queries.
Interactive TUI
A rich Terminal UI with streaming, commands, and knowledge management.
Architecture Flow
A dynamic loop of strategy, execution, and learning creates a continuous cycle of improvement.
1. Strategy & Planning
The loop begins when a user query is received. The Meta-Planner Agent analyzes the goal and devises the single most logical next step, creating an actionable sub-task.
2. Coordination & Execution
The Adaptive Coordinator receives the sub-task. Guided by learned policies from the Memory Agent, it delegates the task to the best specialized Executor (e.g., Vector Search or Web Search).
3. Synthesis & Learning
The result is passed to the Synthesis Agent and fed back to the Planner. After the interaction, the Post-Interaction Analyzer critiques the process, updating the Memory Agent with new insights, making the system smarter for the next query.
See HyDRA in Action
This video showcases the iterative reasoning process, the dynamic TUI, and the agent's ability to learn and adapt.
Installation & Setup
Get HyDRA up and running in a few simple steps.
1Install Milvus Standalone
curl -sfL https://raw.githubusercontent.com/milvus-io/milvus/master/scripts/standalone_embed.sh -o standalone_embed.sh
bash standalone_embed.sh start2Clone & Install Dependencies
git clone https://github.com/hassenhamdi/HyDRA.git
cd HyDRA
pip install -r requirements.txt3Configure Environment
cp .env.example .env
# Edit .env and add your GEMINI_API_KEY4Ingest Your Data
# Setup Milvus collections
python -m src.services.milvus_setup --profile development
# Ingest data
python -m data_processing.ingest --path ./data --profile development5Launch the TUI
python main.py --profile production_balanced --user_id alex