{"id":33786,"date":"2026-06-10T08:53:53","date_gmt":"2026-06-10T15:53:53","guid":{"rendered":"https:\/\/www.pingcap.com\/?p=33786"},"modified":"2026-06-11T08:54:08","modified_gmt":"2026-06-11T15:54:08","slug":"agent-memory-database-tidb","status":"publish","type":"post","link":"https:\/\/www.pingcap.com\/ko\/blog\/agent-memory-database-tidb\/","title":{"rendered":"Build Persistent, Scalable AI Agent Memory with TiDB"},"content":{"rendered":"<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Key_Takeaways\"><\/span><strong>Key Takeaways<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Agent memory is an infrastructure pattern, not a model feature: Store the past outside the model and inject the relevant slice into each prompt.<\/li>\n\n\n\n<li>Every memory system reduces to one loop: Store a row, embed it, search for the nearest vectors, and inject the matches.<\/li>\n\n\n\n<li>TiDB holds text, vectors, and metadata in a single table, so filtering and vector (or hybrid BM25) search run in one query with no separate vector store to sync.<\/li>\n\n\n\n<li>You can build the whole loop on the free tier of TiDB Cloud Starter, with the full SQL and pytidb code in the <a href=\"https:\/\/github.com\/pingcap\/agent-rules\">pingcap\/agent-rules repo<\/a>.<\/li>\n<\/ul>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">I gave a session at Microsoft Build 2026 on agent memory with TiDB. A few people asked for the code afterward, so here&#8217;s a complete write up of the session: The same pattern as the talk, with copy-paste-ready schema and queries.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can watch the original Microsoft Build 2026 session <a href=\"https:\/\/www.youtube.com\/watch?v=J0o-Dkt5tnI\">\uc5ec\uae30<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_an_Agent_Memory_Database_is_an_Infrastructure_Problem\"><\/span>Why an Agent Memory Database is an Infrastructure Problem<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Large language models are stateless. Every API call starts from scratch. Whatever a user told the agent yesterday, their preferences, their last support ticket, the back-and-forth that finally landed on the right answer, all of it is gone the moment the response finishes streaming.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Memory is how you close that gap. It is not a model feature, it is an infrastructure pattern. You store the past somewhere outside the model, and on each new turn you pull back the relevant slice and inject it into the prompt. The agent looks like it remembers because you remembered for it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The real engineering question is where you put that memory, and how you find the right piece of it fast.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Four-Step_Memory_Loop\"><\/span>The Four-Step Memory Loop<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Strip away the framework noise and every agent memory system reduces to the same loop:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Store each thing worth remembering as a row in a table.<\/li>\n\n\n\n<li>Embed the row&#8217;s text into a vector that captures its meaning.<\/li>\n\n\n\n<li>Search for the rows whose vectors are closest to the current query. Those are your relevant memories.<\/li>\n\n\n\n<li>Inject those memories into the next LLM prompt.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Summarization, fact extraction, and decay scoring all sit on top of this loop. Get the loop right first.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Your_Agent_Memory_Database_in_One_Table\"><\/span>Your Agent Memory Database in One Table<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A memory row needs to do three things at once: Hold the text, hold a vector representation of that text, and hold the metadata that tells you whose memory it is and when it was created. TiDB&#8217;s <a href=\"https:\/\/docs.pingcap.com\/tidbcloud\/vector-search-overview\/\">built-in vector search<\/a> lets all three live in a single table:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE memories (\n  id BIGINT PRIMARY KEY AUTO_RANDOM,\n  user_id VARCHAR(64) NOT NULL,\n  content TEXT NOT NULL,\n  embedding VECTOR(1024),\n  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n  INDEX idx_user (user_id),\n  VECTOR INDEX idx_embedding ((VEC_COSINE_DISTANCE(embedding)))\n);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A few details worth calling out:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>VECTOR(1024)<\/code> is a native column type. No extension, no separate vector store running alongside your database, no sync job between them.<\/li>\n\n\n\n<li>The <code>VECTOR INDEX ... VEC_COSINE_DISTANCE<\/code> line builds an <a href=\"https:\/\/docs.pingcap.com\/tidbcloud\/vector-search-index\/\">HNSW vector index<\/a>, which keeps nearest-neighbor lookups fast as the table grows.<\/li>\n\n\n\n<li><code>AUTO_RANDOM<\/code> instead of <code>AUTO_INCREMENT<\/code> matters more than people coming from single-node MySQL expect. Sequential integer keys create write hotspots on a distributed system because every insert lands on the same node. Random keys spread inserts across the cluster.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Storing_a_Memory\"><\/span>Storing a Memory<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you already have an embedding pipeline, pass the vector in:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>INSERT INTO memories (user_id, content, embedding)\nVALUES (\n  'user_42',\n  'User prefers window seats on flights longer than 4 hours.',\n  '&#91;0.0123, -0.0456, ..., 0.0789]'\n);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you would rather not run your own embedding pipeline, TiDB Cloud can generate vectors for you on insert. Define the embedding column as a generated column that calls a hosted model:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ALTER TABLE memories\nMODIFY embedding VECTOR(1024) GENERATED ALWAYS AS (\n  EMBED_TEXT('tidbcloud_free\/amazon\/titan-embed-text-v2', content)\n) STORED;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After that, you insert text and the database produces and stores the vector:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>INSERT INTO memories (user_id, content)\nVALUES ('user_42', 'User prefers window seats on long flights.');<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">One less moving part to maintain. In my Build session I used OpenAI embeddings; here I switched to the Titan model because TiDB Cloud hosts it for free, so everything in this post runs with no API keys and no credit card. If you prefer OpenAI, Cohere, or Jina embeddings, swap in that model name and bring your own key.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Recalling_Memories_with_Vector_Search\"><\/span>Recalling Memories with Vector Search<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When the agent receives a new message, embed the message and ask the database which stored memories mean something similar:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT\n  id,\n  content,\n  VEC_COSINE_DISTANCE(\n    embedding,\n    EMBED_TEXT('tidbcloud_free\/amazon\/titan-embed-text-v2',\n               'Where should I book his seat?')\n  ) AS distance\nFROM memories\nWHERE user_id = 'user_42'\nORDER BY distance\nLIMIT 5;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The query about booking a seat returns &#8220;User prefers window seats&#8221; even though the two sentences share almost no words. That is the embedding doing its job: It matches on meaning, not on exact text.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two things make this query nice in TiDB specifically. First, the <code>WHERE user_id = 'user_42'<\/code> filter runs in the same query as the vector search. There is no two-system dance, no joining results back together in application code. One round trip. Second, your source-of-truth memory write and your retrieval logic live in the same transactional database, which keeps the application model much simpler than syncing a separate vector system.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Hybrid_Search_for_When_Meaning_is_Not_Enough\"><\/span>Hybrid Search for When Meaning is Not Enough<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Pure vector search is strong at concepts and weak at proper nouns. A query like &#8220;the issue with order #A-9912&#8221; will often surface memories about other orders that feel conceptually close but are not the right record. That is where keyword search earns its place. TiDB has BM25 full-text search built in, so you can blend both signals in a single <a href=\"https:\/\/docs.pingcap.com\/tidbcloud\/vector-search-hybrid-search\/\">hybrid search<\/a> query:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE FULLTEXT INDEX idx_content ON memories(content);\n\nSELECT\n  id,\n  content,\n  (0.7 * VEC_COSINE_DISTANCE(\n      embedding,\n      EMBED_TEXT('tidbcloud_free\/amazon\/titan-embed-text-v2', :query))\n   - 0.3 * fts_match_score('idx_content', :query)) AS hybrid_score\nFROM memories\nWHERE user_id = :user_id\nORDER BY hybrid_score\nLIMIT 5;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The 0.7 and 0.3 are weights you tune for your workload. One gotcha worth flagging: Vector distance is lower-is-better, but BM25 relevance is higher-is-better, which is why the formula subtracts the full-text score instead of adding it. In production RAG, this hybrid setup almost always beats either approach on its own, and you pay for it with one extra index.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Agent_Memory_Loop_in_Python_with_pytidb\"><\/span>The Agent Memory Loop in Python with pytidb<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Most AI developers I work with live in Python, not SQL. The pytidb SDK wraps the same primitives, and with auto-embedding turned on you never touch a vector directly. Insert text. Query with text. The library handles the rest.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from pytidb import TiDBClient\nfrom pytidb.embeddings import EmbeddingFunction\nfrom pytidb.schema import TableModel, Field\nfrom pytidb.datatype import TEXT\n\ndb = TiDBClient.connect(\n    database_url=\"mysql+pymysql:\/\/USER:PASS@HOST:4000\/test\"\n    \"?ssl_verify_cert=true&amp;ssl_verify_identity=true\"\n)\n\n# Auto-embedding: the embedding column is derived from `content`\n# server-side.\nembed = EmbeddingFunction(model_name=\"tidbcloud_free\/amazon\/titan-embed-text-v2\")\n\nclass Memory(TableModel):\n    id: int = Field(primary_key=True)\n    user_id: str\n    content: str = Field(sa_type=TEXT)\n    embedding: list&#91;float] = embed.VectorField(source_field=\"content\")\n\nmemories = db.create_table(schema=Memory, if_exists=\"overwrite\")\n\n# Store. No vector math here; embeddings are generated automatically.\nmemories.bulk_insert(&#91;\n    Memory(user_id=\"user_42\",\n           content=\"User prefers window seats on long flights.\"),\n    Memory(user_id=\"user_42\",\n           content=\"User flies United and Delta only.\"),\n])\n\n# Recall. Pass plain text; pytidb embeds the query and ranks by\n# cosine distance.\nresults = (\n    memories.search(\"Where should I book his seat?\")\n    .filter({\"user_id\": \"user_42\"})\n    .limit(5)\n    .to_list()\n)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Three lines to insert a memory, four to retrieve the relevant ones. That is the entire loop.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_an_Agent_Memory_Database_Not_a_Dedicated_Vector_Store\"><\/span>Why an Agent Memory Database, Not a Dedicated Vector Store<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can build this on a dedicated vector database, with Postgres for user profiles, S3 for transcripts, and Redis for session state. Many teams start there. When memory lives in the same engine as the rest of your agent&#8217;s state, a few things change:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Filtering, sorting, and vector search run in one query plan. <code>WHERE user_id = ... AND created_at &gt; ... ORDER BY<\/code> executes as a single statement. No application-layer joins between systems.<\/li>\n\n\n\n<li>You get ACID transactions across the whole agent&#8217;s state. When the agent writes a new memory, deducts a credit, and logs an event, all three commit together or none of them do. The alternative is debugging partial writes after the fact.<\/li>\n\n\n\n<li>You have one copy of the data. Embeddings live next to the source text. When you change embedding models, you re-embed in place. No sync pipeline drifting out of date.<\/li>\n\n\n\n<li>You get multi-tenancy at real scale. Each user or agent session can have an isolated branch of the database, created in milliseconds with copy-on-write storage. <a href=\"https:\/\/www.pingcap.com\/ko\/case-study\/manus-agentic-ai-database-tidb\/\">Manus<\/a> runs this pattern in production, creating close to 1 million database tenants within three months on its agent platform.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Agent_Memory_Database_Where_to_Go_Next\"><\/span>Agent Memory Database: Where to Go Next<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Everything in this post runs on the free tier of <a href=\"https:\/\/www.pingcap.com\/ko\/tidb\/cloud\/\">TiDB Cloud \uc2a4\ud0c0\ud130<\/a>. You can build the entire memory loop, schema, auto-embedding, vector search, and hybrid retrieval without entering a credit card. The same primitives scale up to production workloads: Pinterest runs 1.5 PB of data at a peak of 8 million QPS on TiDB, and Flipkart benchmarked TiDB as a hot store to 1 million QPS. For metadata-heavy consolidation, Atlassian collapsed 750 PostgreSQL clusters down to 16 on TiDB.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you would rather not hand-roll the memory layer, the open-source <a href=\"https:\/\/mem9.ai\/\">mem9<\/a> project sits on top of these same TiDB primitives and provides a memory API with fact extraction, deduping, and decay built in. Same storage underneath, with the memory semantics handled for you.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The full code from this post, including the Python version using the pytidb SDK, is in the <a href=\"https:\/\/github.com\/pingcap\/agent-rules\">pingcap\/agent-rules<\/a> repository. Clone it, point it at a free TiDB Cloud Starter cluster, and you have a working agent memory loop in a few minutes.<\/p>","protected":false},"excerpt":{"rendered":"<p>I gave a session at Microsoft Build 2026 on agent memory with TiDB. A few people asked for the code afterward, so here&#8217;s a complete write up of the session: The same pattern as the talk, with copy-paste-ready schema and queries. You can watch the original Microsoft Build 2026 session here. Why an Agent Memory [&hellip;]<\/p>\n","protected":false},"author":349,"featured_media":33793,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[193],"tags":[483,476,501,111,297],"class_list":["post-33786","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-conference","tag-ai-agents","tag-ai-memory","tag-python","tag-tidb","tag-vector-search"],"acf":[],"featured_image_src":"https:\/\/static.pingcap.com\/files\/2026\/06\/11084341\/Blog-Feature-1.png","author_info":{"display_name":"Ravish Patel","author_link":"https:\/\/www.pingcap.com\/ko\/blog\/author\/rpatel\/"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Agent Memory Database: Build It on TiDB with SQL and Python<\/title>\n<meta name=\"description\" content=\"Build an agent memory database on TiDB: one table for text, vectors, and metadata, plus copy-paste SQL and hybrid search.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/agent-memory-database-tidb\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Agent Memory Database: Build It on TiDB with SQL and Python\" \/>\n<meta property=\"og:description\" content=\"Build an agent memory database on TiDB: one table for text, vectors, and metadata, plus copy-paste SQL and hybrid search.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/blog\/agent-memory-database-tidb\/\" \/>\n<meta property=\"og:site_name\" content=\"TiDB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/pingcap2015\" \/>\n<meta property=\"article:published_time\" content=\"2026-06-10T15:53:53+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-11T15:54:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/static.pingcap.com\/files\/2026\/06\/11084406\/Copy-of-Blog-LinkedIn-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"627\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Ravish Patel\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/static.pingcap.com\/files\/2026\/06\/11084427\/Blog-Twitter-Banner-2.png\" \/>\n<meta name=\"twitter:creator\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:site\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ravish Patel\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"8\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/blog\\\/agent-memory-database-tidb\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/blog\\\/agent-memory-database-tidb\\\/\"},\"author\":{\"name\":\"Ravish Patel\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/#\\\/schema\\\/person\\\/6925e06cd94a59f1a63d82225785707f\"},\"headline\":\"Build Persistent, Scalable AI Agent Memory with TiDB\",\"datePublished\":\"2026-06-10T15:53:53+00:00\",\"dateModified\":\"2026-06-11T15:54:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/blog\\\/agent-memory-database-tidb\\\/\"},\"wordCount\":1304,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/blog\\\/agent-memory-database-tidb\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/static.pingcap.com\\\/files\\\/2026\\\/06\\\/11084341\\\/Blog-Feature-1.png\",\"keywords\":[\"AI Agents\",\"AI Memory\",\"Python\",\"TiDB\",\"Vector Search\"],\"articleSection\":[\"Conference\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/blog\\\/agent-memory-database-tidb\\\/\",\"url\":\"https:\\\/\\\/www.pingcap.com\\\/blog\\\/agent-memory-database-tidb\\\/\",\"name\":\"Agent Memory Database: Build It on TiDB with SQL and Python\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/blog\\\/agent-memory-database-tidb\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/blog\\\/agent-memory-database-tidb\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/static.pingcap.com\\\/files\\\/2026\\\/06\\\/11084341\\\/Blog-Feature-1.png\",\"datePublished\":\"2026-06-10T15:53:53+00:00\",\"dateModified\":\"2026-06-11T15:54:08+00:00\",\"description\":\"Build an agent memory database on TiDB: one table for text, vectors, and metadata, plus copy-paste SQL and hybrid search.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/blog\\\/agent-memory-database-tidb\\\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pingcap.com\\\/blog\\\/agent-memory-database-tidb\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/blog\\\/agent-memory-database-tidb\\\/#primaryimage\",\"url\":\"https:\\\/\\\/static.pingcap.com\\\/files\\\/2026\\\/06\\\/11084341\\\/Blog-Feature-1.png\",\"contentUrl\":\"https:\\\/\\\/static.pingcap.com\\\/files\\\/2026\\\/06\\\/11084341\\\/Blog-Feature-1.png\",\"width\":1800,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/blog\\\/agent-memory-database-tidb\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pingcap.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Build Persistent, Scalable AI Agent Memory with TiDB\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/#website\",\"url\":\"https:\\\/\\\/www.pingcap.com\\\/\",\"name\":\"TiDB\",\"description\":\"TiDB | SQL at Scale\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pingcap.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/#organization\",\"name\":\"PingCAP\",\"url\":\"https:\\\/\\\/www.pingcap.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/static.pingcap.com\\\/files\\\/2021\\\/11\\\/pingcap-logo.png\",\"contentUrl\":\"https:\\\/\\\/static.pingcap.com\\\/files\\\/2021\\\/11\\\/pingcap-logo.png\",\"width\":811,\"height\":232,\"caption\":\"PingCAP\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/facebook.com\\\/pingcap2015\",\"https:\\\/\\\/x.com\\\/PingCAP\",\"https:\\\/\\\/linkedin.com\\\/company\\\/pingcap\",\"https:\\\/\\\/youtube.com\\\/channel\\\/UCuq4puT32DzHKT5rU1IZpIA\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.pingcap.com\\\/#\\\/schema\\\/person\\\/6925e06cd94a59f1a63d82225785707f\",\"name\":\"Ravish Patel\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\\\/\\\/static.pingcap.com\\\/files\\\/2022\\\/10\\\/17234942\\\/avatar.jpg\",\"url\":\"https:\\\/\\\/static.pingcap.com\\\/files\\\/2022\\\/10\\\/17234942\\\/avatar.jpg\",\"contentUrl\":\"https:\\\/\\\/static.pingcap.com\\\/files\\\/2022\\\/10\\\/17234942\\\/avatar.jpg\",\"caption\":\"Ravish Patel\"},\"description\":\"Solutions Engineer\",\"url\":\"https:\\\/\\\/www.pingcap.com\\\/ko\\\/blog\\\/author\\\/rpatel\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Agent Memory Database: Build It on TiDB with SQL and Python","description":"Build an agent memory database on TiDB: one table for text, vectors, and metadata, plus copy-paste SQL and hybrid search.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pingcap.com\/ko\/blog\/agent-memory-database-tidb\/","og_locale":"ko_KR","og_type":"article","og_title":"Agent Memory Database: Build It on TiDB with SQL and Python","og_description":"Build an agent memory database on TiDB: one table for text, vectors, and metadata, plus copy-paste SQL and hybrid search.","og_url":"https:\/\/www.pingcap.com\/ko\/blog\/agent-memory-database-tidb\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_published_time":"2026-06-10T15:53:53+00:00","article_modified_time":"2026-06-11T15:54:08+00:00","og_image":[{"width":1200,"height":627,"url":"https:\/\/static.pingcap.com\/files\/2026\/06\/11084406\/Copy-of-Blog-LinkedIn-1.png","type":"image\/png"}],"author":"Ravish Patel","twitter_card":"summary_large_image","twitter_image":"https:\/\/static.pingcap.com\/files\/2026\/06\/11084427\/Blog-Twitter-Banner-2.png","twitter_creator":"@PingCAP","twitter_site":"@PingCAP","twitter_misc":{"\uae00\uc4f4\uc774":"Ravish Patel","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"8\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pingcap.com\/blog\/agent-memory-database-tidb\/#article","isPartOf":{"@id":"https:\/\/www.pingcap.com\/blog\/agent-memory-database-tidb\/"},"author":{"name":"Ravish Patel","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/6925e06cd94a59f1a63d82225785707f"},"headline":"Build Persistent, Scalable AI Agent Memory with TiDB","datePublished":"2026-06-10T15:53:53+00:00","dateModified":"2026-06-11T15:54:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/agent-memory-database-tidb\/"},"wordCount":1304,"publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/agent-memory-database-tidb\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2026\/06\/11084341\/Blog-Feature-1.png","keywords":["AI Agents","AI Memory","Python","TiDB","Vector Search"],"articleSection":["Conference"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/blog\/agent-memory-database-tidb\/","url":"https:\/\/www.pingcap.com\/blog\/agent-memory-database-tidb\/","name":"Agent Memory Database: Build It on TiDB with SQL and Python","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/agent-memory-database-tidb\/#primaryimage"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/agent-memory-database-tidb\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2026\/06\/11084341\/Blog-Feature-1.png","datePublished":"2026-06-10T15:53:53+00:00","dateModified":"2026-06-11T15:54:08+00:00","description":"Build an agent memory database on TiDB: one table for text, vectors, and metadata, plus copy-paste SQL and hybrid search.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/blog\/agent-memory-database-tidb\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/blog\/agent-memory-database-tidb\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/blog\/agent-memory-database-tidb\/#primaryimage","url":"https:\/\/static.pingcap.com\/files\/2026\/06\/11084341\/Blog-Feature-1.png","contentUrl":"https:\/\/static.pingcap.com\/files\/2026\/06\/11084341\/Blog-Feature-1.png","width":1800,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/blog\/agent-memory-database-tidb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pingcap.com\/"},{"@type":"ListItem","position":2,"name":"Build Persistent, Scalable AI Agent Memory with TiDB"}]},{"@type":"WebSite","@id":"https:\/\/www.pingcap.com\/#website","url":"https:\/\/www.pingcap.com\/","name":"\ud2f0DB","description":"TiDB | SQL at Scale","publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pingcap.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.pingcap.com\/#organization","name":"PingCAP","url":"https:\/\/www.pingcap.com\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/","url":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","contentUrl":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","width":811,"height":232,"caption":"PingCAP"},"image":{"@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/pingcap2015","https:\/\/x.com\/PingCAP","https:\/\/linkedin.com\/company\/pingcap","https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA"]},{"@type":"Person","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/6925e06cd94a59f1a63d82225785707f","name":"Ravish Patel","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg","url":"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg","contentUrl":"https:\/\/static.pingcap.com\/files\/2022\/10\/17234942\/avatar.jpg","caption":"Ravish Patel"},"description":"Solutions Engineer","url":"https:\/\/www.pingcap.com\/ko\/blog\/author\/rpatel\/"}]}},"grav_blocks":false,"card_markup":"<a class=\"card-resource bg-white\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/agent-memory-database-tidb\/\"><div class=\"card-resource__image-container\"><img class=\"card-resource__image\" alt=\"Blog - Feature\" src=\"https:\/\/static.pingcap.com\/files\/2026\/06\/11084341\/Blog-Feature-1.png\" loading=\"lazy\" width=1800 height=600 \/><\/div><div class=\"card-resource__content-container\"><div class=\"card-resource__content-head\"><div class=\"card-resource__category\">Conference<\/div><\/div><h5 class=\"card-resource__title\">Build Persistent, Scalable AI Agent Memory with TiDB<\/h5><\/div><\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/33786","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/users\/349"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/comments?post=33786"}],"version-history":[{"count":9,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/33786\/revisions"}],"predecessor-version":[{"id":33803,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/33786\/revisions\/33803"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media\/33793"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=33786"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/categories?post=33786"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/tags?post=33786"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}