multi_modal_swarm_rag
Adaptive Swarm Retrieval: A Hierarchical Agent-Based Approach for Blind and Stateful Information Retrieval
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.1%) to scientific vocabulary
Repository
Adaptive Swarm Retrieval: A Hierarchical Agent-Based Approach for Blind and Stateful Information Retrieval
Basic Info
- Host: GitHub
- Owner: arash-shahmansoori
- License: mit
- Language: Python
- Default Branch: main
- Size: 31.3 MB
Statistics
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Adaptive Swarm Retrieval: A Hierarchical Agent-Based Approach for Blind and Stateful Information Retrieval

The implementation of: ``Adaptive Swarm Retrieval: A Hierarchical Agent-Based Approach for Blind and Stateful Information Retrieval''. https://medium.com/@arash.mansoori65/adaptive-swarm-retrieval-a-hierarchical-agent-based-approach-for-blind-and-stateful-information-3e46188fcf25
Description
Explore our groundbreaking approach to adaptive information retrieval in a dynamic, hierarchical swarm of specialized agents. Our GitHub repository presents a novel Retrieval Agent Graph (RAG) model, showcasing a supervisor agent that intelligently navigates through a network of retriever agents, each skilled in extracting specific types of data from various document parts, such as tables or textual content. This stateful, graph-based system excels in blind and adaptive information retrieval, dynamically selecting the optimal retriever for each user query without prior knowledge of which agent will yield the best results.
The core of our RAG system is a supervisory agent that acts as the initial query entry, delegating tasks to a suite of retriever agents. These retrievers attempt to gather pertinent information, reporting back their findings along with their success status. Should a retriever fall short, the supervisory agent seamlessly switches to another, iterating through the available agents in a structured process that ensures exhaustive exploration. This persistence guarantees that if information relatable to the query exists within the accessible data, our system will find it. If all options are exhausted without success, the system gracefully concedes with an informative response.
The accompanying diagram in our repository vividly illustrates this complex interaction:
mermaid
graph LR
SA[Supervisory Agent] -->|Dispatches Query| RA1[Retriever Agent 1]
SA -->|Dispatches Query| RA2[Retriever Agent 2]
SA -->|Dispatches Query| RAn[Retriever Agent n]
RA1 -->|Returns Report & Status| SA
RA2 -->|Returns Report & Status| SA
RAn -->|Returns Report & Status| SA
SA -->|Evaluates Status| Decision{Decision Making}
Decision -->|Satisfied| Output[Return Results to User]
Decision -->|Not Satisfied| Iteration[Iterate with Current or Switch Agent]
Iteration --> SA
Decision -->|All Agents Tried| Fail[Respond: Information Not Found]
Dive into our repository for a deep dive into this advanced, flexible, and capable RAG system that redefines the boundaries of adaptive and intelligent information retrieval.
Installation
Install all the necessary requirements.
sh
pip install -r requirements.txt
Environment Variables
Create a .env file and set your openai API key.
Data
Download
In this case, we use llama2.pdf document but you can replace the pdf file of your choice.
To get the llama2.pdf run the following.
sh
wget --user-agent "Mozilla" "https://arxiv.org/pdf/2307.09288.pdf" -O "llama2.pdf"
Interact with Document using the Proposed Method
To interact with the ingested document using the proposed method, run the following command.
sh
python main.py
Results
The output results of the analysis by the retrievers and interactions with the superviser node are saved in results.
Author
Arash Shahmansoori (arash.mansoori65@gmail.com)
License
This project is licensed under the terms of the MIT License
Owner
- Login: arash-shahmansoori
- Kind: user
- Location: Ireland
- Repositories: 1
- Profile: https://github.com/arash-shahmansoori
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Shahmansoori"
given-names: "Arash"
orcid: "https://orcid.org/0000-0000-0000-0000"
title: "Adaptive Swarm Retrieval: A Hierarchical Agent-Based Approach for Blind and Stateful Information Retrieval"
version: "1.0.0"
date-released: "2024-02-20"
doi: ""
url: "https://github.com/arash-shahmansoori/multi_modal_swarm_rag.git"
GitHub Events
Total
- Watch event: 1
- Fork event: 1
Last Year
- Watch event: 1
- Fork event: 1
Dependencies
- PyMuPDF ==1.23.21
- chromadb ==0.4.22
- easyocr ==1.7.1
- frontend ==0.0.3
- ipython ==8.21.0
- langchain ==0.1.5
- langchain-cli ==0.0.21
- langchain-community ==0.0.17
- langchain-core ==0.1.18
- langchain-experimental ==0.0.50
- langgraph ==0.0.23
- langserve ==0.0.41
- langsmith ==0.0.86
- llama-index ==0.9.42.post2
- matplotlib ==3.8.2
- openai ==1.11.0
- pyarrow ==15.0.0
- pypdf ==4.0.1
- python-dotenv ==1.0.1
- qdrant-client ==1.7.2
- rapidocr-onnxruntime ==1.2.3
- tools ==0.1.9
- transformers ==4.37.2