RAGFlow × OceanBase seekdb: Agent-Ready Data Retrieval in Minutes

右侧logo

oceanbase database

As RAG enters the agent era, the traditional "retrieve once, answer once" pipeline is becoming obsolete. Autonomous agents plan, call tools, write code, and revise—retrieving context repeatedly from documents, memory, and tool catalogs. This shift transforms retrieval into a foundational data-layer problem. Agents require low-latency, high-precision search that seamlessly blends vector similarity, full-text matching, and structured filtering at runtime.

In this guide, we use RAGFlow as a reference architecture to demonstrate how to build an agent-grade retrieval layer using OceanBase seekdb.

What Changes in Agent-Era RAG?

In classic RAG, retrieval is a single, isolated step prior to generation. In agent workflows, retrieval is a continuous, hot loop:

Retrieve context → Decide next action → Call a tool → Update state → Retrieve again.

  • Expanded Context Sources: Agents don't just query documents; they retrieve memory (interaction state) and tool catalogs (schemas, endpoints, policies).
  • Amplified Failures: In an agent loop, weak retrieval doesn’t just result in a poor answer—it triggers flawed planning and incorrect tool execution.

Consequently, the engineering bottleneck shifts from prompt engineering to infrastructure: how reliably and repeatedly can you fetch the right context within a strict latency budget?

The Data-Layer Requirement: Hybrid Retrieval and Predictable Latency

Agents don't retrieve "just text." They retrieve context under strict constraints, and they do it constantly. To maintain reliability, the retrieval engine must combine three distinct signals in a single request:

  1. Vector Search: For semantic recall and conceptual matching.
  2. Full-Text Search: For exact keyword matches (e.g., specific identifiers, error strings, or code tokens).
  3. Structured Filtering: For precise scoping (e.g., tenant IDs, time ranges, document types, or access control lists).

When these capabilities are siloed across separate systems, developers pay a heavy integration tax: extra network hops, inconsistent ranking algorithms, complex debugging, and unstable tail latency. These are exactly the failure modes that agent loops amplify. The architectural solution is a single, unified hybrid retrieval path capable of executing semantic, lexical, and filtered queries concurrently.

RAGFlow’s "Tree + Graph" Lens: A Mental Model for Context

A common failure mode in early RAG systems is retrieving isolated, structureless text chunks. RAGFlow’s "tree + graph" approach offers an excellent mental model for building agent-ready context:

  • Tree (Routing): Leverage document structure (directories, sections, headings) to locate the correct scope first.
  • Graph (Expansion): Utilize relationships (references, entities, dependencies) to pull in connected context.

The core takeaway here isn't just the specific implementation; it’s what it implies for the retrieval engine:. Moving from simple "top-K" chunks to complex context construction demands a retrieval engine that is incredibly fast, composable, and predictable.

OceanBase seekdb as the Agent Data Layer

OceanBase seekdb is engineered as an AI-native search database specifically designed to meet these new architectural demands:

  • Native Hybrid Retrieval: Executes vector, full-text, and structured predicate queries within a single engine.
  • Unified Data Handling: Stores and queries the exact metadata needed for scoping right alongside the retrieved content.
  • Practical Integration: Offers MySQL-compatible connectivity, drastically simplifying integration into existing stacks and reducing moving parts for local deployments.

Practice Guide: RAGFlow × OceanBase seekdb

In the following quick-start guide, we will use the RAGFlow × seekdb integration as a concrete example. We will run RAGFlow using seekdb as the core retrieval engine (and optionally as the metadata store), and then build a simple application to validate the end-to-end indexing and retrieval process.

Prerequisites

Before you begin, make sure your environment meets the following requirements:

  • CPU >= 4 cores
  • RAM >= 16 GB
  • Disk >= 50 GB
  • Docker >= 24.0.0 & Docker Compose >= v2.26.1

Step 1: Get the code

Grab the RAGFlow source code and navigate to the Docker deployment directory:

git clone https://github.com/infiniflow/ragflow.git

