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

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:
| Layer | Tool | Job |
|---|---|---|
| API | FastAPI | Memory CRUD, semantic search, reinforcement and association endpoints, with authentication, rate limiting and tenant isolation |
| Encoders | OpenCLIP ViT-H-14, ImageBind and Whisper medium | CLIP embeds text and images; ImageBind embeds audio and video; Whisper transcribes audio tracks |
| Vector search | Qdrant | Similarity search across all modalities |
| Associations | PostgreSQL with Apache AGE | A graph of links between related memories |
| Files | MinIO | S3-compatible storage for the original media, isolated per tenant |
| Background jobs | Redis and Celery | Ingestion 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
Related
LLM Fine-tuning · · 6 min read
STEM reasoning LLMs: fine-tuning Qwen3-14B and gpt-oss-20b with Unsloth
How I fine-tuned Qwen3-14B and gpt-oss-20b with Unsloth and QLoRA for STEM Q&A, then shipped LoRA, merged and GGUF builds for Ollama and llama.cpp.
Computer Vision · · 2 min read
Weld cross-section measurement with AI: 10‑20 seams in about a second
How I built AI that measures weld cross-sections from micrographs: segmentation, keypoints and automatic measurements, with inspection time down about 80%.
Generative AI · · 7 min read
Kiffusion and SpaceVision: a FLUX LoRA training dataset and space LoRAs
How I built a FLUX LoRA training dataset of 1,964 space images, captioned with JoyCaption, and trained LoRAs for FLUX.2-klein (9B) and Kolors.
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.