Skip to Content

Building a Brain: How I Try to Give AI Context

Why my early experiments with AI agents failed due to a lack of context, and how I started building a dedicated repository to help them understand my servers.

When I first started playing with AI agents, my initial thought was that they would just magically know what to do.

I'd drop an agent into a terminal and ask it to fix something, and it would immediately get stuck. It didn't know the IP addresses. It didn't know what Docker containers were running. It didn't have the SSH keys. I realized pretty quickly that I wasn't saving time—I was just spending my time answering the agent's questions instead of doing the work myself.

The Missing Piece: Context

I started thinking about how I could solve this gap. If I have to spend 20 minutes explaining my server topology to an agent every time I need help, the experiment fails.

I decided to try building what I call a Server_Orchestration Brain.

It's essentially just a Git repository sitting next to my code, but it's specifically written for AI consumption. I started dumping everything I knew into it: 

  1. The Infrastructure Map: A raw docker ps dump showing all 22+ containers so the agent doesn't have to guess.
  2. The Security Posture: Notes on how my iptables and ufw are configured, so the agent knows the rules of the road.
  3. Execution Commands: The literal SSH connection strings needed to get into the boxes.

Testing the Theory

I'm still refining what goes into this Brain, but the early results have been incredibly encouraging.

When my Odoo database threw an error the other day, I pointed the agent at the Brain first. It read the context, found the right SSH command, located the live18-db container, and patched the database schema without needing to ask me twenty questions.

It's a constant learning process, but figuring out how to structure knowledge for AI has become one of my favorite new puzzles to solve.

💡 Tips for Building an AI Brain

If you want to create a context repository for your own agents, here are a few starting points: 

  1. Keep it Raw: Don't write beautiful prose for an AI. Agents parse raw data faster. A raw dump of docker ps is better than a narrative paragraph explaining your containers. 
  2. Centralize Security Rules: Keep a single markdown file dedicated to how your firewall is configured. Agents need to know your boundaries before they start executing commands.
  3. Use Markdown Links: Agents parse markdown links extremely well. Link files together within the repository so the agent can traverse your knowledge base logically.

🔗 Related Resources

  • Internal Link: To see how having this context allowed an agent to help me analyze a DDoS attack, check out my post on Agentic Incident Response.
  • External Link: If you want to learn more about the concept of AI knowledge bases and RAG (Retrieval-Augmented Generation), I highly recommend reading the LangChain Documentation on RAG.
Building a Brain: How I Try to Give AI Context
Ramon Rios Jr. June 18, 2026
Share this post
Archive
Sign in to leave a comment
Discovering the Invisible Vulnerability: Docker and UFW
An exploration into network security where I discovered that Docker silently bypasses UFW, and how I experimented with iptables to fix it.