6

Side Project

Context-Aware AI Support Agent

A proof-of-concept support agent that remembers users across sessions using Qdrant vector database, OpenAI, andStreamlit.

Context-Aware AI Support Agent
Date: May 2026 - May 2026
Project Types:#Personal#Web
Tech Stacks:#Python#OpenAI#Docker

An exploratory project studying how to implement persistent long-term memory in LLM applications. This proof-of-concept integrates Streamlit, OpenAI, and Mem0 (backed by Qdrant) to demonstrate how an agent can remember past interactions and user preferences across multiple sessions.

Note: The application serves as a flexible harness for testing memory architectures. While currently configured with a Nike customer support persona for demonstration purposes, the domain and instructions can be easily swapped out.

Body Image

How it works

  1. User enters their unique ID and types a message in the Streamlit UI.
  2. The agent queries Qdrant via Mem0 to fetch relevant past context for that specific user.
  3. OpenAI's gpt-4o (configurable) generates a response based on the system prompt, user query, and retrieved memory context.
  4. The new query and response are saved back to Qdrant to update the user's persistent memory.

Interesting bits

  • Memory persistence - Uses `Mem0` on top of a local `Qdrant` vector database. If a user mentions a specific preference in one session, the agent remembers it in the next.
  • API compatibility bypass - Mem0's default OpenAI LLM integration forces `max_tokens` which is deprecated for newer models and causes 400 errors. The code injects a custom LLM config with `max_tokens=None` to bypass this issue without waiting for upstream fixes.
  • Separation of concerns - Clean split between UI (`Streamlit`), Data (`MemoryService`), and Logic (`CustomerSupportAgent`).
  • Session management - Streamlit state automatically clears the chat history if a different User ID is entered in the sidebar to prevent context leaking.