That’s a wrap on PortCon. Recordings coming soon

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.

Michael Douglas
Michael Douglas
November 30, 2026
Michael Douglas
Michael Douglas&
November 30, 2026
Michael Douglas
Michael Douglas&&
November 30, 2026
How to make your software factory’s context lake smarter with every run

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.

  1. 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.
  2. Stale lessons. Code, owners, and runbooks change, and a lesson that was true in March can send an agent the wrong way in November.
  3. Duplicates. Ten incidents produce ten phrasings of the same lesson. In our first test run, one daylight-saving flake became four separate lessons.
  4. 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. 
  5. 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.

Type What it captures
Failure pattern A way something has broken before, and what triggers it
Rule Something to always do or never do
Procedure Steps to follow when doing or fixing something
Ownership Who owns something, or where to send it
Tests and alerts How to keep tests and alerts trustworthy

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.

Type What it captures
Failure pattern A way something has broken before, and what triggers it
Rule Something to always do or never do
Procedure Steps to follow when doing or fixing something
Ownership Who owns something, or where to send it
Tests and alerts How to keep tests and alerts trustworthy

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.

Tags:
{{download_survey}}

Download the RFP guide

Thanks for requesting the RFP Ebook
You can download it here
Thank you!You’ll be notified when the guide hits!
{{download_report}}

Download the report

Thanks for submitting.
Check your inbox for the report download.
Thank you!You’ll be notified when the guide hits!
{{survey-buttons}}

Get your survey template today

By clicking this button, you agree to our Terms of Use and Privacy Policy
{{stay_tuned}}

Stay tuned for our upcoming tutorial

With a step-by-step guide walking you through how to implement and scale Anthropic’s playbook in Port’s free tier. Register to be notified once the guide is published:

By clicking this button, you agree to our Terms of Use and Privacy Policy
Thank you!You’ll be notified when the guide hits!
{{survey}}

Download your survey template today

By clicking this button, you agree to our Terms of Use and Privacy Policy
{{roadmap}}

Free Roadmap planner for Platform Engineering teams

  • Set Clear Goals for Your Portal

  • Define Features and Milestones

  • Stay Aligned and Keep Moving Forward

{{rfp}}

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.

{{ai_jq}}

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.

{{cta_1}}

Check out Port's pre-populated demo and see what it's all about.

Check live demo

No email required

{{cta_webinar_aug_18}}

LIVE WEBINAR, Aug 18, 2026:

Context-aware Vibe Coding for Platform Engineering

{{cta_webinar_oct_22}}

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

{{cta_explore_port}}

Move fast while staying in control

Build governed agentic workflows on one central platform.

{{public_demo}}

See it in action:

Watch this video on generating Terraform with Port, or explore our public demo.

{{cta_survey}}

Check out the 2025 State of Internal Developer Portals report

See the full report

No email required

{{cta_2}}

Minimize engineering chaos. Port serves as one central platform for all your needs.

Explore Port
{{cta_3}}

Act on every part of your SDLC in Port.

Schedule a demo
{{cta_4}}

Your team needs the right info at the right time. With Port's software catalog, they'll have it.

{{cta_5}}

Learn more about Port's agentic engineering platform

Read the launch blog

Let’s start
{{cta_6}}

Contact sales for a technical walkthrough of Port

Let’s start
{{cta_7}}

Every team is different. Port lets you design a developer experience that truly fits your org.

{{cta_8}}

As your org grows, so does complexity. Port scales your catalog, orchestration, and workflows seamlessly.

{{cta_n8n}}

Port × n8n Boost AI Workflows with Context, Guardrails, and Control

{{port_builders_session}}

Port Builders Session: A Single, Governed Interface for All MCP Servers

{{cta-demo}}
{{read_case}}
{{n8n-template-gallery}}

n8n + Port templates you can use today

walkthrough of ready-to-use workflows you can clone

Template gallery
{{from_manual_to_autonomous_engineering}}

From manual to autonomous engineering

One platform to build, govern, and operate the Agentic SDLC.

Explore Port
{{port_is_open_for_you_to_try_it}}

Port is open for you to try it

build your first agentic workflow today

Sign up
{{reading-box-backstage-vs-port}}
{{cta-backstage-docs-button}}

Starting with Port is simple, fast, and free.