Skip to content

Local Development

The simplest way to use FlowRAG — everything runs locally, data files are Git-friendly.

Terminal window
npm install @flowrag/pipeline @flowrag/presets @flowrag/provider-gemini
import { 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'),
});
// Index
await rag.index('./content');
// Search
const results = await rag.search('how does authentication work');

FlowRAG offers two local presets:

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

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:

Terminal window
# Install globally
npm install -g @flowrag/cli
# Initialize
flowrag init
# Index documents
flowrag index ./content
flowrag index ./content --force # Re-index all
flowrag index ./content --interactive # Review entities
# Search
flowrag search "how does OCPP work"
# Stats
flowrag stats
flowrag graph stats

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.

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 database
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