Project Deep Dive
Hermes Pro
A FastAPI-based code assistant prototype that uses a graph-backed agent to answer natural-language questions about a Python codebase.
Overview
Hermes Pro is a local API prototype for querying Python code structure in natural language. It parses a repository with Python AST, builds a NetworkX knowledge graph of files, classes, functions, and methods, then lets a LlamaIndex ReAct agent answer questions through graph query tools. The current implementation is still in progress and is hardcoded to analyze the requests library rather than arbitrary repositories.
Key Outcomes
Built a graph-backed natural-language query flow over code structure instead of relying only on plain text search.
Used Python AST parsing to turn repository structure into queryable graph relationships between files, classes, functions, and methods.
Wrapped the graph tools with a local LLM agent and exposed them through both FastAPI and Discord interfaces.
Architecture Diagram
Questions flow from FastAPI into a graph-backed agent, which queries AST-derived code structure and returns natural-language answers.
Architecture
A code parser walks Python files with the built-in ast module and builds a structural graph of file, class, function, and method nodes plus containment relationships.
A NetworkX-backed query layer exposes helper tools such as listing files, classes, methods in a class, and code lookup by name.
A LlamaIndex ReAct agent running on Ollama-backed Llama 3 chooses those graph tools to answer natural-language questions through the FastAPI query endpoint.
A Discord bot forwards user questions to the local API so the same graph-backed workflow can be used through chat.
Stack
- Python
- FastAPI
- NetworkX
- Docker
- LlamaIndex
- Ollama
- Llama 3
- AST
- Discord bot