Show HN: Build a coding agent in 500 lines (Pure Python, No Vector DBs)
I maintain jq (jqlang). I tend to like tools that are simple, composable, and transparent.
Recently, I started exploring AI agents, but got frustrated with the state of the ecosystem. Most tutorials and frameworks (LangChain, AutoGPT, etc.) felt like black boxes that added unnecessary layers of abstraction. Debugging a "ReasoningEngine" when it hallucinated was a nightmare.
I wanted to see if I could build a production-grade coding agent from first principles, using nothing but standard Python libraries.
I turned that experiment into a book: https://buildyourowncodingagent.com
The philosophy is "Zero Magic." We build an agent called "Nanocode" using:
- Pure Python (no frameworks, no SDKs) - requests for the LLM API (Claude/DeepSeek/Ollama) - subprocess for executing code and reading stdout/stderr - No Vector DBs (just simple file search) - A simple while loop for orchestration
The final result is in 500 lines of code. It can read/write files, run tests, fix its own bugs (using the error output), and run entirely locally if you use Ollama.
I've put up sample chapters on the site. I wrote this for engineers who want to understand the architecture of tools like Cursor or Claude Code without the marketing fluff.
Happy to answer any questions about the architecture, the "no-framework" approach, or why I think vector DBs are overkill for coding agents. OP here. Just to be clear—the book is the guide, but the agent itself is open source. You can check out the full code (the 500-line nanocode.py) here:
https://github.com/owenthereal/build-your-own-coding-agent I'm happy to answer questions about the 'Zero Magic' architecture or the decision to drop vector DBs.