GetNotes Tools
oceanbase/seekdb
Tool นี้คืออะไร
seekdb เป็น State Store ที่เข้ากันได้กับ MySQL สำหรับ AI Agents โดยเฉพาะ ช่วยให้สามารถเขียนข้อมูลแบบสตรีมมิ่ง ค้นหาแบบไฮบริด และสร้างแซนด์บ็อกซ์แบบ Copy-on-Write เพื่อการสำรวจของ Agent ได้อย่างรวดเร็วและปลอดภัย
ข้อมูลโปรเจกต์
ดาว
2.8K
Forks
301
License
Apache-2.0
อัปเดต GitHub ล่าสุด
14 ก.ค. 2569
เพิ่มใน GetNotes
15 ก.ค. 2569
Repository
oceanbase/seekdb
เหมาะกับงาน
เหมาะกับอาชีพ
Ecosystem
C++
แปลและเรียบเรียงโดย AI
เนื้อหาฉบับภาษาไทย
ใช้อ่านเพื่อทำความเข้าใจเบื้องต้น โปรดตรวจสอบรายละเอียดสำคัญกับเอกสารต้นฉบับด้านล่าง
เขียน. ค้นหา. Fork. State Store สำหรับ AI Agents.
เข้ากันได้กับ MySQL · แบบฝังหรือเซิร์ฟเวอร์ · การค้นหาแบบไฮบริด Vector + Full-text · COW Sandbox
⚡ 1,523 QPS สำหรับการเขียนและค้นหาแบบสตรีมมิ่ง (10 เท่าของ Milvus, 3 เท่าของ Elasticsearch) 🌿 แซนด์บ็อกซ์ FORK/MERGE สำหรับการสำรวจของ Agent อย่างปลอดภัย 🔍 Vector + full-text + scalar ในการสอบถาม SQL เดียว 🐬 Full ACID, โปรโตคอล MySQL, ทำงานร่วมกับ LangChain/LlamaIndex/Dify
ลองใช้ใน 30 วินาที · เริ่มต้นใช้งานอย่างรวดเร็ว · ทำไมต้อง seekdb · ระบบนิเวศ · การมีส่วนร่วม
หากคุณพบว่า seekdb มีประโยชน์ โปรดพิจารณาให้ ดาว — มันช่วยให้ผู้อื่นค้นพบโปรเจกต์นี้ได้
⚡ ประสิทธิภาพโดยรวม
⏱️ ลองใช้ใน 30 วินาที
pip install -U pyseekdb # pyseekdb is the Python SDK for seekdbไม่ต้องมีเซิร์ฟเวอร์ ไม่ต้องมีสคีมา ไม่ต้องตั้งค่าการฝังข้อมูล โหมดฝังตัวทำงานในกระบวนการ; สามารถเปลี่ยนไปใช้โหมดเซิร์ฟเวอร์ / OceanBase ได้ด้วยโค้ดเพียงบรรทัดเดียว ตัวอย่างเพิ่มเติม →
✨ ทำไมต้อง seekdb สำหรับ Agents?
🔥 การเขียนแบบสตรีมมิ่ง + การค้นหาพร้อมกัน โดยไม่มี P99 Spike
เวิร์คโหลดของ Agent คือการเขียนอย่างต่อเนื่อง + การอ่านในอีกไม่กี่มิลลิวินาทีต่อมา async index pipeline (Change Stream) ของ seekdb แยก DML ออกจากการสร้างดัชนี และ two-level HNSW (incremental + snapshot) ทำให้เวกเตอร์ที่เขียนใหม่สามารถค้นหาได้ทันที
เส้นทางการเขียนจะคอมมิตและส่งคืน โดยไม่ต้องรอ การสร้างดัชนี Change Stream pipeline จะใช้ redo log แบบอะซิงโครนัสและอัปเดต delta HNSW การสอบถามจะเข้าถึงทั้งดัชนี delta และ snapshot ด้วย read locks ที่ละเอียด — นี่คือเหตุผลที่ P99 ยังคงราบเรียบภายใต้การทำงานพร้อมกัน
ผลลัพธ์: 1,523 QPS พร้อม P99 พร้อมกันที่ 21.7 มิลลิวินาที — 10.7 เท่าของ QPS ของ Milvus และ P99 jitter เพียง 1.1 เท่าเมื่อการทำงานพร้อมกันเพิ่มขึ้น (เทียบกับ ~10 เท่าสำหรับ ES / Milvus ในเวิร์คโหลดเดียวกัน)
ที่มา: src/share/change_stream/ · src/share/vector_index/
🌿 Copy-on-Write Sandboxes สำหรับการสำรวจของ Agent
FORK DATABASE จะสร้างสแนปช็อตของฐานข้อมูลทั้งหมดในไม่กี่วินาที — ไม่มีการคัดลอกข้อมูล Agent สามารถทดลองได้อย่างอิสระ (เขียน, สอบถาม, แม้กระทั่งทำให้ตารางเสียหาย); จากนั้น MERGE TABLE จะคอมมิตงานกลับ หรือ DROP DATABASE จะทิ้งงานนั้นไป COW ระดับเคอร์เนล ไม่ใช่การบันทึก/กู้คืนระดับแอปพลิเคชัน
-- Snapshot in seconds, no data copy
FORK DATABASE agent_state TO agent_sandbox_42;
-- Agent reads/writes freely on the sandbox...
USE agent_sandbox_42;
INSERT INTO memory (session_id, embedding, content) VALUES (...);
-- Accept the work back to mainline (strategies: FAIL / THEIRS / OURS)
MERGE TABLE agent_sandbox_42.memory INTO agent_state.memory STRATEGY THEIRS;
-- ...or throw it away:
DROP DATABASE agent_sandbox_42;ที่มา: tools/deploy/mysql_test/test_suite/fork_table/
🔍 การค้นหาแบบไฮบริดใน SQL เดียว
Vector + full-text + scalar filter ถูกผลักเข้าไปในแผนการดำเนินการเดียว ไม่มีการรวมฝั่งไคลเอ็นต์แบบ N+1 ไม่ต้องมีโค้ดเชื่อมต่อเพื่อรวมผลลัพธ์
SELECT id, title, l2_distance(emb, '[0.12,0.34,...]') AS dist
FROM docs
WHERE MATCH(content) AGAINST('quarterly report')
AND author_id = 42
AND created_at > '2026-01-01'
ORDER BY dist APPROXIMATE LIMIT 10;🐬 เข้ากันได้กับ MySQL, ACID, ฝังได้
สร้างขึ้นบนเอนจิน SQL ของ OceanBase ที่ได้รับการพิสูจน์แล้ว ทำงานเป็นไลบรารีแบบฝัง, เซิร์ฟเวอร์โหนดเดียว, หรือในคลัสเตอร์แบบกระจายของ OceanBase Full ACID, การเขียนแบบเรียลไทม์ และระบบนิเวศ MySQL ทั้งหมดพร้อมใช้งานทันที
🎬 เริ่มต้นใช้งานอย่างรวดเร็ว
การติดตั้ง
เลือกแพลตฟอร์มของคุณ:
เพียงแค่ curl ครั้งเดียว ก็ได้ฐานข้อมูลที่ทำงานอยู่ — ไม่ต้องลงทะเบียน ไม่ต้องใช้บัตรเครดิต
curl -X POST https://d0.seekdb.ai/api/v1/instancesฟรี 7 วัน เรียนรู้เพิ่มเติม →
pip install -U pyseekdbdocker run -d \
--name seekdb \
-p 2881:2881 \
-p 2886:2886 \
-v ./data:/var/lib/oceanbase \
oceanbase/seekdb:latestโปรดดู เอกสาร ของ Docker image นี้สำหรับรายละเอียด
# Linux (ติดตั้งในบรรทัดเดียว อาจต้องใช้ sudo)
curl -fsSL https://obportal.s3.ap-southeast-1.amazonaws.com/download-center/opensource/seekdb/seekdb_install.sh | bash
# macOS (Homebrew)
brew tap oceanbase/seekdb
brew install seekdbดู เอกสารการติดตั้ง สำหรับการติดตั้งแบบออฟไลน์ DEB/RPM และรายละเอียดการกำหนดค่า
📝 ตัวอย่างเพิ่มเติม
สำหรับคำแนะนำการใช้งาน Python SDK แบบเต็ม — โหมดการเชื่อมต่อ, ฟังก์ชันการฝังข้อมูล, ตัวกรองเมตาดาต้า — ดู คู่มือผู้ใช้ pyseekdb
Repository: oceanbase/seekdb ส่วนที่ 2/2
ลูปของเอเจนต์ตามแบบฉบับ: เขียนข้อมูลที่สังเกตได้, ดึงบริบทที่เกี่ยวข้อง ไม่กี่มิลลิวินาทีต่อมา, ทำซ้ำไปเรื่อยๆ ไพพ์ไลน์ดัชนีแบบอะซิงโครนัสของ seekdb ช่วยให้ ทั้งสองส่วนทำงานได้อย่างรวดเร็วภายใต้การทำงานพร้อมกันอย่างต่อเนื่อง
import pyseekdb
client = pyseekdb.Client(path="./agent_state.db")
memory = client.get_or_create_collection(name="episodic")
for step in agent.run():
# Persist the observation
memory.upsert(ids=[step.id], documents=[step.observation])
# Retrieve relevant context — milliseconds after the write,
# served by the incremental HNSW (no waiting on a background rebuild)
relevant = memory.query(query_texts=step.next_query, n_results=5)
agent.act(relevant)-- Table with vector column, full-text index, and HNSW vector index
CREATE TABLE articles (
id INT PRIMARY KEY,
title TEXT,
content TEXT,
embedding VECTOR(384),
FULLTEXT INDEX idx_fts (content) WITH PARSER ik,
VECTOR INDEX idx_vec (embedding) WITH (DISTANCE=l2, TYPE=hnsw, LIB=vsag)
) ORGANIZATION = HEAP;
-- Hybrid search: vector similarity + full-text match in one query
SELECT id, title,
l2_distance(embedding, '[0.12, 0.34, ...]') AS dist
FROM articles
WHERE MATCH(content) AGAINST('quarterly report')
ORDER BY dist APPROXIMATE
LIMIT 10;นักพัฒนา Python สามารถเข้าถึงสิ่งนี้ได้ผ่าน SQLAlchemy หรือไดรเวอร์ MySQL ใดๆ
📚 กรณีการใช้งาน
เอเจนต์ต้องการที่เก็บสถานะที่รองรับการเขียนหน่วยความจำอย่างต่อเนื่อง, การดึงข้อมูลในอีกไม่กี่มิลลิวินาทีต่อมา, การแตกสาขาเพื่อการสำรวจ, และการย้อนกลับเมื่อ เกิดข้อผิดพลาด seekdb ถูกสร้างขึ้นมาเพื่อสิ่งนี้โดยเฉพาะ:
- พื้นที่เก็บข้อมูลที่เหมาะกับการสตรีม — เขียนหน่วยความจำ, คิวรีได้ในมิลลิวินาทีถัดไป
- COW sandboxes —
FORK DATABASEสำหรับการทดลองอย่างปลอดภัย,MERGEเพื่อยอมรับ,DROPเพื่อย้อนกลับ - การดึงข้อมูลแบบไฮบริด — เวกเตอร์ + ข้อความเต็ม + เชิงสัมพันธ์ใน SQL เดียว
- โปรโตคอล MySQL — ทำงานร่วมกับ LangChain, LlamaIndex, Dify ได้ทันที
ผู้ช่วยส่วนตัว · ระบบอัตโนมัติสำหรับองค์กร · เอเจนต์เฉพาะทาง · แพลตฟอร์มเอเจนต์
seekdb ที่มีการดึงข้อมูลแบบไฮบริด + เอ็นจิ้นหลายโมเดลยังเหมาะกับเวิร์กโหลด AI แบบคลาสสิก:
- 📖 RAG & การดึงความรู้ — เวกเตอร์ + ข้อความเต็ม + ตัวกรองสเกลาร์พร้อมการควบคุมการเข้าถึงหลายระดับ การประกันคุณภาพสำหรับองค์กร, การสนับสนุนลูกค้า, ข้อมูลเชิงลึกในอุตสาหกรรม, ฐานความรู้ส่วนบุคคล
- 🔍 การค้นหาเชิงความหมาย — การค้นหาตามการฝังข้อมูลในข้อความ, รูปภาพ และรูปแบบอื่นๆ การค้นหาสินค้า, ข้อความเป็นรูปภาพ, รูปภาพเป็นสินค้า
- 💻 การเขียนโค้ดที่ช่วยโดย AI — การค้นหาโค้ดเชิงความหมาย, การแยกโปรเจกต์หลายโปรเจกต์, การคิวรีแบบย้อนเวลาสำหรับปลั๊กอิน IDE และเอเจนต์โค้ด IDE ในเครื่อง, web IDEs, การออกแบบเป็นเว็บ
- ⬆️ ระบบอัจฉริยะสำหรับแอปพลิเคชันองค์กร — เลเยอร์ AI ที่เข้ากันได้กับ MySQL สำหรับระบบเดิม, พร้อมที่เก็บข้อมูลแบบไฮบริดแถว/คอลัมน์ ระบบอัจฉริยะเอกสาร, ข้อมูลเชิงลึกทางธุรกิจ, ระบบการเงิน
- 📱 AI บนอุปกรณ์ & Edge — โหมดฝังตัว / ไมโครเซิร์ฟเวอร์สำหรับอุปกรณ์ที่มีทรัพยากรจำกัด ระบบในยานพาหนะ, การศึกษา AI, หุ่นยนต์เพื่อนร่วมทาง, อุปกรณ์ดูแลสุขภาพ
🌟 ระบบนิเวศ & การผสานรวม
+ Camel-AI · DB-GPT · FastGPT · Firecrawl · Spring-AI-Alibaba · Cloudflare Workers AI · Jina AI · Ragas · Instructor · Baseten — ดู คู่มือผู้ใช้ สำหรับรายการทั้งหมด
🌐 ขั้นตอนถัดไป & ชุมชน
- 📖 อ่านเอกสาร → — Quickstart, การอ้างอิง API, คู่มือการผสานรวม
- 📝 บล็อกเปิดตัว → — สถาปัตยกรรมเบื้องหลัง QPS ที่เร็วกว่า Milvus 10.7 เท่า
- 🐛 เปิดประเด็น → — รายงานข้อบกพร่อง, ขอคุณสมบัติ
- 🤝 ร่วมสนับสนุน → — ช่วยสร้างที่เก็บสถานะยุคเอเจนต์
🛠️ การพัฒนา
สร้างจากซอร์สโค้ด
ก่อนที่จะสร้าง โปรดติดตั้งชุดเครื่องมือและส่วนประกอบที่จำเป็นสำหรับระบบปฏิบัติการของคุณ ดู ติดตั้ง Toolchain สำหรับคำแนะนำโดยละเอียด
# Clone the repository
git clone https://github.com/oceanbase/seekdb.git
cd seekdb
bash build.sh debug --init --make
mkdir -p ~/seekdb/bin
cp build_debug/src/observer/seekdb ~/seekdb/bin
cd ~/seekdb
./bin/seekdbในตัวอย่างนี้ ไดเรกทอรีการทำงานคือ $HOME/seekdb โปรดใช้ไดเรกทอรีใหม่สำหรับการทดสอบ โปรดดู คู่มือนักพัฒนา สำหรับคำแนะนำโดยละเอียด
การร่วมสนับสนุน
เรายินดีรับการร่วมสนับสนุน! ดู คู่มือการร่วมสนับสนุน ของเราเพื่อเริ่มต้น
📈 ประวัติ Star
หาก seekdb มีประโยชน์สำหรับคุณ การกด Star ช่วยให้ผู้อื่นค้นพบได้ ⭐
📄 ใบอนุญาต
seekdb สร้างโดยทีม OceanBase — ซึ่งเป็นเอ็นจิ้นฐานข้อมูลเดียวกันที่ใช้งานจริงใน Alipay, Taobao, DiDi, Xiaomi และอื่นๆ เป็นโอเพนซอร์สเต็มรูปแบบภายใต้ Apache License, Version 2.0
เอกสารโปรเจกต์
อ่านเอกสารต้นฉบับ
README วิธีติดตั้ง วิธีใช้งาน และข้อกำหนดจาก repository ต้นฉบับ
Write. Search. Fork. The State Store for AI Agents.
MySQL-compatible · Embedded or Server · Hybrid Vector + Full-text Search · COW Sandbox
⚡ 1,523 QPS streaming write+search (10× Milvus, 3× Elasticsearch) 🌿 FORK/MERGE sandboxes for safe agent exploration 🔍 Vector + full-text + scalar in one SQL query 🐬 Full ACID, MySQL protocol, works with LangChain/LlamaIndex/Dify
30-Second Try · Quick Start · Why seekdb · Ecosystem · Contributing
If you find seekdb useful, consider giving it a star — it helps others discover the project.
⚡ Performance at a Glance
⏱️ 30-Second Try

