Sandbox
@stevereiner/flexible-graphrag

GraphRAG backend and MCP server for document context

Flexible GraphRAG gives you a backend for ingesting documents from many sources, extracting entities and relationships, and querying the result with hybrid search and chat. It works with graph databases, RDF stores, vector databases, and search engines, and it exposes the system through REST, MCP, and three web frontends.

184 stars34 forksPythonUpdated 18d ago
Who it's for

Builders who want to connect documents, graphs, and search into an agent-friendly knowledge system.

What it delivers

You can feed an agent live document sources and get graph-backed answers instead of plain text retrieval.

What it does

Hybrid search

Combines vector search, full-text search, graph traversal, and SPARQL retrieval in one query path.

Knowledge graph auto-building

Extracts entities and relationships from documents and writes them into property graph and RDF stores.

Multi-source ingestion

Ingests files, cloud storage, enterprise repositories, web pages, Wikipedia, and YouTube.

Incremental auto-sync

Keeps supported sources and downstream stores updated with real-time or near real-time change detection.

MCP server

Exposes ingest, search, and query tools to Claude Desktop and other MCP clients.

Multiple frontends

Includes React, Vue, and Angular clients for sources, processing, search, and chat.

Framework and parser choice

Lets you choose LlamaIndex or LangChain per stage and use Docling, LlamaParse, or LiteParse for document parsing.

Optional visual pipelines

Can run ingestion, search, and query through Langflow flows or a CocoIndex pipeline.

How to get it

  1. 1Run
    cd flexible-graphrag
    uv pip install -e .
  2. 2Deploy Services
    # From the docker directory
    docker-compose -f docker-compose.yaml -p flexible-graphrag up -d
  3. 3Deploy Services
    # From the docker directory
    docker-compose -f docker-compose.yaml -p flexible-graphrag up -d
  4. 4Create environment file (cross-platform)
    # Linux/macOS
    cp flexible-graphrag/env-sample.txt flexible-graphrag/.env
    
    # Windows Command Prompt  
    copy flexible-graphrag\env-sample.txt flexible-graphrag\.env
  5. 5Navigate to the backend directory
    cd flexible-graphrag
  6. 6Create a .env file by copying the sample and customizing
    cp env-sample.txt .env   # Linux/macOS
    copy env-sample.txt .env  # Windows

README

Flexible GraphRAG

PyPI - flexible-graphrag Downloads - flexible-graphrag PyPI - flexible-graphrag-mcp Downloads - flexible-graphrag-mcp License: Apache 2.0 Python React Angular Vue Ask DeepWiki Docs

Flexible GraphRAG in Langflow pipeline mode: a SharePoint auto-sync source using Microsoft Graph delta queries, a PDF parsed by LiteParse, and one ingest populating Qdrant vector, Elasticsearch search, Neo4j property graph, and Graphwise GraphDB RDF at the same time, with the processing tab showing initial sync status and AI chat answering questions from an ontology-mode knowledge graph

Langflow pipeline mode — a SharePoint auto-sync data source (MS Graph delta query) ingesting and targeting Qdrant vector, Elasticsearch, Neo4j, and Graphwise Ontotext GraphDB, with ontology-mode, AI chat drawing context from all four.

Flexible GraphRAG v0.8.0 architecture: default, CocoIndex, and Langflow ingest pipelines sharing the same data sources, database targets, UI, and REST / MCP APIs

Can use 1 of 3 ingest pipelines with same configured data sources and database targets, with same UI and same REST / MCP APIs

Flexible GraphRAG is an open source AI context platform supporting a document processing pipeline (Docling, LlamaParse, or LiteParse), knowledge graph auto-building, ontologies, schemas, many LLM providers, GraphRAG and RAG, hybrid semantic search (fulltext, vector, property graph, RDF/SPARQL), AI query, and AI chat. The backend is Python with LlamaIndex and LangChain as peer frameworks. LlamaIndex is the default for each pipeline stage; LangChain can be selected per stage in environment configuration. The API is a REST FastAPI service. Angular, React, and Vue TypeScript frontends and an MCP server are included. The stack supports 14 data sources (10 with incremental auto-sync), 15 property graph databases, 4 RDF triple stores (Apache Jena Fuseki, Ontotext GraphDB, Oxigraph, Amazon Neptune RDF), 10 vector databases, OpenSearch / Elasticsearch / BM25 search, Alfresco, and Nuxeo. Databases and dashboards can be enabled with the provided Docker Compose layout. Optionally, the ingest pipeline, hybrid search, and AI query can run through customizable Langflow visual flows (12 custom Langflow components). As a further option, ingest can run on a CocoIndex (Rust engine) pipeline that reuses the same sources, targets, parsers and KG extractors, adding step-level memoization and automatic delete reconciliation.

