[Feature Request]: add Vastbase as document engine and metadata database
Summary
We would like to contribute support for Vastbase G100 as an alternative storage
backend for RAGFlow, in two steps: first as a DOC_ENGINE backend (chunk store +
message store, replacing Elasticsearch), then as the metadata/business database
(replacing MySQL). The goal is that Vastbase users can run the latest RAGFlow releases
with the official community image, with the entire data layer on Vastbase. Before
opening the PR (~2k lines), we'd like to check whether the community is interested in
accepting and maintaining this backend.
What is Vastbase
Vastbase G100 is a commercial, PostgreSQL-compatible database from Vastdata, widely deployed in enterprise environments. Capabilities relevant to RAGFlow:
- PostgreSQL wire protocol and SQL dialect (mysql compatibility modes)
floatvectortype with vector similarity search- ParadeDB-style full-text search (
@~@operator,bm25_score()), so BM25 + vector hybrid scoring can run inside the database - Graph index support (relevant to GraphRAG)
- Full transactional OLTP, suitable for the metadata/business layer as well
Motivation
A growing number of Vastbase users want RAGFlow with Vastbase as the document engine — typically organizations that have standardized on Vastbase as their database platform. What they expect is the standard community experience, not a patched distribution:
- Run the latest RAGFlow release, not a fork frozen at an old version;
- Deploy with the official
infiniflow/ragflowimage — setDOC_ENGINE=vastbaseandDB_TYPE=vastbase, point it at their Vastbase server, done; - Put the entire data layer on one database: chunks, vectors, messages and metadata — one system to deploy, back up, monitor and secure, instead of operating Elasticsearch and MySQL alongside RAGFlow;
- Have engine compatibility maintained inside the community release cycle, so each RAGFlow upgrade keeps working instead of silently breaking the backend.
Proposed scope
Step 1 — document engine (initial PR, self-contained):
rag/utils/vastbase_conn.py—VBConnection(DocStoreConnection)for the chunk storememory/utils/vastbase_conn.py— message store- Registration in
common/settings.pybehindDOC_ENGINE=vastbase - Opt-in compose service under
profiles: [vastbase](activated via the existingCOMPOSE_PROFILES=${DOC_ENGINE}mechanism — zero impact on default deployments)
Step 2 — metadata/business database (follow-up PR):
- A
DB_TYPE=vastbasepeewee backend reusing the existing PostgreSQL pooled/retrying database classes, replacing MySQL as the metadata store
Both steps use psycopg2, already a dependency — no new Python dependencies, which also means the existing official image works with Vastbase as-is, with no build changes. An ES→Vastbase migration tool is planned as a further follow-up.
Questions for maintainers
- Is a Vastbase backend something you're willing to accept?
- Is the two-step sequencing (doc engine first, metadata DB second) acceptable, or would you rather review them together / differently scoped?
We are committed to maintaining this integration long-term, including follow-ups (migration tooling). Happy to adjust the design based on feedback before submitting. Thanks!
Source: infiniflow/ragflow