pip install -U pyseekdb # pyseekdb is the Python SDK for seekdbNo servers, no schemas, no embedding setup. Embedded mode runs in-process; switch to server / OceanBase mode with one line. More examples →
✨ Why seekdb for Agents?
🔥 Streaming Write + Concurrent Search, Without the P99 Spike
Agent workloads are continuous write + millisecond-later read. seekdb's async index pipeline (Change Stream) decouples DML from index build, and its two-level HNSW (incremental + snapshot) makes newly-written vectors immediately searchable.
The write path commits and returns without waiting on index construction. The Change Stream pipeline consumes the redo log asynchronously and updates the delta HNSW. Queries hit both delta and snapshot indexes with fine-grained read locks — this is why P99 stays flat under concurrency.
The result: 1,523 QPS with 21.7 ms concurrent P99 — 10.7× the QPS of Milvus, and P99 jitter of just 1.1× when concurrency rises (vs ~10× for ES / Milvus on the same workload).
Source: src/share/change_stream/ · src/share/vector_index/
🌿 Copy-on-Write Sandboxes for Agent Exploration
FORK DATABASE snapshots an entire database in seconds — no data copy.
Agents experiment freely (write, query, even break tables); then MERGE TABLE
commits the work back, or DROP DATABASE discards it. Kernel-level COW,
not application-layer save/restore.
-- Snapshot in seconds, no data copy
FORK DATABASE agent_state TO agent_sandbox_42;
-- Agent reads/writes freely on the sandbox...
USE agent_sandbox_42;
INSERT INTO memory (session_id, embedding, content) VALUES (...);
-- Accept the work back to mainline (strategies: FAIL / THEIRS / OURS)
MERGE TABLE agent_sandbox_42.memory INTO agent_state.memory STRATEGY THEIRS;
-- ...or throw it away:
DROP DATABASE agent_sandbox_42;Source: tools/deploy/mysql_test/test_suite/fork_table/
🔍 Hybrid Search in a Single SQL
Vector + full-text + scalar filter pushed into one execution plan. No N+1 client-side merging, no glue code to combine results.
SELECT id, title, l2_distance(emb, '[0.12,0.34,...]') AS dist
FROM docs
WHERE MATCH(content) AGAINST('quarterly report')
AND author_id = 42
AND created_at > '2026-01-01'
ORDER BY dist APPROXIMATE LIMIT 10;🐬 MySQL-Compatible, ACID, Embeddable
Built on the proven OceanBase SQL engine. Works as an embedded library, a single-node server, or in the OceanBase distributed cluster. Full ACID, real-time writes, and the entire MySQL ecosystem out of the box.
🎬 Quick Start
Installation
Choose your platform:
One curl, a running database — no signup, no credit card.
curl -X POST https://d0.seekdb.ai/api/v1/instancesFree for 7 days. Learn more →
pip install -U pyseekdbdocker run -d \
--name seekdb \
-p 2881:2881 \
-p 2886:2886 \
-v ./data:/var/lib/oceanbase \
oceanbase/seekdb:latestPlease refer to the document of this docker image for details.
# Linux (one-line install, may need sudo)
curl -fsSL https://obportal.s3.ap-southeast-1.amazonaws.com/download-center/opensource/seekdb/seekdb_install.sh | bash
# macOS (Homebrew)
brew tap oceanbase/seekdb
brew install seekdbSee deployment docs for DEB/RPM offline install and configuration details.
📝 More Examples
For the full Python SDK walkthrough — connection modes, embedding functions, metadata filters — see the pyseekdb User Guide.
The canonical agent loop: write an observation, retrieve relevant context milliseconds later, repeat. seekdb's async index pipeline keeps both sides fast under sustained concurrency.
import pyseekdb
client = pyseekdb.Client(path="./agent_state.db")
memory = client.get_or_create_collection(name="episodic")
for step in agent.run():
# Persist the observation
memory.upsert(ids=[step.id], documents=[step.observation])
# Retrieve relevant context — milliseconds after the write,
# served by the incremental HNSW (no waiting on a background rebuild)
relevant = memory.query(query_texts=step.next_query, n_results=5)
agent.act(relevant)-- Table with vector column, full-text index, and HNSW vector index
CREATE TABLE articles (
id INT PRIMARY KEY,
title TEXT,
content TEXT,
embedding VECTOR(384),
FULLTEXT INDEX idx_fts (content) WITH PARSER ik,
VECTOR INDEX idx_vec (embedding) WITH (DISTANCE=l2, TYPE=hnsw, LIB=vsag)
) ORGANIZATION = HEAP;
-- Hybrid search: vector similarity + full-text match in one query
SELECT id, title,
l2_distance(embedding, '[0.12, 0.34, ...]') AS dist
FROM articles
WHERE MATCH(content) AGAINST('quarterly report')
ORDER BY dist APPROXIMATE
LIMIT 10;Python developers can access this via SQLAlchemy or any MySQL driver.
📚 Use Cases
Agents need a state store that handles continuous memory writes, millisecond-later retrieval, branching for exploration, and rollback when things go wrong. seekdb is built for exactly this:
- Streaming-friendly storage — write a memory, query it in the next ms
- COW sandboxes —
FORK DATABASEfor safe experimentation,MERGEto accept,DROPto roll back - Hybrid retrieval — vector + full-text + relational in one SQL
- MySQL protocol — works with LangChain, LlamaIndex, Dify out of the box
Personal assistants · Enterprise automation · Vertical agents · Agent platforms
seekdb's hybrid retrieval + multi-model engine also fits classic AI workloads:
- 📖 RAG & Knowledge Retrieval — vector + full-text + scalar filters with multi-level access control. Enterprise QA, customer support, industry insights, personal knowledge bases.
- 🔍 Semantic Search — embedding-based search across text, images, and other modalities. Product search, text-to-image, image-to-product.
- 💻 AI-Assisted Coding — semantic code search, multi-project isolation, time-travel queries for IDE plugins and code agents. Local IDEs, web IDEs, design-to-web.
- ⬆️ Enterprise Application Intelligence — MySQL-compatible AI layer for legacy systems, with row/column hybrid storage. Document intelligence, business insights, finance systems.
- 📱 On-Device & Edge AI — embedded / micro-server modes for resource-constrained devices. In-vehicle systems, AI education, companion robots, healthcare devices.
🌟 Ecosystem & Integrations
+ Camel-AI · DB-GPT · FastGPT · Firecrawl · Spring-AI-Alibaba · Cloudflare Workers AI · Jina AI · Ragas · Instructor · Baseten — see User Guide for the full list.
🌐 Next Steps & Community
- 📖 Read the docs → — Quickstart, API reference, integration guides
- 📝 Launch blog → — The architecture behind 10.7× the QPS of Milvus
- 🐛 Open an issue → — Report bugs, request features
- 🤝 Contribute → — Help build the agent-era state store
🛠️ Development
Build from Source
Before building, please install the required toolchain and dependencies for your operating system. See Install Toolchain for detailed instructions.
# Clone the repository
git clone https://github.com/oceanbase/seekdb.git
cd seekdb
bash build.sh debug --init --make
mkdir -p ~/seekdb/bin
cp build_debug/src/observer/seekdb ~/seekdb/bin
cd ~/seekdb
./bin/seekdbIn this example, the working directory is $HOME/seekdb, please use a fresh directory for testing. Please see the Developer Guide for detailed instructions.
Contributing
We welcome contributions! See our Contributing Guide to get started.
📈 Star History
If seekdb is useful to you, a star helps others find it. ⭐
📄 License
seekdb is built by the OceanBase team — the same database engine running in production at Alipay, Taobao, DiDi, Xiaomi, and more. Fully open-source under the Apache License, Version 2.0.
