How to make your software factory’s context lake smarter with every run
See how Lessons Memory turns closed work into verified agent lessons tied to your catalog, so your software factory gets smarter.

Your agents burn tokens rediscovering fixes your team already found, because what one engineer learned last month never reaches the next agent that hits the same problem.
Our own engineering org showed us how common this is. None of the 138 closed Jira bugs we checked held a lesson an agent could reuse, because root-cause fields mostly went unfilled, as they do on most teams. We also had 64 root-cause analyses written up, each useful on its own but not yet connected to the service or incident it explained.
The clearest signal came from our teams themselves. They were already building agent memory inside Port, a store that grew to 127 entries, because the catalog was the natural place to keep what agents should know. Without a way to tie each entry to the thing it described, 125 of those entries ended up scoped “global,” relevant to everything and useful for nothing. That told us exactly what to build: lessons that attach to the service, skill, or stage they’re about. In a software factory, the catalog at the center of your context lake gives each of those things an address.
Naive agent memory breaks in five ways
Any LLM can write a plausible lesson from a closed ticket. Keeping lessons right, small, and cheap is the hard part, and each failure mode is worse than having no memory at all.
- Wrong lessons. Agents trust what they’re told, so a false lesson does more damage than a missing one. One earlier internal attempt turned a single scale change into 51 false lessons.
- Stale lessons. Code, owners, and runbooks change, and a lesson that was true in March can send an agent the wrong way in November.
- Duplicates. Ten incidents produce ten phrasings of the same lesson. In our first test run, one daylight-saving flake became four separate lessons.
- Poisoning. Closed work is text people wrote, so anything that learns from it is exposed to injection. Research reports memory-injection attacks succeeding 98% of the time.
- Context cost. Every lesson an agent reads costs tokens, and past a point, extra context costs more than it saves.
The writing model never gets a vote
The principle behind Lessons Memory is that a model never decides on its own what becomes knowledge. Each closed item passes through seven steps, and only one of them asks a model to write anything.

You can see the gate in the product. When you set up a source, you define what “finished” means (for pull requests, merged rather than open or closed), pick what each lesson attaches to, and see a live preview of what Port would read before anything runs.
A lesson lives in the context lake, not in a note
This is the part that makes the context lake smarter. A lesson isn’t text pasted onto a wiki page; it’s an entity in the catalog, attached to the service, skill, test or stage it’s about, in the same graph your agents already query.
Each lesson carries a one-line title, an “applies when” cue that tells an agent whether it’s relevant, a body of about 600 characters at most, links to the closed work it came from (links, not copies), validity dates, and an origin: AI-drafted, human-written, or human-edited. Retiring a lesson ends its validity, and nothing gets deleted.
Because lessons sit on the catalog, they inherit what the catalog already knows. Ownership decides who reviews a lesson, permissions decide which agents can read it, and a service page shows its lessons next to everything else about that service.
Lessons helped agents find the right fix more often
The pipeline proof of concept ran on 281 real closed items from Port’s own org: agent runs, Jira bugs, and handover notes. It kept or rejected lessons correctly 97% of the time (mean of three runs, range 93–100%) and sorted items into “has a lesson” or not with 88% accuracy and 87% recall, against 74% for a small model alone. Both results were graded against an AI answer key, not yet by people.
The question that matters is whether agents do better with lessons. We replayed 7 real past CI failures three times each, giving 21 answers per arm. Both arms had Port’s MCP server; one also had lessons, and lessons were rebuilt only from evidence older than each failure so none could leak the answer. Answers were graded blind against what actually fixed the failure.
By task, lessons won 3, tied 3 and lost 1. The loss is the most useful result in the test: a lesson framed the cause wrongly, and every answer that used it stayed wrong. That’s exactly the failure owner review exists to catch.
Trust is earned on a ladder, and the loop closes three ways
In v1, a person approves every lesson and nothing publishes on its own. A proposed lesson arrives at the team that owns its entity with its automatic checks already run: whether the evidence backs it, whether anything was invented, whether it overgeneralizes, and how useful it’s likely to be. The reviewer can approve it, reject it, or rewrite a line first, and a human edit always wins.

