{"id":16271702,"url":"https://github.com/mohannadcse/depsrag","last_synced_at":"2026-04-06T05:32:13.139Z","repository":{"id":226058691,"uuid":"767602654","full_name":"Mohannadcse/DepsRAG","owner":"Mohannadcse","description":"Interactive LLM Chatbot that constructs direct and transitive software dependencies as a knowledge graph and answers user's questions leveraging RAG and critic-agent approach","archived":false,"fork":false,"pushed_at":"2026-03-04T19:49:23.000Z","size":90285,"stargazers_count":31,"open_issues_count":11,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-05T01:44:11.878Z","etag":null,"topics":["agentic-rag","chat","dependency-chain","dependency-graph","llm","multi-agent-llms","rag","software-dependencies"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mohannadcse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-03-05T15:36:18.000Z","updated_at":"2026-01-11T10:44:40.000Z","dependencies_parsed_at":"2025-01-12T21:36:00.309Z","dependency_job_id":null,"html_url":"https://github.com/Mohannadcse/DepsRAG","commit_stats":null,"previous_names":["mohannadcse/dependencyrag","mohannadcse/depsrag"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Mohannadcse/DepsRAG","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohannadcse%2FDepsRAG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohannadcse%2FDepsRAG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohannadcse%2FDepsRAG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohannadcse%2FDepsRAG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mohannadcse","download_url":"https://codeload.github.com/Mohannadcse/DepsRAG/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohannadcse%2FDepsRAG/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31461527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-rag","chat","dependency-chain","dependency-graph","llm","multi-agent-llms","rag","software-dependencies"],"created_at":"2024-10-10T18:14:29.925Z","updated_at":"2026-04-06T05:32:13.129Z","avatar_url":"https://github.com/Mohannadcse.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DepsRAG (Agno Version)\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/DepsRAG.png\" alt=\"Logo\" width=\"450\" align=\"center\"\u003e\n\u003c/div\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n## 🚀 What's New in the Agno Version?\n\nThis is a complete migration of DepsRAG from **Langroid** to **Agno**, bringing:\n\n- ✨ **Modern multi-agent framework** with Agno's powerful orchestration\n- 🔧 **Simplified tool system** using Agno's native tool decorators\n- 📊 **Better conversation management** with persistent SQLite storage\n- 🎯 **Improved agent coordination** using Agno's Team system\n- 🌐 **Multi-provider LLM support** - OpenAI, Azure OpenAI, and Google Gemini\n- 🔄 **Maintained functionality** - all original features preserved\n\n## Overview\n\n`DepsRAG` is an AI-powered chatbot that answers questions about software dependencies by representing them as a Knowledge Graph (KG) using Neo4j. It uses a multi-agent system powered by Agno to provide comprehensive, validated answers.\n\n### Key Features\n\n- 🗂️ **Dependency Graph Construction**: Build complete dependency trees (direct \u0026 transitive) as Neo4j knowledge graphs\n- 🌐 **Multi-Ecosystem Support**: PyPI, NPM, Cargo, and Go packages\n- 🤖 **Multi-Agent System**: Specialized agents for different tasks\n- 🔍 **Automatic Query Generation**: Natural language to Cypher query translation\n- 🔒 **Security Analysis**: Integration with OSV vulnerability database\n- 🌍 **Web Search Integration**: DuckDuckGo search for additional information\n- ✅ **Answer Validation**: Critic agent for quality assurance\n\n## Architecture\n\nDepsRAG uses a **multi-agent system** with the following specialized agents:\n\n### 1. **AssistantAgent** (Team Leader)\n- Orchestrates the entire workflow\n- Breaks down complex questions into simpler steps\n- Aggregates responses from other agents\n- Coordinates with other specialized agents\n\n### 2. **DependencyGraphAgent**\n- Builds dependency graphs using the deps.dev API\n- Translates natural language to Cypher queries\n- Executes queries on the Neo4j knowledge graph\n- Provides graph visualization capabilities\n\n**Tools:**\n- `construct_dependency_graph`: Build the KG for a package\n- `execute_cypher_query`: Query the Neo4j database\n- `get_graph_schema`: Get database structure info\n- `visualize_dependency_graph`: Create HTML visualizations\n\n### 3. **SearchAgent**\n- Performs web searches using DuckDuckGo\n- Checks security vulnerabilities using OSV database\n- Provides package information and documentation links\n\n**Tools:**\n- `web_search`: Search the web for information\n- `check_vulnerability`: Query OSV vulnerability database\n\n### 4. **CriticAgent**\n- Validates responses from the AssistantAgent\n- Provides feedback on reasoning and completeness\n- Ensures high-quality, accurate answers\n\n## Workflow\n\n```\n1. User provides package info (name, version, ecosystem)\n   ↓\n2. AssistantAgent → DependencyGraphAgent: Build dependency graph\n   ↓\n3. User asks questions about dependencies\n   ↓\n4. AssistantAgent breaks down complex questions\n   ↓\n5. AssistantAgent coordinates:\n   - DependencyGraphAgent: Graph queries\n   - SearchAgent: Web search / vulnerability checks\n   ↓\n6. AssistantAgent aggregates answers\n   ↓\n7. CriticAgent validates and provides feedback\n   ↓\n8. Final answer returned to user\n```\n\n## Installation\n\n### Requirements\n\n- **Python**: 3.11 or higher\n- **Neo4j**: Cloud account or local instance\n- **LLM Provider** (choose one):\n  - **OpenAI** API Key\n  - **Azure OpenAI** credentials\n  - **Google Gemini** API Key\n\n### Supported Models\n\n**OpenAI:**\n- `gpt-4o`, `gpt-4o-mini`\n- `gpt-4-turbo`, `gpt-4`\n- `gpt-3.5-turbo`\n\n**Azure OpenAI:**\n- Same models as OpenAI, deployed on Azure\n- Requires Azure OpenAI deployment name\n\n**Google Gemini:**\n- `gemini-2.5-flash`, `gemini-2.5-pro`\n- `gemini-2.0-flash`, `gemini-2.0-flash-001`\n- `gemini-flash-latest`\n\n### Setup\n\n1. **Clone the repository:**\n```bash\ngit clone https://github.com/Mohannadcse/DepsRAG.git\ncd DepsRAG\n```\n\n2. **Install dependencies:**\n```bash\n# Using poetry (recommended)\npoetry install\n\n# Or using pip\npip install -e .\n```\n\n3. **Set up Neo4j:**\n   - Create a free account at [neo4j.com](https://neo4j.com/cloud/platform/aura-graph-database/)\n   - Note your URI, username, and password\n\n4. **Configure environment variables:**\n```bash\ncp .env-template .env\n# Edit .env with your credentials\n```\n\nRequired environment variables:\n```bash\n# Option 1: OpenAI\nOPENAI_API_KEY=your_openai_api_key\n\n# Option 2: Azure OpenAI\nAZURE_OPENAI_API_KEY=your_azure_key\nAZURE_OPENAI_ENDPOINT=https://your-endpoint.openai.azure.com/\nAZURE_OPENAI_DEPLOYMENT=gpt-4o\n\n# Option 3: Google Gemini\nGOOGLE_API_KEY=your_google_api_key\nGOOGLE_MODEL_ID=gemini-2.0-flash  # Optional, defaults to gemini-2.0-flash-exp\n\n# Neo4j (required for all options)\nNEO4J_URI=neo4j+s://your-instance.databases.neo4j.io\nNEO4J_USERNAME=neo4j\nNEO4J_PASSWORD=your_password\nNEO4J_DATABASE=neo4j\n```\n\n**Note:** If `--provider` is not specified, the system auto-detects in this order:\n1. Azure OpenAI (if `AZURE_OPENAI_API_KEY` is set)\n2. Google Gemini (if `GOOGLE_API_KEY` is set)\n3. OpenAI (default fallback)\n\n5. **Install optional dependencies:**\n```bash\n# For web search functionality\npip install duckduckgo-search\n```\n\n## Usage\n\n### Command Line Interface\n\n**Basic usage (auto-detects provider from environment):**\n```bash\npython dependencyrag/main.py\n```\n\n**With specific provider:**\n```bash\n# Using Google Gemini\npython dependencyrag/main.py --provider google --model gemini-2.0-flash\n\n# Using Azure OpenAI\npython dependencyrag/main.py --provider azure --model gpt-4o\n\n# Using OpenAI\npython dependencyrag/main.py --provider openai --model gpt-4o\n```\n\n**Available options:**\n- `--provider`: LLM provider (`openai`, `azure`, `google`). Auto-detects if not specified\n- `--model`: Model ID to use (default: gpt-4o)\n- `--db-file`: SQLite database file (default: depsrag.db)\n- `--debug`: Enable debug mode\n- `--no-stream`: Disable streaming responses\n\n### Example Session\n\n```\nYou: Please analyze chainlit version 1.1.200 from PyPI\n\nAssistantAgent: I'll help you analyze chainlit 1.1.200. Let me start by \nconstructing the dependency graph...\n\n[DependencyGraphAgent constructs the graph]\n\nAssistantAgent: The dependency graph has been created! What would you like \nto know about the dependencies?\n\nYou: What are the direct dependencies?\n\nAssistantAgent: Let me query the graph for direct dependencies...\n\n[Returns list of direct dependencies]\n\nYou: Are there any known vulnerabilities in this version?\n\nAssistantAgent: Let me check the OSV vulnerability database...\n\n[SearchAgent checks for vulnerabilities]\n\nAssistantAgent: I found the following security information...\n```\n\n### Programmatic Usage\n\n```python\nfrom dependencyrag import create_depsrag_team\n\n# Create the team (auto-detects provider from environment)\nteam = create_depsrag_team(\n    model_id=\"gpt-4o\",\n    db_file=\"my_analysis.db\"\n)\n\n# Or specify a provider explicitly\nteam = create_depsrag_team(\n    model_id=\"gemini-2.0-flash\",\n    provider=\"google\",  # \"openai\", \"azure\", or \"google\"\n    db_file=\"my_analysis.db\"\n)\n\n# Run a query\nresponse = team.run(\n    \"Analyze the dependencies for requests version 2.31.0 from PyPI\"\n)\n\nprint(response.content)\n\n# Ask follow-up questions\nresponse2 = team.run(\"What are the direct dependencies?\")\nprint(response2.content)\n```\n\n## Example Questions\n\nAfter constructing a dependency graph, you can ask:\n\n- **Graph structure:**\n  - \"What's the depth of the dependency graph?\"\n  - \"How many total packages are in the graph?\"\n  - \"What are the direct dependencies?\"\n\n- **Specific packages:**\n  - \"Is there a dependency on pytorch? Which version?\"\n  - \"What's the path between package-1 and package-2?\"\n  - \"Which packages depend on numpy?\"\n\n- **Analysis:**\n  - \"Which packages have the most dependencies relying on them?\"\n  - \"Tell me 3 interesting things about this dependency graph\"\n  - \"What are the leaf nodes in the graph?\"\n\n- **Security:**\n  - \"Are there any known vulnerabilities in this package?\"\n  - \"Check all dependencies for security issues\"\n\n- **General info:**\n  - \"What's the latest version of this package?\"\n  - \"Can I upgrade any dependencies?\"\n\n## Testing\n\nRun the test suite:\n\n```bash\n# Run unit tests\npython tests/test_neo4j_tools.py\n\n# Run integration tests\npython tests/test_integration.py\n\n# Or use pytest\npytest tests/ -v\n```\n\nRun the example script:\n\n```bash\npython examples/basic_example.py\n```\n\n## Project Structure\n\n```\nDepsRAG/\n├── dependencyrag/\n│   ├── __init__.py              # Package initialization\n│   ├── main.py                  # CLI entry point\n│   ├── agno_agents.py           # Agent definitions\n│   ├── agno_tools.py            # Tool definitions\n│   ├── depsrag_team.py          # Team orchestration\n│   ├── neo4j_tools.py           # Neo4j utilities\n│   └── cypher_message.py        # Cypher query templates\n├── tests/\n│   ├── test_neo4j_tools.py      # Unit tests\n│   ├── test_integration.py      # Integration tests\n│   └── README.md                # Test documentation\n├── examples/\n│   └── basic_example.py         # Usage example\n├── docs/                        # Documentation assets\n├── .env-template                # Environment template\n├── pyproject.toml               # Dependencies\n└── README.md                    # This file\n```\n\n## Troubleshooting\n\n### Neo4j Connection Issues\n- Verify your Neo4j credentials in `.env`\n- Check that your Neo4j instance is running\n- Ensure you're using the correct URI format\n\n### API Key Issues\n- Verify your API key is valid for your chosen provider (OpenAI, Azure, or Google)\n- Check that you have sufficient API credits/quota\n- Ensure the key is properly set in `.env`\n- For Azure: verify endpoint URL and deployment name are correct\n- For Google: check that you haven't exceeded free tier limits\n\n### Package Installation Issues\n- Use Python 3.11 or higher\n- Install with `pip install -e .` for development mode\n- Try `poetry install` if pip fails\n\n## Contributing\n\nContributions are welcome! Please:\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## License\n\nMIT License - see LICENSE file for details\n\n## Citation\n\nIf you use DepsRAG in your research, please cite:\n\n```bibtex\n@software{depsrag2024,\n  title={DepsRAG: Dependency Analysis with RAG and Multi-Agent Systems},\n  author={Mohannad Alhanahnah},\n  year={2024},\n  url={https://github.com/Mohannadcse/DepsRAG}\n}\n```\n\n## Acknowledgments\n\n- Original DepsRAG implementation using Langroid\n- [Agno](https://github.com/agno-agi/agno) multi-agent framework\n- [deps.dev](https://deps.dev/) API for dependency data\n- [OSV](https://osv.dev/) vulnerability database\n- Neo4j graph database\n\n## Contact\n\n- **Author**: Mohannad Alhanahnah\n- **Email**: mohannad.alhanahnah@gmail.com\n- **GitHub**: [@Mohannadcse](https://github.com/Mohannadcse)\n\n---\n\n**Note**: This is the Agno-powered version of DepsRAG, featuring multi-provider support (OpenAI, Azure OpenAI, Google Gemini) and a modern multi-agent architecture.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohannadcse%2Fdepsrag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohannadcse%2Fdepsrag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohannadcse%2Fdepsrag/lists"}