Skip to content

Case Studies · Multi-Modal AI · · Updated

AI Memory: multimodal semantic search for AI agents

By Khadim Hussain · 1 min read

In short

A self-hosted memory service for AI agents. Text and images use CLIP embeddings; audio and video use ImageBind embeddings with Whisper transcripts. Qdrant stores the vectors, and a PostgreSQL graph links related memories.

MIT

open source

  • Python
  • FastAPI
  • Qdrant
  • CLIP
  • ImageBind
  • Whisper
  • PostgreSQL
  • Apache AGE
  • Redis
  • Celery
  • MinIO
  • Docker
  • CUDA
AI Memory API docs: the memory and semantic search endpoints
Contents

The problem

AI agents lose context between sessions, and most memory layers only handle text. An agent that has seen a diagram, a voice note or a screen recording has no way to find it again by meaning.

How it works

The system is a set of small services behind one REST API:

LayerToolJob
APIFastAPIMemory CRUD, semantic search, reinforcement and association endpoints, with authentication, rate limiting and tenant isolation
EncodersOpenCLIP ViT-H-14, ImageBind and Whisper mediumCLIP embeds text and images; ImageBind embeds audio and video; Whisper transcribes audio tracks
Vector searchQdrantSimilarity search across all modalities
AssociationsPostgreSQL with Apache AGEA graph of links between related memories
FilesMinIOS3-compatible storage for the original media, isolated per tenant
Background jobsRedis and CeleryIngestion and batch encoding off the request path

Text and images share CLIP's embedding space, so a text query can retrieve images by meaning. Audio and video use a separate ImageBind model. Although both models produce 1,024-dimensional vectors, the code does not align their coordinate systems, so I would not claim reliable text-to-audio or text-to-video retrieval from this implementation without a measured test.

Memory that fades

Stored memories follow a lifecycle modeled on how people remember. Each memory decays along an Ebbinghaus forgetting curve, gets reinforced when an agent retrieves it, and moves from short-term to long-term storage once it has been reinforced enough. Agents keep what they use and lose what they never touch.

Where this fits

The service is meant as self-hosted infrastructure for RAG over mixed media: support bots that need screenshots and call recordings, research assistants over papers and talks, or any agent that should remember what it was shown.

Next

Want a second pair of eyes on this?

Book a 15-minute intro call. Bring the problem, and you leave with a concrete next step.