New 8/18/26 — v0.8.0 release: Optional CocoIndex integration — Rust-backed CocoIndex pipeline mixed with Flexible GraphRAG sources (incl. detectors), functions, and targets (more PG/vector/RDF/search); same UI/REST/MCP. Standalone app.py also supported. Now with custom KG extractors (bring your own, or fall back to the built-in one per document) and entity resolution. New meeting-notes example (examples/cocoindex/meeting_notes_graph_any/) — a CocoIndex example ported to run against any configured graph store and source. See CocoIndex Integration.

New 8/8/26 — v0.7.2 release: Nuxeo added as a data source — all 3 UIs (React/Vue/Angular) plus REST/MCP, with basic / token / OAuth2 auth and real-time incremental sync via the Nuxeo audit event stream (Kafka). Alfresco OAuth2 and ticket authentication added across the source, all 3 UIs, initial ingest, and real-time sync. Alfresco Community 26.1 Docker upgrade. The MCP server gained optional OAuth2 on its transport (bearer token via your IdP) and moved to FastMCP 3. Requires python-alfresco-api >= 1.2.1.

New 7/20/26 — v0.7.1 release: Document processing now supports LiteParse in addition to the previous Docling and LlamaParse support. Langflow integration ships with fixes and an optional Langflow Docker image bundling the 12 "Flexible" components. MS Graph delta query support was added for more efficient incremental updating with SharePoint and OneDrive data sources.

New 7/5/26: Optional Langflow visual flows — the app can run its ingest pipeline, hybrid search, and AI query through customizable Langflow flows (12 custom Flexible GraphRAG components), using your existing .env config. See Langflow Integration.

New 5/6/26: 15 property graph databases total: 8 supported on both LlamaIndex and LangChain, 1 LI-only (Google Cloud Spanner Graph), 6 LC-only (ArangoDB, Apache AGE, Azure Cosmos DB for Gremlin, Apache HugeGraph, SurrealDB, TigerGraph). AWS Neptune RDF/SPARQL added. All 10 vector databases, all 3 search engines, and all LLM/embedding providers work with both LlamaIndex and LangChain. Every pipeline stage (chunking, KG extraction, graph write, vector write, search write, and retrieval fusion) can be configured independently. (Data source reading is LlamaIndex only; RDF stores use framework-independent adapters with LangChain Text-to-SPARQL retrieval.)

New: Flexible GraphRAG now supports RDF-based ontologies for both property graph databases and RDF triple store databases (Graphwise Ontotext GraphDB, Fuseki, and Oxigraph). Document ingestion with KG extraction, auto incremental data source change detection, and UI search (hybrid search, AI query, and AI chat) are all supported with both database types.

New: Flexible GraphRAG supports automatic incremental updates (Optional) from most data sources, keeping your Vector, Search and Graph databases synchronized in real-time or near real-time.

New: KG Spaces Integration of Flexible GraphRAG in Alfresco ACA Client

New in v0.6.0: Version 0.6.0 broadened framework and database choice: LangChain is a full peer to LlamaIndex (per-stage env pickers for chunking, vector, search, property graph, KG extraction, fusion). 15 property graph backends: 8 on both frameworks, Google Cloud Spanner (LlamaIndex-only), 6 LangChain-only (ArangoDB, Apache AGE, Azure Cosmos DB for Gremlin, HugeGraph, SurrealDB, TigerGraph). RDF includes Apache Jena Fuseki, Ontotext GraphDB, Oxigraph, and Amazon Neptune RDF. Incremental delete, LangChain adapters, and cleanup paths were extended across stores.

