Goodbye to the Patchwork: A One-Stop Tech Stack for Memory, Retrieval, and the AI Data Engine (Part 1)

Author: Fu Rongfeng, Senior Technical Expert at OceanBase

What kind of database do AI developers need

Before diving into the main topic, let’s first ponder a question: what kind of database do developers need in the AI era?

Consider how database needs have evolved since the start of this century. In the Web 2.0 era of bringing business online, the emphasis was on a reliable, accurate system of record — one that could precisely log every transaction and meet typical transaction-processing (TP) needs. Entering the era of mobile internet and data intelligence, the explosive growth in data volume made massive data analysis the mainstream demand. At that point, analytical (AP) databases began to take center stage. With the true arrival of the AI era, databases are now driven to support not only query and analysis, but also the ability to understand and reason.

Pain points for developers in the AI era

As database practitioners, we need to take a hard look at developers’ specific database needs in the AI era.

Multidimensional data types: In traditional databases, images, video, and audio could only be stored, not effectively used. With the help of AI models, this unstructured data can be turned into retrievable forms — for example, converted into vectors via embedding models, or processed by large language models to extract text descriptions and tags — thereby transforming unstructured data into structured or semi-structured data for efficient retrieval.

Extreme performance and scale: Given that vector data is heavy on memory and disk resources, striking the best balance between cost and performance becomes especially critical. This calls for efficient algorithms that optimize the trade-off between recall and resource cost.

Built-in intelligent processing: In a RAG scenario, for example, documents must first be chunked and turned into vectors, which typically involves the combined use of vector, document, and transactional databases. To simplify this flow, the ideal solution is to have the database itself take on more of the standardized data-processing work, reducing the burden on developers.

Agile development flow: The goal is to let developers focus on the business logic itself, rather than getting bogged down in complex data-processing pipelines.

The ideal database for the AI era

Based on the pain points above, the ideal database for the AI era should have the following four characteristics.

  • Multimodal support: a unified platform supporting multiple data types, including but not limited to vector, full-text, scalar, and JSON formats.
  • High-performance engine: optimized for AI workloads, delivering the best possible performance while keeping costs under control.
  • Intelligent integration: a built-in AI runtime that lets the database directly execute complex intelligent processing tasks, reducing reliance on external systems.
  • Ease of operation: intuitive, easy-to-use interfaces and tools that lower the barrier for non-specialist developers and bring more domain experts into data work.

In short, the database we hope for in the AI era should be powerful, intelligent, and integrated — a platform where data and AI converge.

Does an AI-native, integrated database exist

As the saying goes, “demand defines the market.” A product that fits the traits of the ideal AI-era database is bound to emerge. As things stand, OceanBase’s newly released seekdb has already landed first, not only offering the relevant core capabilities but also continuing to evolve through rapid iteration.

A lightweight, multimodal, AI-native database with a hybrid-search architecture

OceanBase seekdb is a lightweight, multimodal, native database built for AI scenarios, purpose-designed to support hybrid search, context understanding, and intelligent data processing. Its overall architecture is divided into five core layers, achieving end-to-end optimization from data storage to query execution.

1. Unified application interface layer.

seekdb provides a SQL-based unified query language compatible with standard SQL syntax, supporting joint queries across multimodal data. It also offers a developer-facing Python SDK with a clean, easy-to-use API and support for efficient retrieval patterns such as skip-by-list, significantly lowering the barrier to entry.

2. Multimodal compute layer for hybrid workloads.

Inheriting OceanBase’s mature optimizer system, seekdb has powerful query planning and execution capabilities. In hybrid-retrieval scenarios it automatically performs adaptive execution and query optimization, selecting the optimal execution path based on the query conditions. It also supports adaptive execution for hybrid workloads, AI function calls, ACID transaction guarantees, and flexible UDF extensions to meet complex business needs.

3. Multimodal data layer.

It supports unified storage of multiple data types, achieving “store and you can search,” breaking the limitation of traditional systems where different data types had to be managed in separate databases. This includes:

  • Relational tables (traditional structured data)
  • Vectors (embedding vectors)
  • Text (raw text content)
  • JSON (semi-structured data)
  • GIS (geospatial data)
  • Arrays, bitmaps, and other extended types

4. Multimodal index layer.

It builds an industry-leading multimodal index system, supporting the following index types.

  • Vector index: efficiently supports approximate nearest neighbor (ANN) search, balancing precision and performance.
  • Full-text index: supports Chinese word segmentation and semantic matching.
  • Hybrid index: combines vector and scalar conditions for joint retrieval.
  • JSON index: accelerates queries over nested fields.
  • Secondary index, GIS index: meet diverse query needs.

It supports multi-index coordinated querying, completing fused retrieval across modalities in a single request.

