Designing Helium Agent
Helium Agent is a lightweight AI agent built with Python. It runs in your terminal. It is designed for minimum complexity.
Here are the core design decisions from the build:
• Architecture
The system uses a flat architecture. I avoid heavy frameworks and deep dependency trees. I use XML tags like
• Composability through Dependency Injection I use a simple loop called AgenticLoop. It accepts two inputs: a model caller and a tool executor. This one choice allows four different modes:
- General chat
- Coding workflows
- Subagents
- Custom skills I do not use subclasses or complex patterns. Just two simple functions.
• State Management Helium is a single-user tool. I use module-level singletons for conversation history and memory. Global state is the simplest way to represent a single user session. It prevents over-engineering.
• Safety Gates I use a three-tier system for tool execution:
- Safe: Auto-executes tasks like reading files or searching.
- Risky: Requires user permission for tasks like writing files.
- Conditional: Inspects commands like bash scripts to check for danger. This prevents a hallucinating model from deleting your files.
• Communication I use raw HTTP requests instead of the OpenAI SDK. This reduces dependencies and keeps the code transparent. You see exactly what goes to the API.
• Skill System Skills are just Markdown files. You can add a new skill by writing a text file with YAML frontmatter. There is no complex registration API. This makes the plugin system easy for anyone to use.
• Lessons Learned
- Dependency injection provides cheap composability.
- The system prompt is your API. Treat it as a first-class piece of code.
- If you need lazy imports to fix circular dependencies, your module boundaries are wrong. Fix the architecture instead.
Simplicity scales. Choose the simplest solution that works for your specific use case.
Source: https://dev.to/debmalyasen34/designing-helium-agent-1b39
Optional learning community: https://t.me/GyaanSetuAi
