Getting Started
Installation
Section titled “Installation”For a complete local setup with presets:
npm install @flowrag/pipeline @flowrag/presetsOr install individual packages:
npm install @flowrag/core @flowrag/pipeline \ @flowrag/storage-json @flowrag/storage-sqlite @flowrag/storage-lancedb \ @flowrag/provider-local @flowrag/provider-geminiFor AWS cloud deployment:
npm install @flowrag/provider-bedrock @flowrag/storage-s3 @flowrag/storage-opensearchQuick Start
Section titled “Quick Start”import { defineSchema } from '@flowrag/core';import { createFlowRAG } from '@flowrag/pipeline';import { createLocalStorage } from '@flowrag/presets';
// 1. Define your schemaconst schema = defineSchema({ entityTypes: ['SERVICE', 'DATABASE', 'PROTOCOL'], relationTypes: ['USES', 'PRODUCES', 'CONSUMES'],});
// 2. Create RAG instanceconst rag = createFlowRAG({ schema, ...createLocalStorage('./data'),});
// 3. Index documentsawait rag.index('./content');
// 4. Searchconst results = await rag.search('how does authentication work');That’s it. FlowRAG scans your files, chunks them, extracts entities and relations via LLM, generates embeddings, and stores everything locally.
What Happens Under the Hood
Section titled “What Happens Under the Hood”When you call rag.index():
- Scanner reads files from the input path
- Chunker splits documents into ~1200 token chunks with overlap
- Extractor (LLM) identifies entities and relations in each chunk
- Embedder generates vector embeddings for semantic search
- Storage saves documents, vectors, and the knowledge graph
When you call rag.search():
- Your query is embedded into a vector
- Vector search finds semantically similar chunks
- Graph traversal follows entity relationships for connected context
- Results are merged, deduplicated, and optionally reranked
What’s Next?
Section titled “What’s Next?”- Schema Definition — custom entity types, relation types, and fields
- Indexing — chunking, caching, incremental indexing
- Querying — query modes, dual retrieval, data flow tracing
- Providers — choose your embedder, extractor, and reranker
- Deployment — local CLI or AWS Lambda