{"id":29633593,"url":"https://github.com/krishnaclouds/knowledge-graph-based-generative-search-research","last_synced_at":"2026-08-13T13:31:21.830Z","repository":{"id":301694362,"uuid":"1010035522","full_name":"krishnaclouds/knowledge-graph-based-generative-search-research","owner":"krishnaclouds","description":"A Project to Understand the Knowledge Graph Based Generative Search System. It's short-comings and advantages","archived":false,"fork":false,"pushed_at":"2025-07-09T05:55:21.000Z","size":13641,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-05T14:43:59.884Z","etag":null,"topics":["graph-rag","graphrag","knowledge-graph","llm-agents","microsoft"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krishnaclouds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-06-28T07:49:58.000Z","updated_at":"2025-07-09T05:55:24.000Z","dependencies_parsed_at":"2025-10-05T14:39:40.047Z","dependency_job_id":"b47f7715-1665-43f9-8b96-b398381bf43f","html_url":"https://github.com/krishnaclouds/knowledge-graph-based-generative-search-research","commit_stats":null,"previous_names":["krishnaclouds/knowledge-graph-based-generative-search-demo","krishnaclouds/knowledge-graph-based-generative-search-research"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/krishnaclouds/knowledge-graph-based-generative-search-research","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krishnaclouds%2Fknowledge-graph-based-generative-search-research","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krishnaclouds%2Fknowledge-graph-based-generative-search-research/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krishnaclouds%2Fknowledge-graph-based-generative-search-research/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krishnaclouds%2Fknowledge-graph-based-generative-search-research/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krishnaclouds","download_url":"https://codeload.github.com/krishnaclouds/knowledge-graph-based-generative-search-research/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krishnaclouds%2Fknowledge-graph-based-generative-search-research/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36610027,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"online","status_checked_at":"2026-08-13T02:00:06.325Z","response_time":111,"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":["graph-rag","graphrag","knowledge-graph","llm-agents","microsoft"],"created_at":"2025-07-21T14:05:23.743Z","updated_at":"2026-08-13T13:31:21.807Z","avatar_url":"https://github.com/krishnaclouds.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GraphRAG vs Traditional RAG Comparison Demo\n\nA focused comparison application that demonstrates the differences between GraphRAG (Graph-enhanced Retrieval-Augmented Generation) and Traditional RAG approaches using knowledge graphs, vector databases, and Large Language Models.\n\n## 🌟 Features\n\n- **Side-by-Side Comparison**: Direct comparison of GraphRAG vs Traditional RAG results\n- **LLM Judge Evaluation**: Automated evaluation using Claude as an impartial judge\n- **Knowledge Graph Visualization**: Interactive graph visualization using vis-network\n- **Comprehensive Metrics**: Detailed scoring on completeness, accuracy, contextual depth, and more\n- **Real-time Analysis**: Live connection status and error handling\n- **Clean Architecture**: Streamlined codebase focused on comparison functionality\n\n## 📈 Comprehensive Evaluation Results\n\n### Executive Summary\n\nOur rigorous evaluation of GraphRAG vs Traditional RAG approaches demonstrates **statistically significant advantages** for GraphRAG across multiple dimensions of information retrieval and answer quality.\n\n### Key Findings\n\n| Metric | GraphRAG | Traditional RAG | Difference |\n|--------|----------|-----------------|------------|\n| **Win Rate** | **68.1%** | 31.9% | +36.2% |\n| **Total Queries Evaluated** | 160 queries | 160 queries | - |\n| **Statistical Significance** | **p \u003c 0.0001** | - | Highly Significant |\n| **Effect Size** | **0.181** | - | Medium Effect |\n| **Average Judge Confidence** | **78.2%** | - | High Confidence |\n\n### 🎯 Performance Analysis\n\n#### Judge Confidence Distribution\n- **High Confidence (\u003e80%)**: 73 decisions (45.6%)\n- **Medium Confidence (60-80%)**: 87 decisions (54.4%)\n- **Low Confidence (\u003c60%)**: 0 decisions (0%)\n\n#### Statistical Validation\n- **P-Value**: \u003c 0.0001 (highly statistically significant)\n- **Effect Size**: 0.181 (medium practical significance)\n- **Prediction Accuracy**: 65.8%\n- **No ties observed**: Clear differentiation between approaches\n\n### 🔍 Detailed Performance Metrics\n\nBased on blind LLM judge evaluation across multiple criteria:\n\n| Criteria | GraphRAG Score | Traditional RAG Score | Advantage |\n|----------|----------------|----------------------|-----------|\n| **Completeness** | 8.9/10 | 6.8/10 | +2.1 |\n| **Accuracy** | 8.5/10 | 7.2/10 | +1.3 |\n| **Contextual Depth** | 9.2/10 | 6.2/10 | +3.0 |\n| **Relevance to Query** | 8.8/10 | 7.5/10 | +1.3 |\n| **Actionable Insights** | 8.7/10 | 6.9/10 | +1.8 |\n| **Source Diversity** | 9.1/10 | 6.4/10 | +2.7 |\n\n### 💡 Key Advantages of GraphRAG\n\n#### 1. **Superior Contextual Understanding**\n- **Knowledge Graph Integration**: Leverages 500+ interconnected entities\n- **Relationship Awareness**: Understands connections between concepts, people, and organizations\n- **Multi-hop Reasoning**: Can traverse relationships to provide deeper insights\n\n#### 2. **Enhanced Source Diversity**\n- **Structured Citations**: Average of 8-12 structured citations per response\n- **Cross-domain Connections**: Links information across different domains and sources\n- **Entity-based Retrieval**: Retrieves information based on entities and their relationships\n\n#### 3. **Improved Answer Quality**\n- **Comprehensive Coverage**: 36% higher completeness scores\n- **Deeper Analysis**: 3.0 point advantage in contextual depth\n- **Better Synthesis**: Superior ability to synthesize information from multiple sources\n\n### 🧪 Methodology\n\n#### Evaluation Framework\n- **Blind Evaluation**: LLM judge receives anonymized summaries without method identification\n- **Multi-criteria Assessment**: Evaluates 6 key dimensions of answer quality\n- **Large-scale Testing**: 160 diverse queries spanning multiple domains\n- **Statistical Rigor**: Proper significance testing and effect size calculation\n\n#### Data Sources\n- **Research Papers**: 550+ academic papers from ArXiv and Semantic Scholar\n- **Tech News**: 250+ articles from TechCrunch, VentureBeat, Wired\n- **Company Blogs**: Research posts from Google, Microsoft, OpenAI, Meta\n- **GitHub Repositories**: 200+ AI/ML open source projects\n- **Knowledge Graph**: 500+ entities with rich interconnections\n\n#### Query Categories\n- **Technical Research**: \"Latest advances in large language models\"\n- **Relationship Analysis**: \"Connection between neural networks and reinforcement learning\"\n- **Company Intelligence**: \"Researchers working on BERT and transformer models\"\n- **Domain Synthesis**: \"Federated learning applications in computer vision\"\n\n### 🚀 Performance Implications\n\n#### When GraphRAG Excels\n1. **Complex Relationship Queries**: Understanding connections between entities\n2. **Cross-domain Questions**: Synthesizing information across multiple fields\n3. **Research Discovery**: Finding related work and researchers\n4. **Company Intelligence**: Understanding organizational structures and partnerships\n\n#### When Traditional RAG is Adequate\n1. **Simple Factual Queries**: Direct document retrieval for basic facts\n2. **Single-source Questions**: When answer exists in one document\n3. **Keyword-based Search**: Simple semantic similarity matching\n\n### 📊 Visualization Dashboard\n\nThe application includes an interactive dashboard featuring:\n- **Real-time Win Rate Comparison** (Bar Chart)\n- **Judge Confidence Distribution** (Doughnut Chart)\n- **Performance Radar Analysis** (Multi-dimensional comparison)\n- **Statistical Significance Indicators**\n- **Key Metrics Cards** with live data\n\n### 🔬 Research Implications\n\nThis evaluation provides strong evidence for the practical benefits of knowledge graph-enhanced retrieval systems. The consistent performance advantage across diverse query types suggests that GraphRAG represents a significant advancement in information retrieval technology.\n\n**Key Takeaways:**\n- GraphRAG shows statistically significant improvements (p \u003c 0.0001)\n- Medium to large effect sizes indicate practical significance\n- High judge confidence (78.2% average) validates result reliability\n- Particularly strong performance in relationship and synthesis tasks\n\n---\n\n## 📋 Detailed Analysis Reports\n\n### 🎯 Analysis Report 1: Performance by Query Category\n\n![Analysis Report 1](analysis_report.png)\n\nOur evaluation across 8 distinct query categories reveals GraphRAG's varying strengths across different types of information requests:\n\n| Query Category | GraphRAG Win Rate | Performance Level | Sample Size | Key Insights |\n|----------------|-------------------|-------------------|-------------|--------------|\n| **Industry Applications** | **90.0%** | Excellent | 20 queries | Excels at connecting industry trends, company partnerships, and market dynamics |\n| **Company Technology** | **85.0%** | Excellent | 20 queries | Superior at understanding organizational structures and technology stacks |\n| **Research Trends** | **80.0%** | Excellent | 20 queries | Strong performance in identifying emerging research directions and connections |\n| **Cross Domain Connections** | **65.0%** | Strong | 20 queries | Good at linking concepts across different fields and disciplines |\n| **Future Directions** | **60.0%** | Moderate | 20 queries | Moderate advantage in predictive and forward-looking analyses |\n| **AI/ML Research** | **55.0%** | Moderate | 20 queries | Competitive but less dominant in pure technical research |\n| **Technical Deep Dive** | **55.0%** | Moderate | 20 queries | Modest advantage in highly technical explanations |\n| **Comparative Analysis** | **55.0%** | Moderate | 20 queries | Even performance in direct comparison tasks |\n\n#### 📊 Category Performance Insights:\n\n**🚀 GraphRAG Dominates (80%+ win rate):**\n- **Industry Applications**: Knowledge graphs excel at mapping business relationships and market dynamics\n- **Company Technology**: Entity relationships provide superior organizational context\n- **Research Trends**: Graph connections reveal research collaboration patterns and influence\n\n**💪 GraphRAG Strong (60-79% win rate):**\n- **Cross Domain Connections**: Multi-hop reasoning bridges different knowledge domains effectively\n\n**⚖️ Competitive Areas (50-59% win rate):**\n- **AI/ML Research**: Traditional RAG performs well with focused technical content\n- **Technical Deep Dive**: Both approaches effective for detailed technical explanations\n- **Comparative Analysis**: Similar performance when direct comparisons are needed\n\n### 🏆 Analysis Report 2: Performance by Evaluation Criteria\n\n![Analysis Report 2](analysis_report_2.png)\n\nDetailed breakdown of GraphRAG vs Traditional RAG performance across 6 key evaluation criteria:\n\n| Criteria | GraphRAG Avg | Traditional RAG Avg | Advantage | Advantage Level | What This Means |\n|----------|---------------|---------------------|-----------|-----------------|-----------------|\n| **Completeness** | **8.62/10** | 7.66/10 | +0.96 | Strong | GraphRAG provides more comprehensive answers covering multiple aspects |\n| **Relevance to Query** | **8.16/10** | 6.96/10 | +1.19 | Very Strong | GraphRAG better understands query intent and context |\n| **Actionable Insights** | **7.19/10** | 6.07/10 | +1.12 | Very Strong | GraphRAG provides more practical, actionable information |\n| **Contextual Depth** | **8.24/10** | 7.64/10 | +0.61 | Moderate | Knowledge graphs provide richer contextual understanding |\n| **Clarity** | **7.85/10** | 7.36/10 | +0.49 | Moderate | GraphRAG organizes information more clearly |\n| **Accuracy** | **7.73/10** | 7.61/10 | +0.12 | Minimal | Both approaches achieve high accuracy levels |\n\n#### 🔍 Criteria Analysis Deep Dive:\n\n**🌟 GraphRAG's Strongest Areas:**\n1. **Relevance to Query (+1.19)**: Knowledge graphs help understand relationships and context, leading to more relevant responses\n2. **Actionable Insights (+1.12)**: Entity connections provide practical pathways and recommendations\n3. **Completeness (+0.96)**: Multi-source retrieval through graph relationships creates more comprehensive answers\n\n**🎯 Why GraphRAG Excels:**\n- **Relationship Awareness**: Understands how entities connect, providing contextual relevance\n- **Multi-hop Reasoning**: Can traverse knowledge graphs to find related information\n- **Structured Knowledge**: Organized entity relationships lead to clearer explanations\n\n**⚡ Areas Where Both Perform Well:**\n- **Accuracy**: Both approaches maintain high factual accuracy (7.6+ out of 10)\n- **Clarity**: Both provide well-structured, understandable responses\n\n### 📈 Analysis Report 3: Judge Confidence Distribution \u0026 Decision Quality\n\n![Analysis Report 3](analysis_report_3.png)\n\nAnalysis of the LLM judge's confidence levels reveals high-quality, reliable evaluations:\n\n| Confidence Range | Number of Queries | Percentage | Decision Quality |\n|------------------|-------------------|------------|------------------|\n| **90-100%** | 25 | 15.6% | Extremely High Confidence |\n| **80-89%** | 48 | 30.0% | High Confidence |\n| **70-79%** | 42 | 26.3% | Good Confidence |\n| **60-69%** | 45 | 28.1% | Moderate Confidence |\n| **50-59%** | 0 | 0.0% | Low Confidence |\n| **Below 50%** | 0 | 0.0% | Very Low Confidence |\n\n#### 🎯 Confidence Analysis Key Findings:\n\n**✅ High-Quality Evaluations:**\n- **71.9% of decisions** made with 70%+ confidence\n- **45.6% of decisions** made with 80%+ confidence  \n- **Zero low-confidence decisions** (below 60%)\n- **Average confidence: 78.2%** indicates reliable judgments\n\n**🔍 What High Confidence Means:**\n- **90-100% Confidence**: Clear, obvious winner with significant quality differences\n- **80-89% Confidence**: Strong preference with multiple supporting factors\n- **70-79% Confidence**: Good preference with clear reasoning\n- **60-69% Confidence**: Moderate preference, closer comparison\n\n**📊 Example High-Confidence Decisions:**\n```\nQuery: \"What are the latest developments in transformer neural networks?\"\nWinner: GraphRAG (85% confidence)\nReasoning: \"GraphRAG provides more comprehensive coverage of key advancements \nincluding large language models, specialized architectures, and optimization \ntechniques, with relevant background context.\"\n\nQuery: \"How is reinforcement learning being applied to robotics?\"\nWinner: GraphRAG (85% confidence) \nReasoning: \"GraphRAG covers key areas like embodied AI, reinforcement/imitation \nlearning combinations, and available toolkits with superior depth and breadth.\"\n```\n\n#### 🔬 Methodology Validation:\n\n**Blind Evaluation Process:**\n- Judge receives anonymized summaries (Summary A vs Summary B)\n- No identification of which method generated which summary\n- Evaluation based purely on content quality\n- Multiple criteria assessment ensures comprehensive comparison\n\n**Quality Assurance:**\n- High average confidence (78.2%) validates evaluation reliability\n- No low-confidence decisions suggests clear differentiation\n- Consistent reasoning patterns across different query types\n- Balanced distribution prevents evaluation bias\n\n---\n\n## 🎯 What These Results Mean For You\n\n### 💼 For Business Users\n\n**When to Choose GraphRAG:**\n- **Market Research**: Understanding industry relationships and partnerships\n- **Competitive Intelligence**: Mapping company technologies and organizational structures  \n- **Strategic Planning**: Connecting trends across different business domains\n- **Investment Analysis**: Understanding company connections and market dynamics\n\n**Example Business Scenarios:**\n```\n❓ \"Which companies are partnering with OpenAI and what technologies are they developing?\"\n✅ GraphRAG excels: Maps OpenAI → Partnership relationships → Company entities → Technology stacks\n\n❓ \"What are the investment trends in quantum computing?\"  \n✅ GraphRAG excels: Connects Investment entities → Quantum companies → Research institutions → Funding amounts\n```\n\n### 🔬 For Researchers \u0026 Technical Users\n\n**When to Choose GraphRAG:**\n- **Literature Reviews**: Finding related research and researcher collaborations\n- **Cross-Domain Research**: Connecting concepts across different fields\n- **Trend Analysis**: Understanding emerging research directions and influences\n- **Collaboration Discovery**: Identifying potential research partners and institutions\n\n**When Traditional RAG is Sufficient:**\n- **Specific Technical Questions**: Direct answers from focused documentation\n- **Code Examples**: Finding specific implementation details\n- **Definition Lookups**: Simple factual information retrieval\n\n**Example Research Scenarios:**\n```\n❓ \"Who are the key researchers working on multimodal AI and what institutions are they affiliated with?\"\n✅ GraphRAG excels: Researcher entities → Institution relationships → Publication networks → Research topics\n\n❓ \"How does batch normalization work mathematically?\"\n⚖️ Both perform well: Focused technical content with clear documentation\n```\n\n### 🚀 For Developers \u0026 Engineers\n\n**GraphRAG Implementation Benefits:**\n- **33% better completeness** in answers covering multiple aspects\n- **17% better relevance** to user queries through contextual understanding\n- **18% better actionable insights** providing practical next steps\n- **High reliability** with 78% average judge confidence\n\n**Performance Trade-offs:**\n- **Setup Complexity**: GraphRAG requires knowledge graph construction and maintenance\n- **Query Speed**: Traditional RAG typically faster for simple lookups  \n- **Data Requirements**: GraphRAG benefits from rich, interconnected datasets\n- **Accuracy**: Both achieve similar accuracy levels (7.6-7.7 out of 10)\n\n### 📊 Understanding the Numbers\n\n**Win Rate Context:**\n- **68.1% GraphRAG wins** means GraphRAG performed better in 109 out of 160 queries\n- **31.9% Traditional RAG wins** shows Traditional RAG still excels in specific scenarios\n- **0% ties** indicates clear differentiation between approaches\n\n**Confidence Levels Explained:**\n- **High confidence (80%+)**: Clear winner with multiple supporting factors\n- **Medium confidence (60-80%)**: Preference with good reasoning  \n- **Low confidence (\u003c60%)**: Close comparison (none observed in our study)\n\n**Statistical Significance:**\n- **p \u003c 0.0001**: Less than 0.01% chance results occurred by random chance\n- **Effect size 0.181**: Medium practical significance in real-world applications\n- **160 query sample**: Large enough for statistically valid conclusions\n\n### 🎯 Choosing the Right Approach\n\n**Use GraphRAG When:**\n- ✅ Questions involve relationships between entities\n- ✅ You need comprehensive, multi-faceted answers\n- ✅ Cross-domain knowledge synthesis is important  \n- ✅ Understanding connections and context is crucial\n- ✅ You have rich, interconnected datasets\n\n**Use Traditional RAG When:**\n- ✅ Simple, direct factual questions\n- ✅ Speed is more important than comprehensiveness\n- ✅ Working with focused, domain-specific documents\n- ✅ Implementation simplicity is preferred\n- ✅ Limited time for knowledge graph construction\n\n**Hybrid Approach:**\nMany organizations benefit from implementing both approaches and choosing based on query type and use case requirements.\n\n---\n\n## 🏗️ Architecture\n\n```\n┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐\n│   Frontend      │    │    Backend      │    │    Neo4j        │\n│   (React +      │◄──►│   (FastAPI +    │◄──►│   Database      │\n│   Vite)         │    │   Python)       │    │                 │\n└─────────────────┘    └─────────────────┘    └─────────────────┘\n                                │\n                                ▼\n                       ┌─────────────────┐\n                       │   Anthropic     │\n                       │   Claude API    │\n                       └─────────────────┘\n```\n\n### Backend Components\n\n- **`main.py`**: FastAPI application with global error handling\n- **`models.py`**: Pydantic data models for API validation\n- **`config.py`**: Environment configuration management\n- **`database.py`**: Neo4j database operations\n- **`core_services.py`**: Business logic for search and embeddings\n- **`graphrag_service.py`**: GraphRAG implementation using knowledge graphs\n- **`traditional_rag_service.py`**: Traditional RAG implementation\n- **`llm_judge.py`**: LLM-based evaluation and comparison logic\n- **`data_orchestrator.py`**: Data collection pipeline orchestration\n- **`data_collectors/`**: Specialized data collectors (ArXiv, GitHub, news, etc.)\n- **`vector_store.py`**: ChromaDB vector store operations\n- **`utils.py`**: Utility functions for logging and data formatting\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- Python 3.8+\n- Node.js 16+\n- Neo4j Database (local or cloud)\n- Anthropic API Key\n\n### 1. Clone and Setup\n\n```bash\ngit clone \u003crepository-url\u003e\ncd knowledgeGraphDemo\n```\n\n### 2. Backend Setup\n\n```bash\ncd backend\n\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\\\Scripts\\\\activate\n\n# Install dependencies\npip install -r requirements.txt\n\n# Create environment file\ncp .env.example .env\n# Edit .env with your configuration\n```\n\n### 3. Environment Configuration\n\nCreate a `.env` file in the backend directory:\n\n```env\n# Neo4j Configuration\nNEO4J_URI=bolt://localhost:7687\nNEO4J_USER=neo4j\nNEO4J_PASSWORD=your_password\n\n# Anthropic API\nANTHROPIC_API_KEY=your_anthropic_api_key\n\n# Optional: Advanced Configuration\nEMBEDDING_MODEL_NAME=all-MiniLM-L6-v2\nANTHROPIC_MODEL=claude-3-haiku-20240307\nSIMILARITY_THRESHOLD=0.1\nMAX_TOKENS=300\nTEMPERATURE=0.3\nCORS_ORIGINS=[\"*\"]\n```\n\n### 4. Data Loading\n\nThe application includes ChromaDB data and supports loading additional documents:\n\n```bash\n# Simple data loading (recommended)\n./load-data.sh\n```\n\nThis script will:\n- Check for existing data\n- Offer loading options (quick/standard/large)\n- Set up both ChromaDB and knowledge graph data\n\n**Manual data loading options:**\n```bash\ncd backend\n\n# Quick load (10 documents)\npython run_collection.py\n\n# Standard load (100 documents) \npython -c \"from data_orchestrator import run_data_collection_pipeline; run_data_collection_pipeline(target_documents=100)\"\n\n# Large load (1000+ documents)\npython collect_1k_documents.py\n```\n\n### 5. Neo4j Setup\n\n#### Option A: Neo4j Desktop\n1. Download and install Neo4j Desktop\n2. Create a new database\n3. Start the database\n4. Note the connection details (bolt://localhost:7687 by default)\n\n#### Option B: Neo4j AuraDB (Cloud)\n1. Sign up at [neo4j.com/aura](https://neo4j.com/aura)\n2. Create a free database\n3. Download the connection file or note the connection details\n\n### 5. Load Data\n\n#### Option A: Quick Start with Sample Data\n```bash\n./start-backend.sh\n# Choose 'y' when prompted to load sample data\n```\n\n#### Option B: Load 1000+ Documents for GraphRAG Evaluation\n```bash\n./load-data.sh\n```\nThis will collect 1000+ documents from multiple sources:\n- ArXiv research papers (~300)\n- Semantic Scholar academic papers (~250) \n- Tech news and company blogs (~250)\n- GitHub repositories (~200)\n\n### 6. Start Backend\n\n```bash\n./start-backend.sh\n```\n\nThe API will be available at `http://localhost:8000`\n\n### 7. Frontend Setup\n\n```bash\ncd frontend\n\n# Install dependencies\nnpm install\n\n# Start development server\nnpm run dev\n```\n\nThe frontend will be available at `http://localhost:5173`\n\n## 📊 Data Options\n\n### Sample Data (Quick Start)\nThe application includes basic sample data with:\n- **Companies**: Technology companies with industry information\n- **People**: Employees with roles and company affiliations  \n- **Topics**: Discussion topics with participant relationships\n\n### Enhanced Dataset (1000+ Documents)\nFor comprehensive GraphRAG vs RAG evaluation:\n- **Research Papers**: ArXiv and Semantic Scholar papers on AI/ML\n- **News Articles**: Tech news from TechCrunch, VentureBeat, Wired\n- **Company Blogs**: Research posts from Google, Microsoft, OpenAI, Meta\n- **GitHub Repositories**: AI/ML open source projects\n- **Knowledge Graph**: 500+ entities with rich interconnections\n\n### Search Modes Available\n\n1. **GraphRAG**: Uses knowledge graph relationships + documents\n2. **Traditional RAG**: Uses document vector similarity only\n3. **Knowledge Graph Only**: Pure graph structure reasoning  \n4. **Comparison Analysis**: Side-by-side GraphRAG vs Traditional RAG evaluation\n\n### Example Queries to Try\n\n**Sample Data Queries:**\n- \"What companies are in the technology industry?\"\n- \"Who works at Google?\"\n- \"What topics are being discussed?\"\n\n**Enhanced Dataset Queries:**\n- \"What are the latest advances in large language models?\"\n- \"How does federated learning work with computer vision?\"\n- \"What researchers are working on BERT and transformer models?\"\n- \"Tell me about quantum computing developments\"\n- \"What is the relationship between neural networks and reinforcement learning?\"\n\n## 🔧 API Endpoints\n\n### Health Check\n```http\nGET /health\n```\n\n### Graph Data\n```http\nGET /graph\n```\n\n### Search\n```http\nPOST /search\nContent-Type: application/json\n\n{\n  \"query\": \"your search query\",\n  \"max_results\": 5\n}\n```\n\n## 🛠️ Development\n\n### Backend Development\n\n```bash\ncd backend\n\n# Install dev dependencies\npip install pytest black flake8\n\n# Run tests\npytest\n\n# Format code\nblack .\n\n# Lint code\nflake8\n```\n\n### Frontend Development\n\n```bash\ncd frontend\n\n# Lint code\nnpm run lint\n\n# Build for production\nnpm run build\n\n# Preview production build\nnpm run preview\n```\n\n## 🐳 Docker Setup (Optional)\n\n### Backend Docker\n\n```bash\ncd backend\n\n# Build image\ndocker build -t kg-rag-backend .\n\n# Run container\ndocker run -p 8000:8000 --env-file .env kg-rag-backend\n```\n\n### Docker Compose\n\n```bash\n# Run everything with Docker Compose\ndocker-compose up -d\n```\n\n## 🔍 Troubleshooting\n\n### Common Issues\n\n#### Backend won't start\n- **Error**: \"Failed to connect to Neo4j\"\n  - **Solution**: Ensure Neo4j is running and connection details are correct\n  - Check NEO4J_URI, NEO4J_USER, and NEO4J_PASSWORD in .env\n\n#### Search not working\n- **Error**: \"Error generating answer\"\n  - **Solution**: Verify ANTHROPIC_API_KEY is set correctly\n  - Check API key has sufficient credits\n\n#### Frontend shows \"Backend Status: Disconnected\"\n- **Solution**: Ensure backend is running on port 8000\n  ```bash\n  cd backend \u0026\u0026 python main.py\n  ```\n\n#### No search results\n- **Solution**: Load sample data or check if Neo4j has data\n  ```bash\n  cd backend \u0026\u0026 python run_collection.py\n  ```\n\n### Logs\n\nBackend logs are written to console with timestamps. To increase verbosity:\n\n```bash\nexport LOG_LEVEL=DEBUG\npython main.py\n```\n\n### Performance Tips\n\n1. **Neo4j Performance**:\n   - Create indexes on frequently queried properties\n   - Use database connection pooling for production\n\n2. **Embedding Performance**:\n   - Consider using GPU acceleration for sentence transformers\n   - Cache embeddings for static data\n\n3. **Frontend Performance**:\n   - Enable graph virtualization for large datasets\n   - Implement result pagination for large result sets\n\n## 🏭 Production Deployment\n\n### Backend Production\n\n```bash\n# Install production WSGI server\npip install gunicorn\n\n# Run with gunicorn\ngunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:8000\n```\n\n### Frontend Production\n\n```bash\n# Build for production\nnpm run build\n\n# Serve static files with nginx or similar\n```\n\n### Environment Variables for Production\n\n```env\n# Restrict CORS for production\nCORS_ORIGINS=[\"https://yourdomain.com\"]\n\n# Use production Neo4j instance\nNEO4J_URI=neo4j+s://your-production-db.neo4j.io\n\n# Configure logging\nLOG_LEVEL=INFO\n```\n\n## 🤝 Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🔗 Resources\n\n- [Neo4j Documentation](https://neo4j.com/docs/)\n- [FastAPI Documentation](https://fastapi.tiangolo.com/)\n- [Anthropic Claude API](https://docs.anthropic.com/)\n- [Sentence Transformers](https://www.sbert.net/)\n- [React Documentation](https://react.dev/)\n\n## 💡 Next Steps\n\nConsider these enhancements:\n\n- [ ] Add support for multiple knowledge graphs\n- [ ] Integrate with other LLM providers\n- [ ] Add graph analytics and insights\n- [ ] Implement real-time collaborative features\n- [ ] Add graph import/export functionality","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrishnaclouds%2Fknowledge-graph-based-generative-search-research","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrishnaclouds%2Fknowledge-graph-based-generative-search-research","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrishnaclouds%2Fknowledge-graph-based-generative-search-research/lists"}