How I Use Cortex to Augment My AI Agents

I show you how Cortex gives my AI agents the knowledge they need before they work, so each agent builds with what we have learned.

Eduarda Ferreira

How We Solved AI Coding Slop

My coding agents wrecked my cofounder’s life’s work faster than he could review my changes. It was our product Journeys, a human-AI collaboration platform with more than a million lines he had written by hand and was proud of. I turned our codebase into a crime scene one reasonable commit at a time.

I’m Eduarda Ferreira, and I founded Socra with Mike. I have been coding with AI since 2023, and back then I had to ask him for help most of the time.

Mike is a self-taught full-stack developer who has been coding for almost ten years, and every decision in our codebase carries what those years taught him about building good software. He held the whole system in his head, and for most of that decade the reasons behind his decisions lived nowhere else.

Until 2024, Copilot finished the line I was typing, or I pasted a block of code from an AI chat bot. Then coding agents arrived that could read our codebase, edit files, run commands, and build whole features alone. I stopped asking Mike for help and moved fast, and the freedom felt great.

Every commit my agents made looked fine on its own, and the tests passed. Together, the commits wore what made Journeys special away, because the specific knowledge behind each file was missing at the moment my agents changed it: the things Mike knows about our system that no model was trained on. They filled these gaps with generic guesses.

A white humanoid robot spilling a tangled stream of colorful code

At first the slop arrived as small bugs, one confident wrong guess at a time, until Journeys was unusable. We started losing power users, and Mike could not review changes at the speed I could produce them. What kept him up at night was having to reverse engineer my agents’ damage in his own codebase.

This is how he described what reviewing my work felt like:

“The first thing I saw would be terrible. I’d be like, man, we don’t do it this way, this is going to have these problems. Then I’d look a little deeper, pull back a layer of the onion, and it would get worse. I’d pull back another layer, and it would get even worse. It makes you feel really terrible as a senior engineer to watch your life’s work getting wrecked.”

In 2025 we split the work. Mike started building a new codebase from scratch.

I treated the wrecked codebase as my lab and set out to build a self-improving swarm of agents. Every experiment ended the same way: an agent learned what I wanted, the session closed, and the learning went with it. The next agent started blank, and one of them broke something I had already fixed ten times before.

I carried the context by hand, pasting summaries from one session into the next. At the peak, I was spending $100 a day on Cursor. I memorized dozens of keyboard shortcuts for the prompts I repeated daily. Then I wrote Markdown instructions for everything my agents needed to know, until I had a mess nobody maintained.

The codebase moved every day and the files stood still. My agents kept reading last month’s wrong decisions and following them with full confidence. Writing the knowledge down was easy, but I had no system for keeping it true.

Working at a photolithography tool under the yellow light of the cleanroom at Texas Instruments

Before Socra, I was a photolithography engineer at Texas Instruments. Fabs make chips at higher volume and yield than almost anything else people build, because every additive step is followed by a subtractive one and a measurement, so errors get corrected layer by layer instead of compounding. When a run taught us something, we changed the recipe, and every run after it inherited the change. Nobody re-taught a lesson at the start of a shift, because the lesson lived in the recipe.

My agents were purely additive, like a 3D printer, where a defect on layer 10 is still there on layer 100. My swarm had no place where a lesson could live. An agent needed to receive the current knowledge before it acted, and someone had to keep that knowledge true. We started building Cortex to do that.

Cortex plugs into the agents I already use, including Claude Code and Codex, and gives them our specific knowledge before they work: how the product should behave and why we made it that way. A Module holds that guidance for one part of our work. Dependencies connect it to the knowledge needed to understand it: before changing an interface, my agents need both our design rules and the behavior of Mike’s service behind it. Flash retrieves the Module with those prerequisites, foundations first. Mike explains that connection in Agent Context Needs an Import Statement.

Mike had been fighting the same problem from his side. He tried agents.md files, and they helped with the one thing each file described and nothing around it. He explains how he connected that knowledge in his account of building Cortex.

Those Modules became the recipe my swarm was missing. I own mine, and I’ve authorized my agents to keep them current as we work. When I explain a correction in an ordinary conversation, they save the decision and its reason. The work that’s left goes into an Issue, with an owner, what has been checked and what remains. Each teammate has an Inbox for its assignments, and a ready Issue can wake the teammate who owns it. If I change my mind during review, the knowledge changes too, and the next agent starts from my correction.

I started using Cortex on Journeys first. By the time I first wrote this story, I felt Journeys was in the best shape it had ever been, and we had decided to keep it. Everything else was rebuilt from the ground up in TypeScript: new backend, new services, new apps. Journeys still runs on its original Python backend beside them.

I use Cortex every day while leading UX. Mike built Cortex’s API, backend and MCP connection for agents. I built its UI/UX with my agents, starting from the shared design we had developed for Journeys. Mike’s service knowledge in Cortex helps them connect the interface to the backend without me reteaching it.

After one of our shared UI releases, Mike messaged me:

“Cortex UI is looking really good.”

I found that awesome, because I had not made a Cortex-specific UI change in that release. What I had shipped was a release of the shared UI system behind all our web apps. My agents had improved its components and updated every web app to it. Cortex was the app Mike happened to open. This was my work reaching his screen with nothing in it for him to repair.

When I explained what he was looking at, he replied:

“Baby’s first abstraction 🥹”

My agents now knew what we had decided. They still signed in as me, though, and an agent working as me can’t own a role on its own. That’s what we built next, and What is agent identity? explains why it matters. If you want to try the knowledge side first, the Cortex setup guide walks you through one correction of your own.