DEV Community

Cover image for I Gave a Coding Agent Memoryβ€”and Let It Learn Which Tools It Needed
MANI BHUSHANAM K
MANI BHUSHANAM K

Posted on

I Gave a Coding Agent Memoryβ€”and Let It Learn Which Tools It Needed

πŸ€” What if a coding agent could actually remember?

AI coding agents are becoming surprisingly capable.
They can write code, inspect repositories, debug errors, interact with tools, and reason through complex development tasks.

But there is still a frustrating limitation:
They forget.
A new session often starts without the useful experience accumulated during previous sessions.
A developer might have already explained:

πŸ” security requirements
πŸ—οΈ architectural constraints
πŸ’Ό customer requirements
πŸ’° commercial conditions
🧠 important project decisions
πŸ› οΈ recurring development patterns

Yet the next session may require the agent to rediscover that context.
That made me ask a different question:

What if an AI coding agent could remember important project knowledge and also learn from repeated patterns in its own interactions?

That question led me to build DIAS β€” Deal Intelligence Agent Skill.

DIAS combines persistent memory, telemetry, reflection, and controlled tool evolution using Hindsight.

The core idea is simple:

🧠 Remember
↓
πŸ‘€ Observe
↓
πŸ”Ž Reflect
↓
πŸ› οΈ Adapt
↓
⚑ Execute
🧩 The Problem: Coding Agents Have Short-Term Context

A coding agent usually works within a session.

Imagine this workflow:

πŸ‘¨β€πŸ’» Developer
↓
πŸ€– Coding Agent
↓
πŸ’» Solve Problem
↓
βœ… Task Completed
↓
πŸ”š Session Ends

The problem appears when the next session begins.

The project still has context, but the agent may not have access to everything it learned previously.

For a real engineering workflow, that can mean repeatedly explaining the same things.

DIAS approaches this by treating useful project information as persistent memory rather than temporary conversation context.

🧠 Two Different Types of Memory

One of the key design decisions in DIAS is separating memory into two dimensions.

1️⃣ dias_deals β€” Domain Memory

dias_deals focuses on information that should remain useful across sessions.

Examples include:

πŸ‘€ customer disclosures
πŸ” security mandates
πŸ’° commercial terms
πŸ—οΈ architectural constraints
πŸ“‹ important domain context

The purpose isn't to remember every conversation.

The purpose is to preserve information that can influence future decisions.

2️⃣ dias_telemetry β€” Developer Interaction Memory

The second memory dimension is:

dias_telemetry

This captures patterns around agent usage and developer interaction.

For example, imagine an agent repeatedly performing relational database queries through a manual workflow.

One occurrence may be completely normal.

But if the same pattern keeps appearing, it may indicate developer friction.

That makes telemetry useful for something beyond logging.

It becomes input for reflection.

🧠 Where Hindsight Fits

DIAS uses Hindsight as the persistent memory and reflection layer.

The architecture can be represented like this:

             πŸ€– Coding Agent
                   β”‚
                   β–Ό
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚   DIAS    β”‚
             β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
                   β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό                 β–Ό
   🧠 dias_deals      πŸ“Š dias_telemetry
   Domain Memory          Telemetry
          β”‚                 β”‚
          β”‚                 β–Ό
          β”‚          πŸ”Ž Hindsight Reflect
          β”‚                 β”‚
          β”‚                 β–Ό
          β”‚        πŸ” Friction Pattern
          β”‚                 β”‚
          β”‚                 β–Ό
          β”‚          πŸ› οΈ Tool Proposal
          β”‚                 β”‚
          β”‚                 β–Ό
          β”‚          πŸ‘€ Human Approval
          β”‚                 β”‚
          β”‚                 β–Ό
          β”‚        🐘 Neon PostgreSQL
          β”‚              MCP
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
Enter fullscreen mode Exit fullscreen mode

This creates an important distinction:

Memory isn't only about retrieving old information.

