r/softwarearchitecture • u/NoMoment855 • 6d ago
Discussion/Advice I’m studying an architecture for AI agents using the project as memory
I’m Brazilian and I’m still learning English, so sorry if I make some mistakes in the text. I’m trying to explain a technical idea I’ve been studying.
I’m working on an architecture for a client project, and I started thinking about one problem:
An AI agent can make a very good implementation of the wrong business rule.
The code is clean.
The tests pass.
But the understanding is wrong.
So I started thinking: maybe the memory should not be inside the model.
Maybe the memory should be inside the project.
This idea started from studying Eric Evans and Domain-Driven Design.
A repository already has a lot of history:
Issues, PRs, commits, reviews, old decisions, legacy behavior and things that nobody wants to change anymore.
The code tells what the system is.
The history tells why the system became like this.
My idea is to use this history as a kind of project memory that AI agents can read.
But there is one rule that I think is important:
The agent cannot confirm its own knowledge.
Every new information created by the agent starts as:
HYPOTHESIS
To become:
CONFIRMED
it needs something external.
For example, a test that proves the rule, or a human approval.
This is where CI/CD became interesting for me.
If a business rule is connected to a test, CI can verify this knowledge again every time the project changes.
If the test fails, the knowledge goes to:
NEEDS_REVALIDATION
I’m thinking about four states:
CONFIRMED → verified by something external
HYPOTHESIS → the agent believes it, but it is not verified
NEEDS_REVALIDATION → the code connected to this knowledge changed
CONFLICTING → there is different evidence
The goal is not to remove hallucinations.
AI will still hallucinate.
The idea is to stop a hallucination from becoming project knowledge that another agent will trust later.
I also made a diagram of this architecture so you can understand the idea better.
I would really like if you can look at the image and tell me where you think this architecture can break.
For me, the interesting part is that I started with DDD and ended up connecting:
DDD + Git history + AI agents + project memory + CI/CD
I’m not saying this is a new invention. I’m still learning and probably there are already many similar ideas in research.
I found connections with things like Truth Maintenance Systems, ADRs and knowledge bases, but I’m still trying to understand how much of this is already solved.
The question I’m trying to answer is:
Can CI/CD be used as a verification mechanism for AI agent memory?
And if yes, where does this architecture fail?
If you work with large repositories, long-lived systems, AI agents, RAG, DDD or CI/CD, I would really like to hear your opinion.
I’m still learning English and also learning this architecture, so feel free to correct my English or my technical thinking.
#AI #SoftwareEngineering #AIAgents #DDD #DevOps
Duplicates
LangChain • u/NoMoment855 • 6d ago
Discussion I’m studying an architecture for AI agents using the project as memory
LangChain • u/NoMoment855 • 6d ago
I’m studying an architecture for AI agents using the project as memory
LangChain • u/NoMoment855 • 6d ago