Skip to content
Roshil Shrestha
All projects

Proof of concept

Persistent Cross-Session Memory for AI Agents

Gives Google ADK agents a PostgreSQL-backed memory, so they recall past sessions, preferences and instructions.

LLMs & agentsGraph ML & knowledge graphs

Overview

A proof of concept that connects PostgreSQL to Google ADK's session framework, turning stateless chatbots into assistants that remember past interactions, user preferences and instructions across sessions.

The problem

Most agents forget everything when a session ends, so users repeat themselves and answers lose context. The goal was persistent, queryable memory that stays isolated per user and project, and a way to show that it actually works.

What I did

  • Integrated PostgreSQL with Google ADK's session framework for persistent, queryable memory.
  • Built evaluation datasets and sample conversations to test reasoning and memory retention.
  • Built a mock Demand Forecasting Agent to simulate realistic multi-session use.
  • Tested the memory system for robustness and long-term consistency.

How it works

  • Evaluation questions covering temporal reasoning, open-domain knowledge, adversarial cases, and multi-hop and single-hop QA.
  • Session isolation by UserID, Engine Name and Project Name.
  • Knowledge graph creation in Neo4j, tested with and without an ontology.
  • Retrieval of past interactions demonstrated in realistic forecasting-agent sessions.

Outcome

  • Agents that give personalised, consistent, context-aware answers across sessions.