It can also provide the history needed to identify recurring patterns.

πŸ”Ž From Memory to Reflection

This is where the architecture becomes more interesting.

Traditional memory might answer:

"What happened previously?"

Reflection asks:

"What can we learn from what happened previously?"

DIAS explores that second question.

The conceptual flow is:

πŸ’» Agent Interaction
↓
πŸ“Š Telemetry Captured
↓
🧠 Persistent Memory
↓
πŸ”Ž Reflection
↓
πŸ” Recurring Pattern
↓
πŸ’‘ Potential Improvement

This means previous interactions can become useful signals for future agent behavior.

πŸ—„οΈ Example: Repeated Database Work

Consider a developer working on an application that repeatedly requires relational database operations.

Without persistent telemetry:

πŸ’» Database Task
↓
πŸ”§ Manual Workflow
↓
βœ… Task Completed
↓
πŸ”š Session Ends

The next session can repeat the same workflow.

With DIAS:

πŸ’» Database Task
↓
πŸ“Š Telemetry Recorded
↓
🧠 Pattern Retained
↓
πŸ” Repeated Behavior Detected
↓
πŸ”Ž Hindsight Reflect
↓
πŸ’‘ Friction Identified

Now the system has additional information it can use to reason about the workflow.

πŸ› οΈ From Friction to Tool Evolution

This is where MCP becomes important.

If repeated database interactions suggest that the agent would benefit from a dedicated database capability, DIAS can stage the Neon PostgreSQL MCP server.

But there is an important safety boundary.

The agent should not simply be allowed to install or activate arbitrary capabilities without oversight.

DIAS therefore introduces a human approval step:

πŸ”Ž Detect
↓
🧠 Reflect
↓
πŸ’‘ Propose
↓
πŸ‘€ Human Approval
↓
πŸ› οΈ Activate
↓
⚑ Use

The idea is controlled adaptation, rather than unlimited autonomy.

πŸ”„ Before vs After
❌ Before DIAS
πŸ‘¨β€πŸ’» Developer
↓
πŸ€– Coding Agent
↓
πŸ—„οΈ Repeated Database Work
↓
πŸ”š Session Ends
↓
❌ Experience Lost
↓
πŸ” Next Session Repeats
βœ… With DIAS
πŸ‘¨β€πŸ’» Developer
↓
πŸ€– Coding Agent
↓
πŸ—„οΈ Database Interaction
↓
πŸ“Š Telemetry
↓
🧠 Persistent Memory
↓
πŸ”Ž Hindsight Reflect
↓
πŸ’‘ Friction Identified
↓
πŸ‘€ Human Approval
↓
πŸ› οΈ Neon PostgreSQL MCP

The important change isn't simply:

"The agent remembers more."

It is:

Previous experience can become an input into future decisions.

πŸ’» How the Implementation Works

The DIAS repository contains the implementation of the memory and agent workflow.

🧠 1. Persisting Memory

⚠️ Replace the following placeholder with the actual DIAS code.

INSERT REAL HINDSIGHT RETAIN CODE FROM DIAS REPOSITORY

The important part to demonstrate here is how information is actually persisted into Hindsight.

πŸ”Ž 2. Recalling Memory

⚠️ Replace with the actual DIAS recall implementation.

INSERT REAL HINDSIGHT RECALL CODE FROM DIAS REPOSITORY

This snippet should demonstrate how previously retained information becomes available to the agent.

πŸ“Š 3. Telemetry / Reflection

⚠️ Replace with the actual telemetry or Reflect implementation.

INSERT REAL DIAS TELEMETRY / REFLECT CODE

This is especially important because it demonstrates the bridge between:

πŸ“Š Observation
↓
🧠 Memory
↓
πŸ”Ž Reflection
↓
πŸ› οΈ Adaptation

The submission guide specifically asks for 2–4 small real code snippets, so these should be taken directly from the actual repository rather than invented examples.

πŸ‘€ Human-in-the-Loop Safety