Each lesson also gets a quality level from Port’s own scorecards, running from Basic through Bronze and Silver to Gold. Silver needs repeated evidence, no staleness and owner review, and Gold adds more than one kind of source, recent use and being graded helpful. Teams can see why a lesson is trusted, and when a rule stops passing, the owner gets flagged. The next rung, planned for v2, grades lessons in the background against later work before anyone sees them, and only lesson types that reach a measured precision get to publish automatically.
The loop closes in three ways. New closed work produces new lessons or reinforces existing ones through the reconcile step. Reviewer edits stick, so the better wording is what agents get. Agents also report which lessons they used, which feeds the quality level and, later, lets lessons nobody uses fade out.
The more lines your factory runs, the more each lesson is worth
The software factory is where this loop gets most interesting. A factory runs work through lines of stages, like spec, build, and review, with agents doing the work and people approving checkpoints. Every stage run already records its outcome, why it failed, who rejected a checkpoint and the note they left, the questions the agent asked, the answers a person gave, and how many tries it took. That’s exactly the kind of closed work Lessons Memory reads, and failed runs count as finished, because failures teach the most.
- Stage runs become a source. Configuring one means choosing the blueprint, when a run counts as finished, and what its lessons attach to.
- Human decisions are the strongest signal. A rejection or a person’s answer is the highest-signal lesson a factory produces, and a record of every human decision on a work item is planned.
- Lessons scope to the stage. “The spec stage keeps missing acceptance criteria” belongs to a stage rather than a service, and the line owner reviews it.
- Each try reads first. A stage builds its prompt on every try, so it can pull lessons scoped to that stage and service while keeping context small.
- Lessons track instruction versions. A lesson learned under old stage instructions gets flagged when those instructions change.
The end state is a stage whose most proven lessons get promoted into its own instructions, changing how agents handle every future item. That promotion is a separate, visible step with owner approval and an audit trail. What you get is a factory that gets smarter with every run, under human control, with every change traceable to the work that taught it.
One fix reaches every line that needs it
A single factory line learning from its own runs is useful, but the payoff grows when the factory runs several lines at once. Picture one line shipping features, one upgrading runtimes and one triaging incidents, all hitting the same services, skills and stages. Lessons don’t belong to the line that found them. They attach to the catalog entity they describe, so any agent working on that entity, on any line, gets them.
Three steps in the pipeline make this work across lines. Reconcile compares every new draft with the lessons already filed against that entity, so the third line to hit a problem reinforces an existing lesson instead of adding a near-copy. Owner review stays with the team that owns the entity rather than the line that tripped over it, so that team approves a lesson once for everyone. Serve filters by entity and task, so a line only pulls what applies to the work in front of it.
Lessons learned
The lessons pipeline changes what a run leaves behind. A run still ships a fix or a feature, but it also produces a verified lesson, filed against the service, skill, or stage it’s about and approved by the team that owns it. The next agent to touch that service starts where the last one finished. As the factory adds lines, more of its work starts from what it already knows instead of from the logs.
That’s the real promise of a factory that learns: the hundredth run on a service should be faster and more accurate than the first. The knowledge that makes it so should also outlast any one engineer, agent, or line. Start with one entity and one line, wire up get_lessons, and watch what the second run does differently.
Download the RFP guide
Get your survey template today
Download your survey template today
Free Roadmap planner for Platform Engineering teams
Set Clear Goals for Your Portal
Define Features and Milestones
Stay Aligned and Keep Moving Forward
Create your Roadmap
Free RFP template for Internal Developer Portal
Creating an RFP for an internal developer portal doesn’t have to be complex. Our template gives you a streamlined path to start strong and ensure you’re covering all the key details.
Get the RFP template
Leverage AI to generate optimized JQ commands
test them in real-time, and refine your approach instantly. This powerful tool lets you experiment, troubleshoot, and fine-tune your queries—taking your development workflow to the next level.
Explore now
Check out Port's pre-populated demo and see what it's all about.
No email required
LIVE WEBINAR, Aug 18, 2026:
Context-aware Vibe Coding for Platform Engineering
Thursday, October 22 12:00pm EDT⋅6:00pm CET
To learn more about the new capability and to see a live demo, join our upcoming community session with GitHub
Move fast while staying in control
Build governed agentic workflows on one central platform.
See it in action:
Watch this video on generating Terraform with Port, or explore our public demo.
.png)
Check out the 2025 State of Internal Developer Portals report
No email required
Minimize engineering chaos. Port serves as one central platform for all your needs.
Act on every part of your SDLC in Port.
Your team needs the right info at the right time. With Port's software catalog, they'll have it.
Learn more about Port's agentic engineering platform
Read the launch blog
Contact sales for a technical walkthrough of Port
Every team is different. Port lets you design a developer experience that truly fits your org.
As your org grows, so does complexity. Port scales your catalog, orchestration, and workflows seamlessly.
Port × n8n Boost AI Workflows with Context, Guardrails, and Control
Port Builders Session: A Single, Governed Interface for All MCP Servers
Book a demo right now to check out Port's developer portal yourself
Apply to join the Beta for Port's new Backstage plugin
n8n + Port templates you can use today
walkthrough of ready-to-use workflows you can clone
From manual to autonomous engineering
One platform to build, govern, and operate the Agentic SDLC.
Port is open for you to try it
build your first agentic workflow today















