Skip to main content

Supercharging AI Agents: Build a Git-Based Engineering Knowledge Framework in 20 Minutes

Stefana Muller
Nov 24 - 11 min read
Supercharging AI Agents: Build a Git-Based Engineering Knowledge Framework in 20 Minutes featured image

Imagine deploying AI agents that troubleshoot production incidents, generate pull requests, and execute engineering tasks faster than your team can document its decisions. Now imagine those agents relying on outdated architecture, contradictory discussions, or proposals that engineers already rejected. What happens when an AI agent confidently acts on knowledge your team knows is wrong?

That is the challenge we confronted at Salesforce. Critical engineering decisions were scattered across code repositories, meeting transcripts, collaboration platforms, and documentation. Some decisions were even being unintentionally reversed. As AI agents entered our workflows, we needed a reliable way to preserve what engineers decided, why they decided it, and what evidence supported it.

Our solution was an AI-powered engineering knowledge system we call the Second Brain. Built on Git and a connected knowledge graph, it organizes architectural decisions, source evidence, and implementation details so engineers and AI agents can retrieve reliable technical context. Today, it spans:

  • 21 domain-specific repositories
  • More than 200 sources
  • Over 250 articles

Our Kubernetes upgrade agent uses knowledge captured in the Second Brain to help automate approximately 80% of the upgrade process, reducing human hands-on work from three months to three weeks.

In this blog, I will show you how we built our Second Brain, the architectural mistakes we made, and how you can create an initial Git-based knowledge repository for your own AI agents in approximately 20 minutes.

Our team’s memory, connected across domains.

Why AI Agents Need More Than Engineering Documentation

What happens when an AI agent treats a rejected architectural proposal as an approved engineering decision? Traditional documentation can preserve both, but it does not necessarily explain which one engineers implemented or how that decision affects other systems.

Our Second Brain framework addresses this challenge through a structured, Git-based knowledge management system generated and maintained using LLM-powered skills and a plugin. Rather than an AI model, think of it as a team-specific counterpart to Salesforce’s Data 360, connecting engineering context through a knowledge graph.

Rather than simply collecting documents, the graph connects architectural decisions, source references, ownership information, and implementation evidence. These relationships help engineers and AI agents understand why decisions were made, identify contradictions, and recognize information that remains unverified. Reliable AI agents need more than access to documentation. They need connected, evidence-backed engineering knowledge they can use when making decisions.

Architecture: Why Our First Second Brain Failed

Our first Second Brain was supposed to eliminate knowledge fragmentation. Instead, the more information we added, the slower and more expensive our AI agents became. A repository designed to accelerate engineering was consuming valuable context on information unrelated to the task.

Initially, consolidating everything into one repository seemed logical. Every agent could access our collective knowledge without searching multiple locations. But as the repository grew, retrieval slowed and token consumption increased. We discovered that knowledge boundaries matter as much as the knowledge itself. Rather than continue expanding one enormous repository, we divided it into smaller, domain-specific brains connected through a knowledge graph.

Today, our framework contains 21 domain brains, more than 250 articles, and over 200 registered sources. Engineers and agents can begin with the relevant domain, then follow connections when additional context is necessary.

This interconnected architecture provides three advantages:

  • Faster retrieval: Agents can focus on relevant domain knowledge instead of searching an enormous repository.
  • Lower context consumption: Smaller knowledge boundaries reduce unnecessary token usage.
  • Connected decisions: Knowledge-graph relationships preserve access to supporting evidence and related implementations.

The lesson is straightforward: do not begin by ingesting everything your organization knows. Start with one domain, establish useful relationships, and expand when additional context becomes necessary.

Knowledge Integrity: Preventing AI Agents From Using Bad Information

Two architectural records describe conflicting solutions to the same problem. Both appear legitimate, but only one reflects what engineers implemented. An AI agent choosing the wrong version could build an entire troubleshooting recommendation around a false assumption.

Preventing that outcome became one of our biggest challenges. We could not allow agents to treat every statement in an engineering discussion as an established fact. Consider a design review where someone proposes a change, another engineer challenges it, and the team ultimately chooses a different approach. Capturing the original proposal without the surrounding discussion could transform a rejected idea into an apparent architectural decision.

Our framework preserves source references and helps identify inconsistencies between documented decisions and implementations. Rather than silently resolving conflicting evidence, it can surface those contradictions for human review.

We focus on four elements of knowledge integrity:

  • Source evidence: Where decisions originated and what supports them.
  • Contradictions: Where discussions, decisions, or implementations disagree.
  • Knowledge gaps: Information that remains unverified or unresolved.
  • Sensitive information: Confidential material that should not enter the repository.

