u/gergo254

▲ 0 r/golang

I built a lightweight, modular personal AI agent for fun in Go

Hi everyone,

I wanted to drop in and share a small personal AI agent I've been working on.

I wanted to learn more about AI agents by actually building one. I started with a simple, modular agent in Go using the genai lib, but recently moved to Genkit for multi-backend AI support. (I've only tested it with Gemini so far, but Go has been great for this, the compiled binary is under 20 MB and starts instantly).

It started as a simple HTTP tool I could call via curl, but I eventually added Telegram as my main frontend since it's free and easy. As I experimented, I wanted to support multiple tools and agents, so I added MCP option as server and client. Now, my main agent (for me Gemini Flash, thinking disabled) can spin up specialized sub-agents on the fly based on the task. For example, it can call on Gemini Pro for heavy reasoning, or trigger a custom "travel planner" that fetches live Vienna public transport data and returns it in seconds. I can create any custom agent with any custom skill or MCP without polluting the main agent's context much.

Here is a quick rundown of the other features I added:

  • RAG: It loads data from a local folder once and keeps it persistently in a vector DB.
  • History handling: It "compacts" conversation history based on a message limit, keeping the important context without blowing up the prompt size.
  • Dynamic Context: You can inject live CLI command results into the context instead of just static files (like weather data). To avoid spamming external APIs on every call, I built a cachefor CLI tool that caches these command outputs for a set time.

Everything is Dockerized (docker-compose-skill.yml), pulling configs and API keys from a .env file and a few .d folders.

I built this mostly for myself, but I think the architecture could be useful to anyone experimenting. I am open to any feedback or ideas. (Yeah, the code quality and testing could be improved for sure, but this is just a side project for now.)

Repo: https://github.com/Gerifield/hAIry-botter

reddit.com
u/gergo254 — 1 day ago