Documentation
Databases
Databases
Databases
PostgreSQL requirements
The RAG store relies on PostgreSQL with these extensions:
vector(pgvector)zhparser(full-text search configzhcn_search)hstore(token cache)
Schema creation
There are two paths:
- Automatic (recommended): The ingestion pipeline (
rag-clior/api/rag/upsert) callsstore.EnsureSchema, which creates thedocumentstable, indexes, and thezhcn_searchtext search config. - Manual:
sql/schema.sqlcreates a similar schema but usespg_jiebaandjieba_search. If you use this file, make sure your query path and text search configuration align with the runtime code.
Tables
documents: embeddings, metadata, andtsvectorfor hybrid retrieval.cache_kv: unlogged cache table storing token validation results (hstore).admin_settings: stored via migrations inmigrations/.
Connection configuration
Preferred config key:
global.vectordb.pgurl: full connection DSN.
Alternative keys (used when pgurl is empty):
pg_host,pg_port,pg_user,pg_password,pg_db_name,pg_sslmode
Feedback