Local Development
The simplest way to use FlowRAG — everything runs locally, data files are Git-friendly.
npm install @flowrag/pipeline @flowrag/presets @flowrag/provider-geminiimport { defineSchema } from '@flowrag/core';import { createFlowRAG } from '@flowrag/pipeline';import { createLocalStorage } from '@flowrag/presets';
const schema = defineSchema({ entityTypes: ['SERVICE', 'DATABASE', 'PROTOCOL'], relationTypes: ['USES', 'PRODUCES', 'CONSUMES'],});
const rag = createFlowRAG({ schema, ...createLocalStorage('./data'),});
// Indexawait rag.index('./content');
// Searchconst results = await rag.search('how does authentication work');Storage Presets
Section titled “Storage Presets”FlowRAG offers two local presets:
createLocalStorage() (LanceDB)
Section titled “createLocalStorage() (LanceDB)”The default preset. Uses LanceDB for vector search — optimized for large datasets.
| Storage | Implementation | Path |
|---|---|---|
| KV | JSON files | ./data/kv/ |
| Vector | LanceDB | ./data/vectors/ |
| Graph | SQLite | ./data/graph.db |
createSQLiteStorage() (Lightweight)
Section titled “createSQLiteStorage() (Lightweight)”Uses sqlite-vec for vector search — smaller native binaries (~2MB vs ~50MB).
import { createSQLiteStorage } from '@flowrag/presets';
const rag = createFlowRAG({ schema, ...createSQLiteStorage('./data'),});| Storage | Implementation | Path |
|---|---|---|
| KV | JSON files | ./data/kv/ |
| Vector | SQLite + sqlite-vec | ./data/vectors.db |
| Graph | SQLite | ./data/graph.db |
For quick local usage without writing code:
# Install globallynpm install -g @flowrag/cli
# Initializeflowrag init
# Index documentsflowrag index ./contentflowrag index ./content --force # Re-index allflowrag index ./content --interactive # Review entities
# Searchflowrag search "how does OCPP work"
# Statsflowrag statsflowrag graph statsGit-Friendly
Section titled “Git-Friendly”The ./data directory contains plain files:
- JSON files for KV storage
- SQLite databases for the knowledge graph and (optionally) vector embeddings
- LanceDB files for vector embeddings (if using
createLocalStorage)
You can commit these to your repo for a fully portable knowledge base.
Storage Layout
Section titled “Storage Layout”With createLocalStorage (LanceDB)
Section titled “With createLocalStorage (LanceDB)”data/├── kv/│ ├── doc:readme.json│ ├── chunk:readme:0.json│ ├── extraction:a1b2c3.json # LLM cache│ └── docHash:doc:readme.json # Incremental indexing├── vectors/│ └── chunks.lance/ # LanceDB table└── graph.db # SQLite databaseWith createSQLiteStorage (sqlite-vec)
Section titled “With createSQLiteStorage (sqlite-vec)”data/├── kv/│ ├── doc:readme.json│ ├── chunk:readme:0.json│ ├── extraction:a1b2c3.json│ └── docHash:doc:readme.json├── vectors.db # SQLite + sqlite-vec└── graph.db # SQLite database