5. Deployment mode layer.

  • Server mode: traditional cluster deployment, suited to high-concurrency, large-scale production environments.
  • Embedded mode: embedded into the application as a library, with a lifecycle tied to the application — ideal for lightweight scenarios such as edge computing and rapid AI app development.

Through an integrated design of “unified interface + multimodal storage + intelligent indexing + flexible deployment,” OceanBase seekdb delivers end-to-end support for AI workloads, truly achieving “one database for all your data.”

seekdb overall architecture

Rapid build: more flexible, more lightweight, beyond just SQL

OceanBase seekdb is not only powerful in functionality but also deeply optimized for ease of use and deployment flexibility, helping developers rapidly build AI applications.

1. More flexible: dual runtime modes for diverse scenarios.

  • Server mode: suited to enterprise-grade, highly available, distributed deployments.
  • Embedded mode: integrated directly into a Python application without needing to deploy a standalone database service, greatly simplifying development — especially well-suited to lightweight AI apps like RAG, agents, and intelligent Q&A.

2. More lightweight: minimal resource footprint, run benchmarks with ease.

A single instance needs only 1C2G of memory to run the VectorDBBench benchmark. Compared with traditional databases, it consumes fewer resources and starts faster, making it ideal for local debugging, prototype validation, and edge deployment.

3. Beyond SQL: a Schemaless SDK.

With the Schemaless SDK, developers can insert and query data directly without defining a table schema, improving development flexibility.

Quickly building a RAG app with seekdb

Below we demonstrate how to quickly build a RAG app using seekdb.

Step 1: Create a knowledge base in three lines of code (SETUP)

  1. Import the pyseekdb module to enable seekdb’s Python SDK.
  2. Initialize a client instance; empty parameters mean embedded mode, where the database lifecycle is bound to the application and no standalone service deployment is needed.
  3. Create a knowledge base and define it as a Collection.

Create a knowledge base in three lines of code

Step 2: Batch-insert document chunks (INSERT)

Function description:

  • Call upsert() to batch-insert document content (documents).
  • Associate metadata (metadatas) at the same time, including structured fields such as category, memory, storage, and price.
  • Explicitly specify document IDs (ids) for later retrieval and updates.

Key features:

  • Users only need to provide the raw text and metadata; there’s no need to manually call an embedding model to generate vectors.
  • The database internally calls the built-in embedding model automatically, converting text into vectors and storing them.

AI capabilities are pushed down into the database, so developers don’t need to worry about the vectorization process; seekdb automatically handles the text → vector conversion, achieving “transparent” processing.

Batch-insert document chunks

Step 3: Hybrid retrieval for precise recall (QUERY)

Query dimension analysis:

  • query_texts: input natural-language text, triggering vector retrieval for semantic matching.
  • where: set relational filter conditions, such as category == laptop and ram >= 16, for precise filtering.
  • where_document: keyword matching based on the full-text index, requiring the document content to contain “RAM”.
  • n_results: limit the number of returned results to 2.

Implementation mechanism:

  • At query time, seekdb internally passes the query_texts input to the embedding model to generate the query vector.
  • It combines vector, full-text, secondary, and other indexes to perform hybrid retrieval.
  • Finally, it returns the most relevant results that satisfy all conditions.

Hybrid retrieval query

Step 4: Showing the results

The search condition entered is: I need a high-performance laptop with more than 12GB of memory. After running, the output is shown below.

Retrieval results display

The recall results are analyzed as follows.

  • First: a professional laptop with 16GB of memory and a 512GB SSD, fully meeting the “high performance + more than 12GB of memory” requirement.
  • Second: a gaming laptop with 32GB of memory and a 1TB SSD — not for professional use, but with outstanding performance that matches the semantic intent.

This case simulates a typical RAG scenario: the user only needs to input a natural-language question, and the system automatically completes text vectorization, multi-condition joint retrieval, and high-precision recall. The entire flow is handled uniformly by the database kernel, greatly simplifying development and truly “letting developers focus on the business, not data processing.”

Feel free to try it yourself: https://github.com/oceanbase/seekdb. The current version supports embedded mode on Linux; Windows and macOS versions will arrive soon. You can visit oceanbase.ai for sample code that supports local testing and quick validation.

A native experience of calling AI directly from SQL

OceanBase seekdb is not just a database that supports multimodal data storage and hybrid retrieval; it is also committed to deeply integrating AI capabilities into the database kernel, achieving the native experience of “calling AI directly from SQL.”

Beyond the AI_EMBED method, seekdb’s AI Inside built-in processing also introduces AI_RERANK and AI_COMPLETE, enabling automated data analysis, feature extraction, intelligent content generation, semantic-search enhancement, result optimization, and more. With seekdb you can build an efficient layered hybrid-retrieval pipeline from coarse ranking to fine ranking. This pipeline has four stages.