When supporting evidence is missing, we preserve the uncertainty rather than invent an answer. That distinction matters during troubleshooting, when an agent must recognize the difference between verified engineering knowledge and an unsupported assumption.

As you build your own framework, make evidence and uncertainty explicit. Your agents need to understand not just what engineers know, but how confidently they know it.

Hands-On Tutorial: Build Your Own AI-Powered Second Brain

Imagine your most experienced infrastructure engineer leaving tomorrow. Years of architectural decisions, troubleshooting lessons, and operational knowledge are scattered across systems nobody else fully understands. When the next critical incident occurs, how quickly could your team reconstruct that expertise?

We demonstrated how to begin addressing this problem during a Salesforce Women in Technology workshop attended by more than 400 participants. After approximately 10 minutes explaining the framework, we devoted 20 minutes to hands-on creation. Some participants subsequently shared the brains they had built.

The goal is to create an initial Second Brain in approximately 20 minutes, not a fully populated, production-ready knowledge system. Its usefulness grows as you ingest additional sources, validate their contents, and maintain the repository.

Get started: Access the Second Brain framework’s plugin and skills on GitHub: https://github.com/salesforce-misc/second-brain/

Here is how to get started…

Step 1: Choose one engineering domain or recurring problem.

Start with a technical area where engineers repeatedly search for information or depend on a few individuals for answers. For example, our engineers encounter questions about legacy Red Hat installations, EC2 instances, and workloads that have not migrated to Kubernetes. You might also focus on an OpenSearch environment or another system whose architectural knowledge is scattered across multiple sources. Choose a manageable domain with identifiable documentation, implementation history, and engineering discussions. That gives your first knowledge graph clear boundaries and a practical purpose.

Step 2: Create your Git repository with an AI coding agent.

Load the Second Brain plugin and skills into Claude, Codex, or OpenCode using the installation instructions in the GitHub repository. The framework provides instructions and skills for repository creation, knowledge organization, and ingestion. Once your AI coding agent has access to those components, you could begin with an illustrative prompt such as: “Create a team Second Brain for our legacy infrastructure. Establish the Git repository and its structure, then guide me through identifying and ingesting the relevant engineering knowledge sources.” The agent can guide the initial setup and repository organization, reducing the need to design every article and knowledge relationship manually. The framework’s plugin and skills are essential to this workflow. A generic coding agent without those components will not necessarily reproduce the same implementation.

Human/Engineer interface to the DevOps team Brain.

Step 3: Connect engineering knowledge sources and validate the results.

Your team’s engineering knowledge probably spans multiple systems. Potential sources include:

  • Git repositories and pull requests
  • Meeting notes and technical discussions
  • Engineering documentation and architecture records
  • Email and ticketing systems
  • Team collaboration platforms

Identify which sources matter and guide the agent through ingestion. Where Model Context Protocol (MCP) connectors are available, agents can retrieve information directly. Otherwise, another tool can extract or summarize relevant material into Markdown. We use AI tools to synthesize engineering decisions from meeting notes and collaboration records, then organize those summaries alongside existing knowledge.

During ingestion, the agent may encounter decisions without clear ownership, information that should not be shared, or claims without supporting evidence. You help resolve those questions, identify authoritative sources, and preserve unknowns when answers are not available. An initial ingestion can take approximately 20 minutes, depending on the material. Subsequent ingestions can take around three minutes. My team and I perform updates regularly, reviewing the knowledge our agents consume and identifying areas that need improvement.

Start with one engineering problem and a manageable set of sources. Once the initial repository is useful, expand its knowledge and connections rather than attempting an enterprise-wide rollout on day one.

Maintenance: Keeping AI Engineering Knowledge Up to Date

A pull request changes your production architecture. The code is merged, and engineers move on. But your AI agents are still consulting documentation describing how the system worked before the change.

Building a Second Brain is only the beginning. Keeping it synchronized with engineering decisions becomes harder as agents implement changes faster than traditional documentation processes can capture them. We are incorporating knowledge-capture checks into our Git pull request workflow and exploring more automated ingestion. Pull requests provide particularly useful evidence because they record what engineers implemented, rather than merely discussed.

But capturing new information does not guarantee that the resulting knowledge graph is accurate. That is why we developed a LINT skill to check the health of our Second Brain. It looks for:

  • Conflicting decisions: Contradictory engineering or architectural claims.
  • Outdated knowledge: Information that may no longer reflect implementations.
  • Missing connections: Concepts disconnected from related knowledge.
  • Undocumented topics: Referenced subjects lacking explanations.
  • Unprocessed changes: Pull requests whose knowledge has not been incorporated.

