500 lines of Python: A minimal framework for unentangled AI agents (docs.axio-agent.com)
by anon | permalink
23/ 99 viralityNiche, low traction
edit & rescore →
9 HN points · front-page probability 31%
p10 · 3p90 · 301
The model already found titles that score higher. Try one.
I've been building LLM-powered tools for a while and kept running into the same problem: frameworks that own too much. You pick LangChain or similar and suddenly your agent loop, your prompt format, your retry logic, and your provider are all entangled. Axio is my attempt at a minimal foundation that stays out of the way. The core is ~500 lines. The design centers on three ideas: 1. Transport is a protocol, not a class. Any object with a stream() method that yields typed events works. Swapping Anthropic for OpenAI is one import change. ChatGPT via its OAuth Responses API, Google Gemini, or your own mock - same interface. 2. Tools are plain async functions. No decorators, no registration DSL. A docstring becomes the description. Type hints become the JSON schema. Concurrency limits and permission guards attach at the Tool() wrapper, not scattered through the call chain. 3. Streaming is not an afterthought. The agent loop yields typed StreamEvents - TextDelta, ToolUseStart, ToolInputDelta, IterationEnd. You can pipe them to a TUI, a WebSocket, or stdout without any adapter layer. async def get_weather(city: str) -> str: """Return the current weather for a city.""" return f"Sunny, 22°C in {city}." agent = Agent( system="You are a helpful weather assistant.", transport=OpenAITransport(model="gpt-4o"), tools=[Tool(name="get_weather", handler=get_weather)], ) async for event in agent.run_stream("What's the weather in Berlin?", context): if isinstance(event, TextDelta): print(event.delta, end="", flush=True) The repo is a uv workspace with 10 packages: the ~500-line core, transports for Anthropic/OpenAI/Google/Codex, tool providers (local file/shell, MCP bridge, Docker sandbox), a Textual TUI, SQLite context store, and permission guard plugins (PathGuard, LLMGuard). Realtime audio (via OpenAI's Realtime API and Google's Live API) is also supported through a parallel RealtimeAgent / RealtimeTransport protocol. The docs are tested with markdown-pytest - every code block in the guides runs in CI. GitHub: https://github.com/mosquito/axio-agent PyPI: pip install axio Happy to answer questions about the design decisions - especially the permission guard system and why I went with entry points for plugins instead of a config file.
ForesynWanna keep in touch?
Built this solo over a weekend. Soft-launching before the HN post on Monday. If you scored a draft and the prediction either nailed it or whiffed, I want to know.
DM @crimeacs on Telegram — fastest way to reach me
Connect on LinkedIn — Artemii Novoselov
Edit & re-score