Stage 1: Scalar Filtering. First, apply relational condition filtering over the full dataset (e.g., category = ‘laptop’, ram >= 16) to narrow the candidate set.

Stage 2: Vector Search. Perform vector-similarity retrieval over the filtered candidate set, finding the most relevant documents through semantic matching, using approximate nearest neighbor (ANN) algorithms to efficiently complete high-dimensional vector comparisons.

Stage 3: Full-text Search. Within the candidate set, further perform keyword matching to ensure the results contain the key information the user cares about (e.g., “RAM”), supporting Chinese word segmentation and fuzzy matching to improve recall precision. The order in which scalar, vector, and full-text filtering happen is decided by the optimizer.

Stage 4: Coarse ranking → fine ranking → LLM reranking. After the filtering above, you get the coarse-ranked results; at this point you call AI_RERANK, and the database directly invokes the RERANK model for fine ranking. Once fine ranking is done, calling AI_COMPLETE invokes the LLM, which answers directly. All of these standard AI operations happen inside the database. Developers only need to add the corresponding functions to the query, and the database automatically calls the LLM to process the data, significantly improving the user experience.

Layered hybrid-retrieval pipeline

OceanBase seekdb use cases

As a lightweight, multimodal, AI-native database, OceanBase seekdb — with its unified storage, hybrid retrieval, built-in AI capabilities, and embedded deployment support — shows clear advantages across many emerging and traditional intelligence scenarios. Here are its typical use cases.

1. Replace the “three-database parallel” setup, cutting cost while boosting efficiency

In a RAG architecture, the traditional approach usually requires maintaining three types of databases simultaneously.

  • A vector database to store text-embedding vectors.
  • A document database to keep the raw text content.
  • A relational database to manage metadata (such as category, time, permissions, etc.).

This “three-database parallel” pattern not only brings high operational complexity but also leads to duplicated resource consumption (three separate instances), making it hard to deploy in resource-constrained local or edge environments. seekdb carries vectors, text, and structured metadata in a single database, achieving write-once, multi-path indexing (vector index + full-text index + secondary index), a unified query interface, support for hybrid-condition filtering, and an extremely low resource footprint (runs on 1C2G) — well-suited to personal local knowledge bases, internal knowledge-management systems for small and medium enterprises, edge-side intelligent Q&A apps, and the like.

2. A semantic search engine that breaks modality barriers

seekdb’s multimodal capabilities make it naturally suited to cross-modal semantic search. Whether text, image, audio, or video, all can be converted into a unified vector representation via embedding models and retrieved jointly with metadata. Through a unified vector + metadata + full-text hybrid-retrieval framework, it breaks modality barriers. Typical applications include image-to-image search, audio content retrieval, semantic matching of video clips, and multimedia asset management systems.

3. Agentic AI applications, ensuring data consistency

In Agentic AI scenarios, agents need to frequently perform context-aware hybrid retrieval — for example, combining a user’s behavior history (scalar filtering), matching task-goal semantics (vector search), and retrieving relevant document chunks (full-text matching). seekdb’s native hybrid-retrieval engine and built-in AI functions can efficiently support such complex queries, avoiding the latency and consistency issues that come with external service calls. It’s suitable for task-oriented dialogue systems, autonomous decision-making robots, intelligent workflow engines, and similar scenarios.

4. AI-assisted programming: better quality, lower cost

AI programming assistants have dual cloud-plus-client retrieval needs, and traditional approaches face two major challenges.

  • Architectural fragmentation: the cloud uses multi-source recall (vector + full-text + syntax tree), while the client relies on a lightweight plugin (e.g., SQLite + vector extension), so the two systems are logically inconsistent.
  • Performance bottleneck: general-purpose databases lack specialized vector indexes and optimizers, limiting recall quality and efficiency.

seekdb provides a unified SDK and query interface, letting the cloud and client use the same set of APIs, with the client still possessing professional-grade vector retrieval in embedded mode. seekdb also supports advanced features such as code semantic search, API recommendation, and bug-fix suggestions. These capabilities unify the tech stack, improve recall quality, and lower the cost of developing and maintaining both ends.

5. A smooth intelligence upgrade for enterprise applications

For the many legacy enterprise applications still running on MySQL, seekdb offers a smooth evolution path:

  • Highly compatible with the MySQL protocol, so existing applications can migrate seamlessly.
  • After migration, you immediately gain AI-native capabilities such as vector retrieval, full-text search, and JSON support.
  • It lays the data foundation for introducing AI features like RAG, intelligent reports, and automated analysis in the future.

Migrating from MySQL to OceanBase is therefore one of the “smoothest” paths. As a lightweight extension of OceanBase, seekdb further lowers the technical barrier to an enterprise’s intelligence transformation.

6. The ideal choice for on-device application intelligence

