Intermediate · 30 min
AI Agents & MCP: Give Your Agents Persistent Multimodal Memory
Build AI agents with durable memory and tool calling using Pixeltable. Store conversations, images, and documents as queryable tables, give a Pydantic AI agent read access and a memory table, and call MCP server tools from a computed column.
The Challenge
AI agents lose context between sessions, struggle with multimodal data, and have no durable memory. Building tool-calling agents requires wiring together separate systems for memory, retrieval, and data storage.
The Solution
Pixeltable serves as the persistent memory and data layer for AI agents. Tables store conversations, media, and structured data, and computed columns run embeddings and AI inference on insert. Through pydantic-ai-harness, a Pydantic AI agent gets read-only tools over the tables you allowlist and keeps its notes in a Pixeltable table. Pixeltable is also an MCP client: pxt.mcp_udfs() turns an MCP server's tools into functions an LLM column can call. It has no API that turns your own tables into an MCP server; its own MCP servers are for coding agents.
Implementation Guide
Step-by-step walkthrough with code examples
Agent Memory Table
Create a persistent memory store for agent conversations and context.
1import pixeltable as pxt2from pixeltable.functions.huggingface import sentence_transformer34pxt.create_dir('app', if_exists='ignore')56# Persistent agent memory7memory = pxt.create_table('app.agent_memory', {8 'session_id': pxt.String,9 'role': pxt.String, # 'user', 'assistant', 'tool'10 'content': pxt.String,11 'timestamp': pxt.Timestamp,12 'metadata': pxt.Json,13}, if_exists='ignore')1415# Semantic search over memory; the index updates on every insert16memory.add_embedding_index(17 'content',18 embedding=sentence_transformer.using(19 model_id='sentence-transformers/all-MiniLM-L6-v2'20 ),21 if_exists='ignore',22)2324# Agents can now search their own history25sim = memory.content.similarity(string='what did we discuss about pricing?')26relevant = (27 memory.order_by(sim, asc=False)28 .select(memory.content, memory.role, memory.session_id)29 .limit(10)30 .collect()31)
Key Benefits
Real Applications
Prerequisites
How-to guides
Learn More
The pydantic-ai-harness Pixeltable capability, wired up step by step
pxt.tools(), invoke_tools() and pxt.mcp_udfs() in a notebook
Persistent, searchable agent memory in a notebook
Official MCP specification
Related Guides
- Video Intelligence Pipeline: Extract, Enrich, and Search Video at Scale
Modality: Video
Computed column: frame_iterator view, then model columns on each frame
Docs - Build a Video Search Engine in Python
Modality: Video
Computed column: frame_iterator view, CLIP EmbeddingIndex, FastAPIRouter /search
Docs - Production RAG: From Documents to Answers in One System
Modality: Document
Computed column: Chunk view plus an embedding index
Docs
Ready to get started?
Install Pixeltable and start building in minutes. One Python file for tables, indexes, and HTTP.