Features

  • Hybrid Search: Configurable hybrid search combining vector search, full-text search, property-graph GraphRAG, and SPARQL against RDF stores.
  • Knowledge Graph GraphRAG: Extracts entities and relationships from documents to build graphs in property graph databases and RDF stores. Optional schemas and ontologies guide extraction or act as a starting point for the LLM to extend.
  • RDF/Ontology Support: Load OWL/RDFS ontologies to guide KG extraction into any property graph or RDF store; SPARQL 1.1 queries; RDF 1.2 triple annotations; full UI pipeline (ingest, hybrid search, AI query/chat, incremental auto-sync). See Ontology and RDF Support below.
  • 15 Property Graph Databases: 8 on both LI+LC (Neo4j, ArcadeDB, FalkorDB, Ladybug, Memgraph, NebulaGraph, Amazon Neptune, Neptune Analytics), 1 LI-only (Google Cloud Spanner), 6 LC-only (ArangoDB, Apache AGE, Cosmos Gremlin, HugeGraph, SurrealDB, TigerGraph) — with KG extraction, hybrid search, and AI query/chat
  • 4 RDF Triple Stores: Apache Jena Fuseki, Ontotext GraphDB, Oxigraph, Amazon Neptune RDF.
  • 10 Vector Databases: Qdrant, Elasticsearch, OpenSearch, Neo4j, Chroma, Milvus, Weaviate, Pinecone, PostgreSQL pgvector, LanceDB — for semantic similarity search
  • 3 Search Databases: Elasticsearch, OpenSearch, BM25 (built-in) — for full-text search and hybrid ranking
  • LLM providers (KG extraction & chat): Ollama, OpenAI, Azure OpenAI, Google Gemini, Anthropic Claude, Google Vertex AI, Amazon Bedrock, Groq, Fireworks AI, OpenAI-compatible endpoints (openai_like), OpenRouter, LiteLLM proxy, and vLLM — configurable via LLM_PROVIDER; see Supported LLM Providers
  • Embedding providers: OpenAI, Ollama, Azure OpenAI, Google GenAI, Vertex AI, Bedrock, Fireworks, OpenAI-like (EMBEDDING_KIND=openai_like), and LiteLLM — see LLM Configuration
  • Dual-framework pipeline: LlamaIndex and LangChain are first-class choices for chunking, vector and search adapters, property graphs, KG extraction, RDF text-to-SPARQL retrieval, and hybrid fusion—each stage can be set independently (LlamaIndex defaults). See Framework Configuration.
  • Multi-Source Ingestion: Processes documents from 14 data sources (10 with incremental auto sync): (file upload, cloud storage, enterprise repositories, web sources) with Docling (default), LlamaParse (cloud API), or LiteParse (local, lightweight) document parsing.
  • Observability: Built-in OpenTelemetry instrumentation with automatic LlamaIndex tracing, Prometheus metrics, Jaeger traces, and Grafana dashboards for production monitoring
  • FastAPI Server with REST API: Python based FastAPI server with REST APIs for document ingesting, hybrid search, AI query, and AI chat.
  • MCP Server: MCP server providing Claude Desktop and other MCP clients with tools for document/text ingesting (all 14 data sources with 10 supporting incremental auto sync), hybrid search, and AI query. Uses FastAPI backend REST APIs.
  • UI Clients: Angular, React, and Vue UI clients support choosing the data source (filesystem, Alfresco, CMIS, etc.), ingesting documents, performing hybrid searches, AI queries, and AI chat. The UI clients use the REST APIs of the FastAPI backend.
  • Docker Deployment Flexibility: Supports both standalone and Docker deployment modes. Docker infrastructure provides modular database selection via docker-compose includes - vector, graph, search engines, and Alfresco can be included or excluded with a single comment. Choose between hybrid deployment (databases in Docker, backend and UIs standalone) or full containerization.
  • Langflow Visual Flows (optional): Run the ingest pipeline, hybrid search, and AI query through customizable Langflow flows built from 12 custom Flexible GraphRAG components — the same backend machinery (all database, LLM, and framework .env config applies), orchestrated visually. See Langflow Integration.
  • CocoIndex Integration (optional): Optional Rust-backed CocoIndex ingest (PIPELINE_BACKEND=cocoindex) mixing CocoIndex connectors with Flexible GraphRAG sources (incl. event detectors), parsers, chunkers, embeddings, LI/LC KG extractors, and broader targets (all 15 PG + 10 vector + RDF + search) — same UI / REST / MCP. Mutually exclusive with ENABLE_INCREMENTAL_UPDATES=true and ENABLE_LANGFLOW_FLOWS=true. Standalone app.py also supported. See CocoIndex Integration.

Frontend Screenshots

Angular Frontend - Tabbed Interface

Click to view Angular UI screenshots (Light Theme)
Sources TabProcessing TabSearch TabChat Tab
Angular SourcesAngular ProcessingAngular SearchAngular Chat

React Frontend - Tabbed Interface

Click to view React UI screenshots (Dark Theme)
Sources TabProcessing TabSearch TabChat Tab
React SourcesReact ProcessingReact SearchReact Chat
Click to view React UI screenshots (Light Theme)
Sources TabProcessing TabSearch TabChat Tab
React Sources LightReact Processing LightReact Search LightReact Chat Light

Vue Frontend - Tabbed Interface

Click to view Vue UI screenshots (Light Theme)
Sources TabProcessing TabSearch TabChat Tab
Vue SourcesVue ProcessingVue SearchVue Chat