As terminal-device compute grows, more and more intelligent applications are moving on-device. seekdb’s embedded deployment makes it the ideal choice for an on-device intelligent database:

  • Extremely low resource footprint (runs on 1C2G).
  • Supports offline vector retrieval and semantic understanding.
  • Lifecycle bound to the application, with no need for a standalone service process.
  • Gives on-device apps a “local brain,” reducing dependence on cloud services.

Typical scenarios include:

  • Local knowledge Q&A in smart home devices.
  • Real-time fault diagnosis in industrial robots.
  • Context-memory management for mobile personal assistants.
  • Local semantic navigation in in-vehicle systems.

From light to heavy, from simple to complex: the ideal infrastructure for rapidly iterating AI applications

Against the backdrop of rapidly iterating AI applications, developers face multi-stage needs spanning prototype validation, development and testing, and production deployment. The deep integration of OceanBase and seekdb builds an elastic database architecture that covers the full lifecycle and supports smooth evolution, meeting flexible deployment needs across different stages and scenario sizes.

Prototype validation and development/testing: embedded mode (seekdb)

In the early phase of a project, developers usually need to quickly validate AI model effectiveness or build a minimum viable product (MVP). At this point you can use seekdb’s embedded mode:

  • Integrate the libseekdb.so dynamic library directly into the application, running it as a local database.
  • The database lifecycle is bound to the application — start and use, close and destroy.
  • No standalone service deployment needed, greatly simplifying environment setup.
  • Supports multimodal data storage and hybrid retrieval across vectors, text, JSON, and more.

Embedded mode suits individual developers doing rapid prototyping, on-device intelligent apps (such as mobile and robotics), local debugging, algorithm validation, and similar scenarios.

Testing and small-scale production: standalone deployment mode

When an application enters testing or a small-scale launch, you can migrate to standalone deployment mode:

  • Start a standalone seekdb process that provides a server-side interface.
  • Supports multi-client connections, suitable for team collaboration.
  • Manage data paths, memory parameters, and the like via config files.
  • Still maintains API compatibility with embedded mode, so the code needs no changes.

Standalone deployment mode suits small workloads, testing and production environments, multi-tenancy needs, and similar scenarios.

Production: multi-tenant and highly available architecture

As the business stabilizes in operation, you need to consider resource isolation, high availability, and disaster recovery. At this point you can choose between the following two production-grade deployment options.

  • Standalone multi-tenant mode (OceanBase standalone deployment):
    • Use a standalone OceanBase instance and achieve resource isolation between multiple businesses through the multi-tenancy mechanism.
    • Suited to scenarios where multiple businesses share the same database instance but need independently managed resources.
    • Supports independent quota control, backup policies, and monitoring/alerting.
  • Primary-standby / three-replica mode (OceanBase high-availability architecture):
    • Adopts a primary-standby architecture or three-replica (2F1A) architecture to ensure high data availability.
    • Supports automatic failover and read-write splitting.
    • Suited to small and medium business systems with higher stability requirements.

The multi-tenant and high-availability architecture suits small and medium workloads, businesses with explicit disaster-recovery and high-availability requirements, multi-tenant SaaS platforms sharing a database, and similar scenarios.

Large-scale, high-performance scenarios: distributed cluster architecture

When the business keeps growing and data volume and concurrent requests surge, you can further scale to a distributed cluster architecture.

  • Shared-nothing distributed cluster:
    • Composed of multiple OBServer nodes, supporting horizontal scaling.
    • Supports large-scale workloads and high-concurrency access for mission-critical business.
    • Offers strong consistency, linear scalability, and dynamic scale-out.
  • Storage-compute separation cluster based on object storage:
    • The storage layer uses object storage (such as OSS), while the compute layer is provided by OBServer.
    • Achieves “hot-cold data separation” to lower storage costs.
    • Suited to massive non-sensitive data analysis scenarios (such as log analysis and historical archiving).
    • Offers higher cost-effectiveness and stronger scalability.

The distributed cluster architecture suits large-scale workloads, mission-critical business systems, high-performance and high-concurrency needs, more cost-effective big-data processing tasks, and similar scenarios.

The combination of OceanBase and seekdb forms a complete elastic architecture system that goes “from light to heavy, from simple to complex,” with three core advantages.

  • Fully compatible APIs: no matter which deployment mode you choose, the business code needs no modification.
  • Config-driven upgrades: just change the connection address and config parameters to complete an architecture migration.
  • A smooth evolution path: supports seamless transition from individual development to enterprise-grade production.

This makes OceanBase + seekdb the ideal infrastructure for rapidly iterating AI applications, truly achieving “develop once, adapt across the full stack,” helping enterprises accelerate innovation in the AI era.

The elastic architecture system from light to heavy

Of course, in the AI era an AI database alone isn’t enough to support the full infrastructure an application needs. That’s why OceanBase has built the key capabilities of a context-engineering system. Stay tuned for the next article.