{"id":31215087,"url":"https://github.com/bibinprathap/VeritasGraph","last_synced_at":"2025-09-21T11:03:17.220Z","repository":{"id":313941975,"uuid":"1051546963","full_name":"bibinprathap/VeritasGraph","owner":"bibinprathap","description":"VeritasGraph: Enterprise-Grade Graph RAG for Secure, On-Premise AI with Verifiable Attribution","archived":false,"fork":false,"pushed_at":"2025-09-14T18:49:30.000Z","size":4211,"stargazers_count":143,"open_issues_count":1,"forks_count":11,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-18T14:41:23.222Z","etag":null,"topics":["data-privacy","enterprise-ai","explainable-ai","fine-tuning","generative-ai","generativeai","graph-rag","information-retrieval","knowledge-graph","langchain","llamaindex","llm","lora","multi-hop-reasoning","neo4j","nlp","ollama","on-premise","question-answering","rag"],"latest_commit_sha":null,"homepage":"https://bibinprathap.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bibinprathap.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-06T08:10:17.000Z","updated_at":"2025-09-15T10:24:41.000Z","dependencies_parsed_at":"2025-09-18T14:39:42.508Z","dependency_job_id":null,"html_url":"https://github.com/bibinprathap/VeritasGraph","commit_stats":null,"previous_names":["bibinprathap/veritasgraph"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bibinprathap/VeritasGraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bibinprathap%2FVeritasGraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bibinprathap%2FVeritasGraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bibinprathap%2FVeritasGraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bibinprathap%2FVeritasGraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bibinprathap","download_url":"https://codeload.github.com/bibinprathap/VeritasGraph/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bibinprathap%2FVeritasGraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275861956,"owners_count":25541895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-18T02:00:09.552Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-privacy","enterprise-ai","explainable-ai","fine-tuning","generative-ai","generativeai","graph-rag","information-retrieval","knowledge-graph","langchain","llamaindex","llm","lora","multi-hop-reasoning","neo4j","nlp","ollama","on-premise","question-answering","rag"],"created_at":"2025-09-21T11:00:58.437Z","updated_at":"2025-09-21T11:03:17.212Z","avatar_url":"https://github.com/bibinprathap.png","language":"Python","funding_links":[],"categories":["Libraries","Python"],"sub_categories":["General-Purpose Machine Learning"],"readme":"# VeritasGraph  \n**Enterprise-Grade Graph RAG for Secure, On-Premise AI with Verifiable Attribution**\n \n\u003cimg src=\"https://github.com/bibinprathap/VeritasGraph/blob/master/VeritasGraph.jpeg\" alt=\"Project Logo\" style=\"max-width:140px; height:150px;\"\u003e\n\nVeritasGraph is a production-ready, end-to-end framework for building advanced question-answering and summarization systems that operate entirely within your private infrastructure.  \n\nIt is architected to overcome the fundamental limitations of traditional vector-search-based Retrieval-Augmented Generation (RAG) by leveraging a knowledge graph to perform complex, multi-hop reasoning.  \n\nBaseline RAG systems excel at finding direct answers but falter when faced with questions that require connecting disparate information or understanding a topic holistically. **VeritasGraph addresses this challenge directly, providing not just answers, but transparent, auditable reasoning paths with full source attribution for every generated claim, establishing a new standard for trust and reliability in enterprise AI.**\n\u003cp align=\"center\"\u003e \n\u003cimg alt=\"stars\" title=\"stars\" src=\"https://img.shields.io/github/stars/bibinprathap/VeritasGraph\" /\u003e\n\u003cimg alt=\"issues\" title=\"issues\" src=\"https://img.shields.io/github/issues/bibinprathap/VeritasGraph\" /\u003e\n\u003cimg alt=\"forks\" title=\"forks\" src=\"https://img.shields.io/github/forks/bibinprathap/VeritasGraph\" /\u003e \n\u003cimg alt=\"license\" title=\"license\" src=\"https://img.shields.io/github/license/bibinprathap/VeritasGraph\" /\u003e\n\u003ca href=\"https://linkedin.com/in/bibin-prathap-4a34a489/\"\u003e\n\u003cimg src=\"https://img.shields.io/badge/LinkedIn-blue?style=flat\u0026logo=linkedin\u0026labelColor=blue\"\u003e\n\u003c/a\u003e\n\n\u003c/p\u003e\n\n**[➡️⚡️ Live documentation](https://bibinprathap.github.io/VeritasGraph/index.html)**\n\n**[📖 Article](https://medium.com/@bibinprathap/beyond-vector-search-building-trustworthy-enterprise-ai-with-the-veritasgraph-rag-pipeline-53fc8e9e8ff9)**\n\n \n---\n## Why VeritasGraph?\n\n### ✅ Fully On-Premise \u0026 Secure\nMaintain **100% control** over your data and AI models, ensuring maximum security and privacy.\n\n### ✅ Verifiable Attribution\nEvery generated claim is **traced back** to its source document, guaranteeing transparency and accountability.\n\n### ✅ Advanced Graph Reasoning\nAnswer **complex, multi-hop questions** that go beyond the capabilities of traditional vector search engines.\n\n### ✅ Open-Source \u0026 Sovereign\nBuild a **sovereign knowledge asset**, free from vendor lock-in, with full ownership and customization.\n\n## 🚀 Demo  \n\n### Video Walkthrough  \nA brief video demonstrating the core functionality of VeritasGraph, from data ingestion to multi-hop querying with full source attribution.  \n\n[![Video Walkthrough](https://github.com/bibinprathap/VeritasGraph/blob/master/assets/graphrag.JPG)](https://drive.google.com/file/d/1lEmAOUCLV0h98kY-ars96SNf5O6lVmiY/view?usp=sharing)  \n\n \n---\n\n### System Architecture Screenshot  \nThe following diagram illustrates the end-to-end pipeline of the VeritasGraph system:  \n \n\n```mermaid \n graph TD\n    subgraph \"Indexing Pipeline (One-Time Process)\"\n        A --\u003e B{Document Chunking};\n        B --\u003e C{\"LLM-Powered Extraction\u003cbr/\u003e(Entities \u0026 Relationships)\"};\n        C --\u003e D[Vector Index];\n        C --\u003e E[Knowledge Graph];\n    end\n\n    subgraph \"Query Pipeline (Real-Time)\"\n        F[User Query] --\u003e G{Hybrid Retrieval Engine};\n        G -- \"1. Vector Search for Entry Points\" --\u003e D;\n        G -- \"2. Multi-Hop Graph Traversal\" --\u003e E;\n        G --\u003e H{Pruning \u0026 Re-ranking};\n        H -- \"Rich Reasoning Context\" --\u003e I{LoRA-Tuned LLM Core};\n        I -- \"Generated Answer + Provenance\" --\u003e J{Attribution \u0026 Provenance Layer};\n        J --\u003e K[Attributed Answer];\n    end\n\n    style A fill:#f2f2f2,stroke:#333,stroke-width:2px\n    style F fill:#e6f7ff,stroke:#333,stroke-width:2px\n    style K fill:#e6ffe6,stroke:#333,stroke-width:2px\n```\n \n---\n# Guide to build graphrag with local LLM\n \n![image](assets/UI.png)\n \n## Environment\nI'm using Ollama ( llama3.1) on Windows and  Ollama (nomic-text-embed) for text embeddings\n \nPlease don't use WSL if you use LM studio for embeddings because it will have issues connecting to the services on Windows (LM studio)\n \n### IMPORTANT! Fix your model context length in Ollama\n \nOllama's default context length is 2048, which might truncate the input and output when indexing\n \nI'm using 12k context here (10*1024=12288), I tried using 10k before, but the results still gets truncated\n \n**Input / Output truncated might get you a completely out of context report in local search!!**\n \nNote that if you change the model in `setttings.yaml` and try to reindex, it will restart the whole indexing!\n \nFirst, pull the models we need to use\n \n```\nollama serve\n# in another terminal\nollama pull llama3.1\nollama pull nomic-embed-text\n```\n \nThen build the model with the `Modelfile` in this repo\n```\nollama create llama3.1-12k -f ./Modelfile\n```\n \n## Steps for GraphRAG Indexing\nFirst, activate the conda enviroment\n```\nconda create -n rag python=\u003cany version below 3.12\u003e\nconda activate rag\n```\n \nClone this project then cd the directory\n```\ncd graphrag-ollama-config\n```\n \nThen pull the code of graphrag (I'm using a local fix for graphrag here) and install the package\n```\ncd graphrag-ollama\npip install -e ./\n \n```\n \nYou can skip this step if you used this repo, but this is for initializing the graphrag folder\n```\npip install sympy\npip install future\npip install ollama\npython -m graphrag.index --init --root .\n```\n \nCreate your `.env` file\n```\ncp .env.example .env\n```\n \nMove your input text to `./input/`\n \nDouble check the parameters in `.env` and `settings.yaml`, make sure in `setting.yaml`,\nit should be \"community_reports\" instead of \"community_report\"\n \nThen finetune the prompts (this is important, this will generate a much better result)\n \nYou can find more about how to tune prompts [here](https://microsoft.github.io/graphrag/posts/prompt_tuning/auto_prompt_tuning/)\n```\npython -m graphrag.prompt_tune --root . --domain \"Christmas\" --method random --limit 20 --language English --max-tokens 2048 --chunk-size 256  --no-entity-types --output ./prompts\n```\n \nThen you can start the indexing\n```\npython -m graphrag.index --root .\n```\n \nYou can check the logs in `./output/\u003ctimestamp\u003e/reports/indexing-engine.log` for errors\n \nTest a global query\n```\npython -m graphrag.query \\\n--root . \\\n--method global \\\n\"What are the top themes in this story?\"\n```\n \n## Using the UI\n \nFirst, make sure requirements are installed\n```\npip install -r requirements.txt\n```\n \nThen run the app using\n```\ngradio app.py\n```\n \nTo use the app, visit http://127.0.0.1:7860/\n \n## 📑 Table of Contents  \n\n- [Core Capabilities](#1-core-capabilities)  \n- [The Architectural Blueprint](#2-the-architectural-blueprint-from-unstructured-data-to-attributed-insights)  \n- [Beyond Semantic Search](#3-beyond-semantic-search-solving-the-multi-hop-challenge)  \n- [Secure On-Premise Deployment Guide](#4-secure-on-premise-deployment-guide)  \n- [API Usage \u0026 Examples](#5-api-usage--examples)  \n- [Project Philosophy \u0026 Future Roadmap](#6-project-philosophy--future-roadmap)  \n- [Acknowledgments \u0026 Citations](#7-acknowledgments--citations)  \n\n---\n\n## 1. Core Capabilities  \n\nVeritasGraph integrates four critical components into a cohesive, powerful, and secure system:  \n\n- **Multi-Hop Graph Reasoning** – Move beyond semantic similarity to traverse complex relationships within your data.  \n- **Efficient LoRA-Tuned LLM** – Fine-tuned using Low-Rank Adaptation for efficient, powerful on-premise deployment.  \n- **End-to-End Source Attribution** – Every statement is linked back to specific source documents and reasoning paths.  \n- **Secure \u0026 Private On-Premise Architecture** – Fully deployable within your infrastructure, ensuring data sovereignty.  \n\n---\n\n## 2. The Architectural Blueprint: From Unstructured Data to Attributed Insights  \n\nThe VeritasGraph pipeline transforms unstructured documents into a structured knowledge graph for attributable reasoning.  \n\n### **Stage 1: Automated Knowledge Graph Construction**  \n- **Document Chunking** – Segment input docs into granular `TextUnits`.  \n- **Entity \u0026 Relationship Extraction** – LLM extracts structured triplets `(head, relation, tail)`.  \n- **Graph Assembly** – Nodes + edges stored in a graph database (e.g., Neo4j).  \n\n### **Stage 2: The Hybrid Retrieval Engine**  \n- **Query Analysis \u0026 Entry-Point Identification** – Vector search finds relevant entry nodes.  \n- **Contextual Expansion via Multi-Hop Traversal** – Graph traversal uncovers hidden relationships.  \n- **Pruning \u0026 Re-Ranking** – Removes noise, keeps most relevant facts for reasoning.  \n\n### **Stage 3: The LoRA-Tuned Reasoning Core**  \n- **Augmented Prompting** – Context formatted with query, sources, and instructions.  \n- **LLM Generation** – Locally hosted, LoRA-tuned open-source model generates attributed answers.  \n- **LoRA Fine-Tuning** – Specialization for reasoning + attribution with efficiency.  \n\n### **Stage 4: The Attribution \u0026 Provenance Layer**  \n- **Metadata Propagation** – Track source IDs, chunks, and graph nodes.  \n- **Traceable Generation** – Model explicitly cites sources.  \n- **Structured Attribution Output** – JSON object with provenance + reasoning trail.  \n\n---\n\n## 3. Beyond Semantic Search: Solving the Multi-Hop Challenge  \n\nTraditional RAG fails at complex reasoning (e.g., linking an engineer across projects and patents).  \nVeritasGraph succeeds by combining:  \n\n- **Semantic search** → finds entry points.  \n- **Graph traversal** → connects the dots.  \n- **LLM reasoning** → synthesizes final answer with citations.  \n\n---\n\n## 4. Secure On-Premise Deployment Guide  \n\n### **Prerequisites**  \n\n**Hardware**  \n- CPU: 16+ cores  \n- RAM: 64GB+ (128GB recommended)  \n- GPU: NVIDIA GPU with 24GB+ VRAM (A100, H100, RTX 4090)  \n\n**Software**  \n- Docker \u0026 Docker Compose  \n- Python 3.10+  \n- NVIDIA Container Toolkit  \n\n### **Configuration**  \n- Copy `.env.example` → `.env`  \n- Populate with environment-specific values  \n\n## 6. Project Philosophy \u0026 Future Roadmap\n### **Philosophy**  \n\nVeritasGraph is founded on the principle that the most powerful AI systems should also be the most transparent, secure, and controllable.\n\nThe project's philosophy is a commitment to democratizing enterprise-grade AI, providing organizations with the tools to build their own sovereign knowledge assets.\n\nThis stands in contrast to reliance on opaque, proprietary, cloud-based APIs, empowering organizations to maintain full control over their data and reasoning processes.\n\n### **Roadmap**  \n\n**Planned future enhancements include:**\n\n- Expanded Database Support – Integration with more graph databases and vector stores.\n\n- Advanced Graph Analytics – Community detection and summarization for holistic dataset insights (inspired by Microsoft’s GraphRAG).\n\n- Agentic Framework – Multi-step reasoning tasks, breaking down complex queries into sub-queries.\n\n- Visualization UI – A web interface for graph exploration and attribution path inspection.\n\n## 7. Acknowledgments \u0026 Citations\n\nThis project builds upon the foundational research and open-source contributions of the AI community.\n\nWe acknowledge the influence of the following works:\n\n- HopRAG – pioneering research on graph-structured RAG and multi-hop reasoning.\n\n- Microsoft GraphRAG – comprehensive approach to knowledge graph extraction and community-based reasoning.\n\n- LangChain \u0026 LlamaIndex – robust ecosystems that accelerate modular RAG system development.\n\n- Neo4j – foundational graph database technology enabling scalable Graph RAG implementations.\n\n \n## Star History\n \n[![Star History Chart](https://api.star-history.com/svg?repos=bibinprathap/VeritasGraph\u0026type=Date)](https://www.star-history.com/#bibinprathap/VeritasGraph\u0026Date)\n\n\n \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbibinprathap%2FVeritasGraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbibinprathap%2FVeritasGraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbibinprathap%2FVeritasGraph/lists"}