System Components

FastAPI Backend (/flexible-graphrag)

  • REST API Server: Provides endpoints for document ingestion, search, and AI query/chat
  • Hybrid Search Engine: Combines vector similarity (RAG), fulltext (BM25), and graph traversal (GraphRAG)
  • Document Processing: Advanced document conversion with Docling, LlamaParse, and LiteParse integration
  • Configurable Architecture: Environment-based configuration for all components
  • Async Processing: Background task processing with real-time progress updates

MCP Server (/flexible-graphrag-mcp)

  • MCP Client support: Model Context Protocol server for Claude Desktop and other MCP clients
  • Full API Parity: Tools like ingest_documents() support all 14 data sources with source-specific configs: filesystem, repositories (Alfresco, SharePoint, Box, CMIS, Nuxeo), cloud storage, web; skip_graph flag for all data sources; paths parameter for filesystem/Alfresco/CMIS; Alfresco also supports nodeDetails list (multi-select for KG Spaces)
  • Additional Tools: search_documents(), query_documents(), ingest_text(), system diagnostics, and health checks
  • Dual Transport: HTTP mode for debugging, stdio mode for production
  • Tool Suite: 9 specialized tools for document processing, search, and system management
  • Multiple Installation: pipx system installation or uvx no-install execution

UI Clients (/flexible-graphrag-ui)

  • Angular Frontend: Material Design with TypeScript
  • React Frontend: Modern React with Vite and TypeScript
  • Vue Frontend: Vue 3 Composition API with Vuetify and TypeScript
  • Unified Features: All clients support the 4 tab views, async processing, progress tracking, and cancellation

Docker Infrastructure (/docker)

  • Modular Database Selection: Include/exclude vector, graph, and search engines, and Alfresco with single-line comments
  • Flexible Deployment: Hybrid mode (databases in Docker, apps standalone) or full containerization
  • NGINX Reverse Proxy: Unified access to all services with proper routing
  • Built-in Database Dashboards: Most server dockers also provide built-in web interface dashboards (Neo4j browser, ArcadeDB, FalkorDB, OpenSearch, etc.)
  • Separate Dashboards: Additional dashboard dockers are provided: including Kibana for Elasticsearch and optional Ladybug Explorer (see docker/includes/ladybug-explorer.yaml).

Data Sources

Flexible GraphRAG supports 14 different data sources for ingesting documents into your knowledge base (Nuxeo missing from older screenshots):

Data Sources

Flexible GraphRAG data sources, processing tab, auto-sync document states in Postgres, Neo4j

Flexible GraphRAG data sources, processing tab, auto-sync document states in Postgres (default pipeline, with auto incremental update system enabled), Neo4j shown (Qdrant, Elasticsearch not shown)

File & Upload Sources

  1. File Upload - Direct file upload through web interface with drag & drop support

Cloud Storage Sources

  1. Amazon S3 - AWS S3 bucket integration
  2. Google Cloud Storage (GCS) - Google Cloud storage buckets
  3. Azure Blob Storage - Microsoft Azure blob containers
  4. OneDrive - Microsoft OneDrive personal/business storage
  5. Google Drive - Google Drive file storage

Enterprise Repository Sources

  1. Alfresco - Alfresco ECM/content repository with two integration options:
    • KG Spaces ACA Extension - Integrates the Flexible GraphRAG Angular UI as an extension plugin within the Alfresco Content Application (ACA), enabling multi-select document/folder ingestion with nodeIds directly from the Alfresco interface
    • Flexible GraphRAG Alfresco Data Source - Direct integration using Alfresco paths (e.g., /Shared/GraphRAG, /Company Home/Shared/GraphRAG, or /Shared/GraphRAG/cmispress.txt)
  2. Nuxeo - Nuxeo content repository (File and Note documents); basic / token (X-Authentication-Token) / OAuth2 auth, path or node selection, and real-time incremental sync via the Nuxeo audit event stream (Kafka)
  3. SharePoint - Microsoft SharePoint document libraries
  4. Box - Box.com cloud storage
  5. CMIS (Content Management Interoperability Services) - Industry-standard content repository interface

Web Sources

  1. Web Pages - Extract content from web URLs
  2. Wikipedia - Ingest Wikipedia articles by title or URL
  3. YouTube - Process YouTube video transcripts

Each data source includes:

  • Configuration Forms: Easy-to-use interfaces for credentials and settings
  • Progress Tracking: Real-time per-file progress indicators
  • Flexible Authentication: Support for various auth methods (API keys, OAuth, service accounts)

Incremental Updates & Auto-Sync

