Inspiration

Most AI agents can make decisions and use tools, but they often treat every task as a new problem. We wanted to explore a different question:

What if an AI agent could learn from the consequences of its own actions?

That idea inspired Afterimage Ops.

The name comes from the concept of an afterimage: something that remains after the original event has disappeared. In our system, every agent action leaves behind an afterimage containing what the agent expected, what actually happened, and what it learned from the difference.

We were inspired by real operational systems where a small mistake can repeat over and over because the system doesn't retain the causal lesson behind it.

Our goal was to build an agent that doesn't simply remember information — it remembers the consequences of its decisions and uses those experiences to change future behavior.


What it does

Afterimage Ops is a self-improving autonomous operations agent.

Instead of following a fixed workflow, the agent continuously operates through a closed feedback loop:

Predict → Act → Observe → Compare → Learn → Adapt

Before performing an action, the agent creates an Action Afterimage containing its expected outcome.

After the action executes, the system records the real outcome and calculates the prediction gap.

The agent then analyzes the gap and creates a structured Learning Note explaining what went wrong and what should change.

That learning is stored as causal memory.

When a similar situation occurs later, the agent retrieves the relevant experience and uses it to modify its next decision.

The key difference

The system doesn't just say:

"I remember this happened before."

It says:

"This happened before, it caused this outcome, therefore I should change my action now."

This creates a measurable learning loop:

$$ Experience \rightarrow Causal\ Memory \rightarrow Decision\ Change \rightarrow Better\ Outcome $$

The dashboard makes this visible by showing the agent's prediction, action, actual outcome, prediction gap, learned insight, and subsequent decision.


How we built it

We built Afterimage Ops as a full-stack agentic system.

AI & Agent Layer

We use Gemini as the reasoning engine and the Google Agent Development Kit (ADK) to orchestrate the agent's workflow and tool usage.

The agent can:

  • Understand the operational objective
  • Evaluate available actions
  • Generate an Action Afterimage
  • Execute an action through tools
  • Observe the resulting state
  • Compare prediction vs. reality
  • Identify significant deviations
  • Generate causal learning
  • Retrieve previous experiences
  • Adapt its next decision

Memory Layer

We use Google Cloud Firestore as persistent memory.

Instead of storing only conversations, we store structured operational experiences:

  • Predictions
  • Actions
  • Actual outcomes
  • Prediction gaps
  • Causes
  • Learning notes
  • Scenario context
  • Decision changes

This allows the agent to build an experience history over time.

Simulation Environment

We created a controlled operational simulator so the agent can encounter repeatable scenarios.

This was important because we wanted to demonstrate learning rather than simply claim it.

For example:

First execution

The agent predicts that an action will succeed.

The environment produces an unexpected failure.

The agent analyzes the failure and stores the causal lesson.

Second execution

A similar situation occurs.

The agent retrieves the previous lesson, changes its decision, and produces a better outcome.

Application

The frontend was built using React + TypeScript, while the backend uses Python/FastAPI.

The system is designed around Google Cloud services and can be deployed using Cloud Run.


Challenges we ran into

Making "learning" real

The biggest challenge was avoiding a fake learning experience where the agent simply displays a different answer the second time.

We solved this by explicitly tracking:

$$ Prediction \neq Actual $$

and converting meaningful prediction errors into persistent learning records.

The subsequent decision must consume that memory.

Connecting memory to behavior

Storing information is easy.

Making stored information change an autonomous decision is much harder.

We designed the agent pipeline so relevant causal memories are retrieved during decision-making and incorporated into the evaluation of possible actions.

Making the demonstration deterministic

Real-world operational environments are unpredictable.

For a hackathon demonstration, however, we needed a scenario that could reliably reproduce the same initial failure.

We therefore built a controlled simulation environment that lets us demonstrate:

Mistake → Learning → Adaptation → Improvement

consistently.

Making an autonomous system understandable

Agentic systems can become difficult to understand when decisions happen behind the scenes.

We addressed this by creating a visual timeline showing exactly how the agent moves through:

Prediction → Action → Outcome → Gap → Learning → Adaptation

This makes the agent's behavior observable instead of hiding it behind a chatbot interface.


Accomplishments that we're proud of

Our biggest accomplishment is that we moved beyond the typical "AI agent + tools" architecture.

Afterimage Ops creates a persistent feedback loop around the agent's own actions.

We are particularly proud of four things:

  1. The agent can recognize its own prediction errors.

It doesn't just execute an action; it evaluates whether its expectations matched reality.

  1. Failures become structured experience.

A failure isn't discarded after the task ends. It becomes causal memory that can influence future decisions.

  1. Memory produces observable behavioral change.

The strongest proof of our concept is not a memory displayed on screen — it is a different decision on the next run.

  1. The complete learning loop is visible.

Judges can follow the entire lifecycle of an agent decision instead of seeing only the final answer.

Our core achievement can be summarized as:

$$ \boxed{ \text{Act} \rightarrow \text{Learn from Consequences} \rightarrow \text{Change Future Behavior} } $$

What we learned

We learned that agentic AI is not just about autonomy; it is about adaptation.

A tool-using agent can perform tasks.

A persistent agent can remember information.

But an adaptive agent should be able to answer:

"What did I learn from what happened last time, and how should that change what I do now?"**

We also learned that memory is most valuable when it is connected to:

Context + Action + Outcome + Cause + Future Decision

rather than simply storing a conversation history.

Most importantly, we learned that a good agentic system should have an observable feedback loop.

Instead of evaluating an agent only by whether it completed a task, we can evaluate whether:

$$ \text{Prediction Error}{t+1} < \text{Prediction Error}{t} $$

That gives us a concrete way to measure whether the agent is actually improving.

What's next for Afterimage Ops

The current prototype demonstrates the concept in a controlled operational environment.

Our next step is to move from simulated experience to real-world operational environments.

We envision Afterimage Ops becoming a general-purpose self-improving operations layer that can work across domains such as:

  • Cloud infrastructure
  • DevOps
  • Supply chains
  • Fleet operations
  • Cybersecurity
  • Enterprise workflows
  • Resource optimization

We also want to introduce richer causal reasoning, allowing the agent to distinguish between:

correlation → contributing factor → root cause → recommended intervention.

Future versions could maintain different experience memories for different environments and continuously measure whether learned policies actually improve long-term outcomes.

Our ultimate vision is simple:

Don't build agents that merely remember what they did. Build agents that remember what happened because they did it.

Every action leaves an afterimage.

Afterimage Ops turns those afterimages into experience — and experience into better decisions.

Built With

  • adk
  • agents
  • autonomous
  • causal
  • cloud
  • decision
  • fastapi
  • firestore
  • gemini
  • generative
  • intelligence
  • learning
  • logistics
  • machine
  • memory
  • predictive
  • python
  • react
  • run
  • typescript
Share this project:

Updates

Submission history