Adaptive systems create another important question:

If an agent identifies a tool it needs, should it activate that tool automatically?

DIAS keeps a human approval boundary.

That gives the workflow an explicit control point:

πŸ€– Agent observes
↓
πŸ”Ž System reflects
↓
πŸ’‘ Potential capability identified
↓
πŸ‘€ Human reviews
↓
πŸ› οΈ Capability activated

This makes the architecture more controlled.

The objective isn't to give an agent unlimited autonomy.

It is to allow the agent to identify potential improvements while keeping humans in the loop for capability changes.

πŸ“Έ Screenshots to Add

The submission guide asks for screenshots or images that show the system in action.

Add these underneath the relevant sections:

πŸ“Έ Screenshot 1 β€” DIAS Architecture

Show:

Agent β†’ DIAS β†’ Hindsight β†’ Reflection β†’ MCP
πŸ“Έ Screenshot 2 β€” Memory

Show the Hindsight memory/recall workflow.

πŸ“Έ Screenshot 3 β€” Telemetry

Show dias_telemetry or the relevant telemetry workflow.

πŸ“Έ Screenshot 4 β€” Tool Evolution

Show the Neon PostgreSQL MCP activation / approval flow if available.

πŸ“š What I Learned
1️⃣ Persistent memory should be selective

An agent doesn't need to remember everything.

It needs to remember information that has future value.

2️⃣ Domain memory and telemetry are different

Project knowledge answers:

"What should the agent know?"

Telemetry answers:

"What patterns are emerging?"

Separating them makes the architecture easier to reason about.

3️⃣ Reflection is different from retrieval

Retrieval asks:

"What happened before?"

Reflection asks:

"What pattern can we learn from what happened before?"

That distinction is central to DIAS.

4️⃣ Tool evolution needs boundaries

Giving an agent more tools is relatively easy.

Giving it a controlled mechanism for recognizing when another tool may be useful is a different problem.

That is why the human approval boundary matters.

5️⃣ The goal isn't memory itself

The real goal isn't:

"Make the agent remember everything."

It is:

"Make previous experience useful."

⚠️ Limitations

DIAS is an exploration of this architecture, not a claim that persistent memory solves every problem with coding agents.

There are still important engineering questions around:

🧠 deciding what information is worth retaining
🧹 avoiding irrelevant memories
πŸ”„ handling outdated information
πŸ“ measuring whether reflection improves outcomes
πŸ”Ž determining when repeated behavior actually represents friction
πŸ› οΈ deciding which tool should be proposed
πŸ‘€ maintaining appropriate human approval boundaries

Adding memory doesn't automatically solve these problems.

It creates another layer that the agent can use to reason about its previous experience.

🎯 Conclusion

The most interesting property of an AI coding agent may not be how much context it can process in one session.

It may be whether useful experience from previous sessions can change what happens next.

That's the idea explored with DIAS.

The architecture can be summarized as:

🧠 Remember
↓
πŸ‘€ Observe
↓
πŸ”Ž Reflect
↓
πŸ› οΈ Adapt
↓
⚑ Execute

Hindsight provides the persistent memory and reflection foundation.

DIAS uses that foundation to explore an agent that can:

🧠 retain domain context
πŸ“Š observe interaction patterns
πŸ”Ž identify recurring friction
πŸ’‘ propose capability changes
πŸ‘€ keep humans in the approval loop

The goal isn't an agent that remembers everything.

It's an agent that remembers what matters. πŸš€

πŸ”— Resources
πŸ’» DIAS GitHub

https://github.com/Manibhushanamk/DEAL-INTELLIGENCE-AGENT-SKILL-DIAS-

🧠 Hindsight GitHub

https://github.com/vectorize-io/hindsight

πŸ“š Hindsight Documentation

https://hindsight.vectorize.io/

πŸ”Ž Vectorize Agent Memory

https://vectorize.io/what-is-agent-memory

Top comments (0)