# DaChuang **Repository Path**: palatio/da-chuang ## Basic Information - **Project Name**: DaChuang - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-05 - **Last Updated**: 2026-07-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 知识图谱路径搜索系统 [English](#english-version) | [中文版本](#中文版本) --- ## 中文版本 ### 项目简介 DaChuang 是一个基于 Neo4j 图数据库的知识图谱路径搜索与分析系统。该系统采用 DMCBA(Dynamic Multi-Criteria Backward Approaching)算法,能够在知识图谱中高效地搜索两个实体之间的最优路径,并提供实时进度反馈和可视化展示。 ### 核心技术 - **后端框架**: FastAPI - **图数据库**: Neo4j - **异步任务**: Celery + Redis - **实时通信**: WebSocket - **算法**: DMCBA 动态多准则反向逼近算法 ### 功能特性 1. **路径搜索** - 支持双向搜索(反向搜索 + 正向搜索) - 可配置权重参数(影响力、置信度、接近度) - 支持搜索深度和数量限制 2. **实时进度** - WebSocket 实时推送搜索进度 - 显示各阶段完成状态 3. **图可视化** - 基于 G6 的交互式图谱展示 - 节点/边的详细信息提示 - 路径高亮显示 4. **AI 智能解释** - 基于用户意图的路径解释 - 自动参数推荐 ### 目录结构 ``` DaChuang/ ├── api/ # API 路由模块 │ ├── agent.py # AI Agent 接口 │ ├── fullgraph.py # 全图获取接口 │ ├── search_task.py # 搜索任务接口 │ └── websocket.py # WebSocket 接口 ├── services/ # 业务逻辑服务 │ ├── dmcba_service.py # DMCBA 算法实现 │ └── dmcba_show.py # 图展示服务 ├── tasks/ # Celery 异步任务 │ └── path_search.py # 路径搜索任务 ├── db/ # 数据库连接 │ ├── connection.py # Neo4j 连接 │ └── graph.py # 图配置 ├── core/ # 核心组件 │ ├── celery_config.py # Celery 配置 │ └── websocket_manager.py # WebSocket 管理 ├── utils/ # 工具函数 │ └── caculator_tool.py # 计算器工具 ├── DTO/ # 数据传输对象 │ └── shuju.py # 数据模型 ├── static/ # 前端静态资源 │ ├── graph.html # 图谱可视化页面 │ └── g6.min.js # G6 图库 └── main.py # 应用入口 ``` ### 环境要求 - Python 3.10+ - Neo4j 数据库 - Redis 服务器 ### 安装部署 1. **安装依赖** ```bash pip install -r requirements.txt ``` 2. **配置环境变量** ```bash # 创建 .env 文件,配置以下变量: NEO4J_URI=bolt://localhost:7687 NEO4J_USERNAME=neo4j NEO4J_PASSWORD=your_password REDIS_URL=redis://localhost:6379 ``` 3. **启动服务** ```bash # 启动 Celery Worker celery -A tasks worker --loglevel=info # 启动 FastAPI 应用 uvicorn main:app --reload ``` 4. **访问界面** ``` http://localhost:8000/graph ``` ### API 接口 | 接口 | 方法 | 说明 | |------|------|------| | `/search/async` | POST | 发起异步路径搜索 | | `/search/status/{task_id}` | GET | 获取任务状态 | | `/search/result/{task_id}` | GET | 获取搜索结果 | | `/fullgraph/async` | GET | 获取全图数据 | | `/api/agent/interpret` | POST | AI 路径解释 | | `/ws/progress/{task_id}` | WebSocket | 实时进度推送 | ### 算法参数说明 | 参数 | 默认值 | 说明 | |------|--------|------| | w1 | 0.3 | 影响力权重 | | w2 | 0.3 | 置信度权重 | | w3 | 0.4 | 接近度权重 | | qoc_t | 0.2 | 时间质量阈值 | | qoc_r | 0.4 | 可靠性阈值 | | qoc_rho | 0.5 | 接近度阈值 | ### 许可证 本项目仅供学习研究使用。 --- ## English Version # Yelp Data-Based Social Path Intelligent Recommendation System ## Project Overview This project is a **Provincial-level College Students’ Innovation and Entrepreneurship Development Program** (2025.05 - 2026.05). It is a precision social path recommendation system that quantifies social influence, trust value, and relationship closeness from Yelp user graphs. By storing user nodes and relationships in a Neo4j graph database, the system enables the rapid retrieval of high-value social paths. The project has obtained a **National Computer Software Copyright Registration (No. 2026SR0669313)**. ## Tech Stack - **Frontend**: Vue3, AntV G6 - **Backend**: FastAPI (RESTful & WebSocket) - **Graph Database**: Neo4j - **Async Tasks**: Celery + Redis - **Algorithm**: D-MCBA (Dynamic Multi-Criteria Backward Approaching) with Monte Carlo optimization - **AI Model**: Qwen-Plus LLM ## Features 1. **Precision Social Path Search** - Quantifies social influence, trust value, and relationship closeness based on Yelp data. - Executes the D-MCBA algorithm with dynamic rewards and hop penalties. - Optimized search through Monte Carlo methods for rapid retrieval of high-value paths. 2. **Real-time Task Scheduling & Progress** - Integrated Celery with Redis for robust asynchronous task scheduling. - Built WebSocket interfaces using FastAPI for real-time progress streaming. 3. **Front-end Visualization** - Designed interactive front-end visualization pages with Vue3 and AntV G6. - Features node/edge tooltips and dynamic social path highlighting. 4. **AI Agent Empowerment** - Incorporated the Qwen-Plus LLM for user intent parsing. - Intelligent parameter tuning and automated search configuration. ## Directory Structure ```text Yelp-Social-Path-System/ ├── frontend/ # Vue3 Frontend (Vue3 + AntV G6) │ ├── src/ │ │ ├── components/ # Graph visualization components │ │ └── views/ # Main dashboard and interaction pages ├── api/ # API routing modules (FastAPI) │ ├── agent.py # AI Agent interface (Qwen-Plus integration) │ ├── fullgraph.py # Full graph retrieval interface │ ├── search_task.py # Search task interface │ └── websocket.py # WebSocket interface ├── services/ # Business logic services │ ├── dmcba_service.py # D-MCBA algorithm & Monte Carlo implementation │ └── dmcba_show.py # Graph visualization data service ├── tasks/ # Celery async tasks │ └── path_search.py # Path search task ├── db/ # Database connection │ ├── connection.py # Neo4j connection │ └── graph.py # Graph configuration ├── core/ # Core components │ ├── celery_config.py # Celery configuration │ └── websocket_manager.py # WebSocket manager ├── DTO/ # Data transfer objects │ └── shuju.py # Data models └── main.py # Application entry point ### Quick Start ```bash # Install dependencies pip install -r requirements.txt # Configure .env file NEO4J_URI=bolt://localhost:7687 NEO4J_USERNAME=neo4j NEO4J_PASSWORD=your_password REDIS_URL=redis://localhost:6379 # Start Celery Worker celery -A tasks worker --loglevel=info # Start FastAPI uvicorn main:app --reload # Access http://localhost:8000/graph ``` ### License For educational and research purposes only.