NEW! Flexible GraphRAG supports automatic incremental updates (Optional) from most data sources, keeping your Vector, Search and Graph databases synchronized in real-time or near real-time:

Data SourceAuto-Sync SupportDetection MethodStatusNotes
Alfresco✅ Real-timeApache ActiveMQReady
Nuxeo✅ Real-timeNuxeo audit stream (Kafka)Ready
Amazon S3✅ Real-timeSQS event notificationsReady
Azure Blob Storage✅ Real-timeChange feedReady
Google Cloud Storage✅ Real-timePub/Sub notificationsReady
Google Drive✅ Near real-timeChanges API (polling)Ready
OneDrive✅ Near real-timeMS Graph delta queryReady
SharePoint✅ Near real-timeMS Graph delta queryReady
Box✅ Near real-timeEvents API (polling)Ready
Local Filesystem✅ Real-timeOS events (watchdog)ReadyREST API and MCP Server only
File Upload UI, CMIS, Web Pages, Wikipedia, YouTube➖ Not supported--No support for incremental updates

Features:

  • Modification Date Tracking: Uses file modification timestamps (ordinal) to detect changes
  • Content Hash Optimization: Skips reprocessing when file modification date changed but content hasn't
  • Dual Mechanism: Event-driven streams (real-time) + periodic polling fallback
  • LlamaIndex Integration: Uses proper abstractions for all databases
  • UI, REST API, MCP Server: Setting up an auto update data source location can be done thru the 3 UIs, with the REST API, or with the MCP server

Setup Requirements:

Enable incremental updates in your .env file:

ENABLE_INCREMENTAL_UPDATES=true

# PostgreSQL database for state management
# By default, uses the pgvector database from docker-compose.yaml
POSTGRES_INCREMENTAL_URL=postgresql://postgres:password@localhost:5433/postgres

Note: The incremental updates system uses PostgreSQL to track document state. The docker-compose.yaml includes a pgvector container that can be used both as a vector database option and for incremental updates state management. The database connection creates the necessary tables automatically on first use.

Usage:

  • Check the "Enable auto change sync" checkbox in the Processing tab when configuring your data source
  • For S3: Also provide the "SQS Queue URL" for event notifications
  • For GCS: Also provide the "Pub/Sub Subscription Name" for real-time updates

PostgreSQL for State Management:

The docker/includes/postgres-pgvector.yaml sets up two databases automatically on first start: flexible_graphrag (for optional pgvector vector storage) and flexible_graphrag_incremental (for incremental update state management, with its schema created automatically). pgAdmin is also configured at http://localhost:5050 with both databases pre-registered — just enter the master password admin when prompted, then use password for the server connection and save it. See docs/DATABASES/POSTGRES-SETUP.md for details.

Documentation:

  • System overview: [docs/DATA-SOURCES/INCREMENTAL-UPDATE-AUTO-SYNC/README.md](docs/DATA-SOURCES

Files in the repo

Repository payload22 top-level entries
  • .github
  • docker
  • docs
  • examples
  • flexible-graphrag
  • flexible-graphrag-mcp
  • flexible-graphrag-ui
  • flows
  • images
  • sample-docs
  • schemas
  • screen-shots
  • scripts
  • tests
  • .gitattributes
  • .gitignore
  • CHANGELOG.md
  • LICENSE
  • pytest.ini
  • README.md
  • sample-launch.json
  • zensical.toml

Discussion (0)

Ask about usage, or say what you built with it

Sign in to join the discussion.

No comments yet. Be the first to say what this is good for.

More frameworks & sdks

HKUDS/nanobotFrameworks & SDKs

Ultra-lightweight, open-source, self-hosted personal AI agent framework in Python with WebUI, tools, memory, MCP, multi-agent workflows, automation, and chat apps

48k
microsoft/
SkillOpt
microsoft/SkillOptFrameworks & SDKs

SkillOpt is a text-space optimizer that trains reusable natural-language skills for frozen LLM agents through trajectory-driven edits, validation-gated updates, and deployable best_skill.md artifacts.

17k
omnigent-ai/omnigentFrameworks & SDKs

Omnigent is an open-source AI agent framework and meta-harness: orchestrate Claude Code, Codex, Cursor, Pi, and custom agents — swap harnesses without rewriting, enforce policies and sandboxing, and collaborate in real time from any device.

9.8k
kyegomez/
OpenMythos
kyegomez/OpenMythosFrameworks & SDKs

A theoretical reconstruction of the Claude Mythos architecture, built from first principles using the available research literature.

15k
D4Vinci/ScraplingFrameworks & SDKs

🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

80k