# Repository Briefing: VexDB-THU/VexDB-Lite
> Source: https://repoforai.com/repo/VexDB-THU/VexDB-Lite (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/VexDB-THU/VexDB-Lite
- **Official Docs / Website**: https://vexdb.com
- **Category**: RAG, Data & Memory (知识库 / 爬虫 / 记忆层)
- **Primary Language**: C++
- **License**: MIT
- **Engineering Health**: A (86/100 · Maintenance 31/35 · Adoption 21/25 · Releases 14/20 · License 20/20)
- **Latest Release**: v0.0.17 (2026-07-29) — https://github.com/VexDB-THU/VexDB-Lite/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Self-Hosted
- **Momentum**: 2,318 ★ total (+0 24h / +0 7d) · 359 forks
- **When to Use**: Best for: Self-hosted RAG that keeps embeddings and metadata in an existing PostgreSQL deployment, DuckDB pipeline, or local SQLite application, with a team able to validate recall, filtering, and recovery on the chosen engine. Skip if: You need a managed vector service, cannot install native extensions, or require built-in graph sharding or the commercial edition's index HA features.

## Overview
```text
### Architecture & Core Mechanics
VexDB-Lite is an in-process vector indexing extension for PostgreSQL, DuckDB, and SQLite, not a standalone vector service. Its shared C++17 core in common/ contains the graph algorithm, CPU SIMD distance dispatch, and PQ and RaBitQ kernels. The host adapters own SQL integration, index lifecycle, and persistence, so the shared search implementation does not imply a common SQL or deployment interface.

PostgreSQL adds floatvector(N) and the vexdb_graph index access method, with DML and WAL integration and an optimizer rewrite to an ANN index scan. DuckDB indexes native FLOAT[N] arrays and can rewrite eligible queries to VEXDB_INDEX_SCAN; it persists the index through DuckDB serialization. SQLite uses a virtual-table interface with transaction support and can also store database-managed files through VexFS. Validate query plans or index behavior on the host you intend to deploy rather than assuming that an ORDER BY with LIMIT uses the index.

### Key Capabilities & Differentiators
All three adapters expose L2, cosine, and inner-product search. PostgreSQL and DuckDB expose build controls such as m, ef_construction, and parallel_workers, plus a query-time ef_search setting under engine-specific names. Both have vector buffer caches. PQ trains a codebook and can refine results; RaBitQ estimates distances from quantized representations. Both offer compact index-side storage, which does not imply that the base table's vectors are compressed. On PostgreSQL, a standard PQ build with fewer than 256 training samples or too little build memory falls back to a plain graph with a NOTICE; compact mode instead requires an active quantizer.

DuckDB uses exact filtering by default; filtered ANN is opt-in. SQLite supports incremental INSERT, UPDATE, and DELETE, metadata filtering, LIMIT pushdown, and memory or disk modes. VexFS adds files, directories, version history, restore, and integrity checks. Its optional FTS5 trigram index accelerates file grep; without the index or FTS5, grep scans the database through one connection.

### Trade-offs & Limitations
The SIFT-1M benchmark measures throughput and recall on 128-dimensional vectors with m=16 and ef_construction=128 on an Intel Core Ultra 7-265K with 16 GB of RAM. At ef_search=100 and 16 readers, PostgreSQL VexDB-Lite reached 7,883.1 QPS at 98.62% Recall@10 versus pgvector's 4,272.5 QPS at 98.82%. On DuckDB, VexDB-Lite reached 5,379.1 QPS at 98.40% versus VSS's 4,433.3 QPS at 98.04%. These are same-setting comparisons, not recall-matched tests. They do not establish latency tails, performance under selective filters, or write-heavy behavior.

The extension avoids a separate vector service when SQL data and embeddings already live in the same host, but it leaves operations with your team. The open PostgreSQL edition lacks the commercial VexDB edition's index HA, graph sharding, and asynchronous insertion features. DuckDB VexDB-Lite offers serialized persistence but lacks the index compaction listed for DuckDB VSS; include sustained deletes in storage tests. Against managed Pinecone, the decision is about who owns deployment, recovery, and capacity as much as retrieval throughput.

### Hardware & Deployment Guide
This is self-hosted software installed into the chosen database runtime. PostgreSQL support spans versions 16–19, with primary validation on 19. Build with CMake 3.14 or newer, a C++17 compiler (GCC 9+ or Clang 10+), and the target installation's pg_config. Add vexdb_lite to shared_preload_libraries, restart PostgreSQL, then run CREATE EXTENSION vexdb_lite. Confirm the target host permits extension installation and a restart before selecting the PostgreSQL path.

DuckDB builds require Git and CMake 3.28 to below 4.0. build_duck.sh configures the extension in the DuckDB v1.5.2 source tree and appends the required metadata footer; the resulting binary must match the exact runtime version. If loading an unsigned local build, use only artifacts you trust. Run the SQLite build and tests with bash build_sqlite.sh test; the macOS preview bundles SQLite 3.45.3 with automatic registration. Stable v0.0.17 added SQLite and aligned quantization across all three hosts. Prerelease v0.0.18-rc.1 restores mainline RaBitQ support and PostgreSQL extension upgrade paths while retaining search defaults; test the upgrade and recovery path on your host before rollout.
```

## Key Capabilities
```text
- Shared core: C++17 graph indexing, CPU SIMD distance dispatch, and PQ/RaBitQ kernels serve three host engines.
- PostgreSQL: floatvector(N), the vexdb_graph index method, a shared-memory vector buffer, and parallel index builds.
- DuckDB: GRAPH_INDEX on FLOAT[N] with VEXDB_INDEX_SCAN rewrites, serialized persistence, and opt-in filtered ANN.
- SQLite: A transactional virtual-table graph index supports INSERT, UPDATE, and DELETE and persists across restarts; VexFS adds database-managed files.
- Quantization: Compact storage reduces the index-side vector footprint; PostgreSQL requires an active quantizer in compact mode.
- Versioning: v0.0.17 adds SQLite; v0.0.18-rc.1 restores mainline RaBitQ support and PostgreSQL extension upgrade paths without changing search defaults.
```

## Quick Start / Clone
```bash
vexdb agent.db
vexdb agent.db "SELECT vexdb_l2_distance('[1,2]', '[4,6]');"
vexdb fs --db agent.db write /notes/hello.txt
vexdb fs --db agent.db grep -n hello /notes
vexdb fs --db agent.db check
vexdb fs --db agent.db index enable
vexdb fs --db agent.db mount ~/VexDB
```
