Building Rastrix in public: an AI agent that finds why production broke
An open source agent that reads metrics, traces and logs, remembers past incidents and explains the probable cause. What exists today, how OpenRouter fits in, and how you can join.
I'm building Rastrix in public. It's an open source AI agent that helps you find out why production broke. Something fails, you ask the agent, and it looks at your metrics, traces and logs, compares them with past incidents, and tells you the probable cause and the evidence behind it. It is read-only on purpose: it explains, you decide.
I'm sharing every step here, what works and what I'm still figuring out. If the project interests you, you're welcome to join.
The project in one picture
An agent that investigates failures needs something to fail. So I started with a demo.
- Demo API. A notification service (email, SMS and push) that breaks on purpose. It simulates incidents like a wave of 500 errors or a slow API.
- OpenTelemetry. Every request becomes metrics, traces and logs.
- Grafana stack. Dashboards and alerts on top of that data.
- The agent. The part I'm building now. It starts with a chat.
What I'm building now: the chat
Before the agent can read dashboards, it needs to talk to a language model. So the first piece is a chat: you send a question, the agent sends it to a model and returns the answer, together with the name of the model that wrote it.
To reach the models I use OpenRouter.
What OpenRouter is
OpenRouter puts hundreds of AI models behind one API and one key. To switch models, you change a name, not your code.
Today I test with free open source models, so it costs nothing while I learn. Later I want to try paid models too, and with OpenRouter that is a change in the config, not a rewrite. Comparing models on the same incident will be one of the most interesting parts of the project.
The feature I like most: you can send a list of models. If the first one fails, for example because it hit its rate limit, OpenRouter tries the next one.
The agent sends one request and gets one answer. It never has to know that the first model failed.
Things I found interesting
- The answer tells you which model replied. With a list of models, this is how you know who actually answered.
- You choose what "best provider" means. The same model runs on several providers. You can ask OpenRouter to pick by
price,latency(the first word arrives sooner) orthroughput(the whole answer arrives sooner). - There are free models. You get 20 requests per minute and 50 per day. Buying at least 10 credits once raises the daily limit to 1,000.
- You pay for the model that answered. If a free model fails and the next one in the list is paid, you pay the paid price.
- Free models come and go. A free model can disappear at any time, so the list lives in a config variable, not in the code.
How the agent will remember past incidents
Reading dashboards is half of the job. An experienced engineer also remembers: "this looks like that outage from last month". Giving the agent that memory is the next big piece, using RAG (retrieval-augmented generation).
The idea: a knowledge base of post-mortems and runbooks. Each document is split into small pieces, and each piece becomes an embedding, a list of numbers that captures its meaning. When an alert fires, the agent searches for pieces with a similar meaning and adds them to the prompt as extra evidence.
I chose Neo4j for the knowledge base because it does vector search and graphs. Besides "similar text", incidents can connect to the services they hit and to their cause. So the agent can ask for "other incidents on this service" or "other incidents caused by a missing timeout".
Building in public: come along
Rastrix is open source under the MIT license, and it's early. That is the best moment to shape it. A few ways to take part:
- Follow the repo on GitHub and watch it grow, one pull request at a time.
- Open an issue with an idea, a question or feedback. Right now this helps the most.
- Share a public post-mortem you learned from. The knowledge base will be built from real ones.
- Tell me what you check first when you're on call. That is exactly what the agent should learn.
- Send a pull request. The contributing guide explains the workflow.