We recognized the importance of these checks while visualizing our knowledge graph. Some concepts formed tightly connected clusters, while others appeared isolated, like stars scattered across the universe. Those disconnected concepts helped expose gaps worth investigating.

I currently run LINT manually each week using Claude. It surfaces inconsistencies and incomplete information for review, helping us identify where the knowledge graph needs attention. We are working toward greater automation, but nondeterministic AI agents still require oversight. Even when agents capture and organize information, engineers must determine whether the resulting knowledge is trustworthy.

Treat knowledge quality like code quality. Build capture into your existing workflows, inspect contradictions and missing relationships, and validate changes before agents rely on them.

Results: Automating 80% of Kubernetes Upgrades

Every quarter, our engineers faced another massive Kubernetes upgrade effort. Breaking changes, dependencies, approvals, and production workloads demanded careful coordination. By the time approximately three months of hands-on work were finished, another upgrade cycle was approaching. Engineers repeatedly had to reconstruct operational knowledge: What failed previously? Which dependencies mattered? Who needed to approve changes? How could workloads be handled safely?

Across our fleet of Amazon EKS and Azure Kubernetes Service (AKS) environments, we developed an agent that uses accumulated knowledge about system requirements, previous upgrade problems, rollout cadence, and approval responsibilities. With that context, the agent can automate work that previously required engineers to reconstruct the same information repeatedly while still taking into account the differences from the last upgrade.

We have seen improvements across several workflows:

  • Kubernetes upgrades: Approximately 80% automated, reducing human hands-on effort from three months to three weeks.
  • Troubleshooting: Difficult investigations reduced from one or two hours to minutes.
  • Architecture audits: Questions requiring an estimated 12 hours of engineering review answered within minutes.
  • Onboarding: A new DevOps engineer completed a first production pull request in less than two weeks.

Production upgrades still require human oversight, particularly when draining long-running workloads that could affect customers. Our longer-term goal is to reduce human involvement in development and staging upgrades to approximately one hour.

The Second Brain also supports our DevOps Console, which brings together monitoring, logs, tickets, code, operational signals, and approximately 20 agents. An engineer can initiate an investigation, allowing an agent to combine those signals with knowledge from the Platform Security DevOps Brain, diagnose a problem, and generate a proposed fix as a pull request. Historically, production certification required three months or more. Completing a first production pull request is not the same as completing certification, but the onboarding result demonstrates how quickly an engineer can begin contributing.

DevOps Console: This is a sample of the various feeds needed during triage by a human. With the Second Brain, we can remove the initial triage step and have the agent display the triage result directly.

These results are not yet part of a comprehensive productivity measurement program. Much of our agent usage occurs on individual development machines, limiting broader visibility. For your own team, identify workflows where engineers repeatedly reconstruct operational knowledge. Measure the effort involved, automate repeatable tasks, and retain human safeguards wherever production safety demands them.

Coming Soon: Building Trustworthy Autonomous AI Agents

An AI agent detects a production problem at 2 a.m., investigates its cause, and prepares a fix before the on-call engineer begins troubleshooting. That is the future we are pursuing. But what happens when an autonomous agent relies on stale knowledge, makes an unsafe change, or operates without clear accountability?

Our goal is for AI agents to identify and resolve production problems before engineers need to intervene. Reaching that point requires more than connecting agents to engineering documentation. We are addressing three remaining challenges:

  • Knowledge freshness: Determining how old architectural information is and whether it is safe to use for production decisions.
  • Autonomous validation: Exploring code-review checks, scheduled synchronization, and read-only production scans to identify knowledge gaps.
  • Agent identity and accountability: Establishing which agent performed an action, who is accountable, and what safeguards apply.

These are ongoing challenges, not problems we have fully solved. As we expand automation, maintaining trustworthy knowledge and appropriate oversight remains essential.

Our Second Brain began as a way to preserve engineering decisions disappearing across disconnected systems. Today, it helps agents troubleshoot incidents, generate code changes, and automate complex infrastructure work. But its greatest lesson is not about how much knowledge you can collect. It is about making the right knowledge available, connected, and trustworthy when an AI agent or human engineer needs to act.

You do not need 21 repositories or hundreds of articles to begin. Start with one engineering problem, build an initial Second Brain, and validate the knowledge it contains. Then expand its responsibilities as your confidence grows.

Learn More

Related Articles

View all