cd ragflow/docker

Step 2: Configure seekdb for RAGFlow

RAGFlow uses .env for service configuration.

  1. Configure seekdb as the doc engine to handle the core hybrid retrieval workload:  
DOC_ENGINE=seekdb

2. (Optional) Set seekdb as the metadata database.If you want to reduce components (no separate MySQL container), point RAGFlow’s metadata DB to seekdb.

MYSQL_HOST=seekdb
MYSQL_DBNAME=test
MYSQL_PORT=2881

Step 3: Streamline the Docker Compose files

If you use seekdb for metadata, you should also remove the default MySQL dependency from the compose setup.

1. In docker-compose-base.yml, find the mysql: service block and comment it out:

# Lines 6~8
    # depends_on:
    #   mysql:
    #     condition: service_healthy
# Lines 54~56
    # depends_on:
    #   mysql:
    #     condition: service_healthy

2. In docker-compose-base.yml, find the mysql: service block and comment it out:

# Lines 176~202
  # mysql:
  #   # mysql:5.7 linux/arm64 image is unavailable.
  #   image: mysql:8.0.39
  #   env_file: .env
  #   environment:
  #     - MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
  #   command:
  #     --max_connections=1000
  # ...
  #   restart: unless-stopped

Step 4: Launch RAGFlow service

Start the RAGFlow instance in the background:

docker compose up -d

You can verify the container status using docker ps. To monitor the initialization process, check the logs (adjust -cpu to -gpu if you are running on a GPU machine):

docker compose logs -f ragflow-cpu
# or
docker compose logs -f ragflow-gpu

Once you see the message RAGFlow admin is ready after XXs initialization, the backend is successfully up and running.

Step 5: Build an AI application with RAGFlow

  1. Authenticate and configure models.
    1. Enter http://localhost in the browser to access the interface. For the first login, click Sign up to register an account, then sign in.
    2. Click your avatar in the top right corner and select Model providers.Input your preferred API key (e.g., Qwen) and click Save.
    3. Configure your models. For example: set the LLM to qwen-plus, the Embedding model to text-embedding-v4, and the Rerank model to gte-rerank.

2. Ingest data and build the document index.

    1. From the main interface, navigate to the Dataset tab and click the center icon to create a new knowledge base.
    2. Choose your segmentation method (e.g., General for standard text, or Q&A if uploading question-answer pairs), and click Save to create an knowledge base.
    3. In the Add File section on the right, click Upload file to add your test documents, then click Save.
    4. Select the uploaded documents from the list and click Parse to build the index in seekdb.

       

3. Retrieve and verify.

    1. From the main interface, navigate to the Search tab and click the + icon in the center to create a new search assistant.
    2. Give it a Name, link it to the dataset you just built, and optionally enable AI summary.
    3. Click Save.

   

All set up! Now you can test the pipeline by asking a question based on your uploaded documents (e.g., "Why is OceanBase a distributed database?"). The system will execute a hybrid search against seekdb, successfully retrieving the relevant context chunks and generating a precise, localized summary.

Conclusion: Retrieval is the runtime infrastructure for agents

In agent workflows, retrieval becomes a tight loop: it continuously pulls from documents, memory, and tool definitions to plan, execute, and self-correct. That raises the bar for the data layer. You need hybrid retrieval (vector + full-text + structured filters) with predictable latency, so each step stays grounded in the right context. Native AI search databases are well-suited to deliver this because they can execute these signals in a single, consistent retrieval path.

RAGFlow’s “tree + graph” approach is a practical example of where the industry is heading: from top-K chunks to context construction. OceanBase seekdb aligns with this direction through hybrid search, a unified data model, and lightweight deployment. More importantly, the conclusion is platform-agnostic: as agents move from prototypes to production, teams that treat retrieval as the first-class infrastructure, instead of an add on, will be the ones that ship reliable, scalable AI systems.

Build your data layer with seekdb now:  https://github.com/oceanbase/seekdb




ICON_SHARE
ICON_SHARE
linkedin
Contact Us