Inspiration

We've seen too many codebases turn into spaghetti because architectural guidelines get lost in a massive wiki that nobody reads. Tech debt slowly creeps in through Pull Requests simply because human reviewers are focused on business logic, not structural purity. I wanted to build an autonomous agent that acts as a ruthless architectural guardian—catching duplicate code and bad patterns before they ever merge into main.

What it does

ARCHON is an autonomous Tech Debt PR Reviewer. When a developer opens a Pull Request on GitHub, ARCHON intercepts the webhook, parses the code diff, and semantically compares the incoming code against the entire existing codebase. If it detects duplicated logic or architectural violations, it uses a local LLM to generate a strict, helpful code review comment directly on the PR, blocking bad code at the source.

How we built it

We built ARCHON entirely on local, privacy-first AI tools to prove you don't need expensive API keys for powerful agents:

  • Models: Powered entirely by local Ollama, using nomic-embed-text for vector embeddings and qwen2.5-coder:7b for code evaluation.
  • Vector DB: Used Qdrant (local mode) to index and semantically search the repository.
  • Orchestration: Wired the entire logic using a Directed Acyclic Graph (DAG) via the Strands agent framework.
  • Integration: A FastAPI (Uvicorn) webhook server listens to GitHub PR events and triggers the agent graph asynchronously.

Challenges we ran into

Integrating a local Rust-based vector database (Qdrant) with an asynchronous DAG orchestration framework inside a FastAPI event loop was incredibly tricky. We hit massive deadlocks and connection timeouts because the synchronous LLM evaluation was completely blocking Uvicorn's asyncio event loop. We had to heavily refactor our Strands FunctionAgent wrappers to offload the deterministic AI tasks to background thread pools (asyncio.to_thread) just to keep the server alive! We also fought some pretty crazy Windows terminal locking bugs along the way.

Accomplishments that we're proud of

Getting a fully local AI pipeline working end-to-end! There's something magical about seeing a GitHub webhook trigger a local Python script, which dynamically queries a local vector database, evaluates the context using a local 7B parameter model, and returns a perfectly formatted code review in seconds—all running on local hardware without a single cloud API call.

What we learned

  • Managing state across a multi-node DAG requires careful typing and reference passing.
  • Never run synchronous, blocking LLM inference directly inside an async event loop!
  • Semantic search on raw code strings is highly effective for catching duplicate logic if you chunk it by AST (functions/classes) rather than raw line counts.

What's next for ARCHON

Right now, ARCHON relies on finding similar code snippets to catch duplicates. Next, we want to integrate it with an actual architectural rule-engine (like supplying a CONTRIBUTING.md that defines exact coding standards). We also plan to wrap the entire project into a Docker container so any enterprise team can run their own private tech-debt guardian on their internal network.

Built With

  • agents
  • fastapi
  • github-actions
  • ollama
  • python
  • qdrant
  • rag
  • strands
Share this project:

Updates

Submission history