UNPKG

zrald1

Version:

Advanced Graph RAG MCP Server with file location identification, graph processing, and result summarization capabilities

172 lines (122 loc) 3.7 kB
# Zrald-1 MCP Server Advanced Graph RAG MCP Server with file location identification, graph processing, and result summarization capabilities. ## Features - **File Location Identification**: Intelligently identify and locate files based on user queries - **Graph Processing**: Convert files into knowledge graph representations with nodes and relationships - **Vector Search**: Semantic search across file content using vector embeddings - **Relationship Analysis**: Analyze relationships between files based on content similarity, references, and dependencies - **Comprehensive Summarization**: Generate detailed summaries and analytics of processed files - **Export Capabilities**: Export graph data in multiple formats (JSON, Cypher, GraphML) ## Installation ```bash npm install zrald-1 ``` ## Usage ### As a standalone MCP server ```bash npx zrald-1 ``` ### As a library ```typescript import { GraphRAGMCPServer } from 'zrald-1'; const server = new GraphRAGMCPServer(); await server.initialize(); await server.start(); ``` ## Available Tools ### File Processing Tools 1. **identify_files** - Identify and locate files based on search criteria 2. **process_files_to_graph** - Convert identified files into graph nodes and relationships 3. **generate_file_summary** - Generate comprehensive summaries of processed files 4. **search_file_content** - Search within file content using vector similarity 5. **analyze_file_relationships** - Analyze relationships between files 6. **export_graph_data** - Export graph data in various formats ### Vector Search Tools 7. **vdb_search** - Vector similarity search across all processed content ### Analytics Tools 8. **graph_analytics** - Get comprehensive analytics about the file graph ## Configuration Create a `.env` file in your project root: ```env VECTOR_DIMENSION=384 MAX_VECTOR_ELEMENTS=10000 ``` ## Tool Examples ### Identify Files ```json { "name": "identify_files", "arguments": { "query": "typescript configuration", "search_paths": ["./src", "./config"], "file_types": [".ts", ".json"], "recursive": true, "max_results": 20 } } ``` ### Process Files to Graph ```json { "name": "process_files_to_graph", "arguments": { "file_ids": ["file-id-1", "file-id-2"], "create_chunks": true, "chunk_size": 1000, "chunk_overlap": 100 } } ``` ### Generate Summary ```json { "name": "generate_file_summary", "arguments": { "include_content_analysis": true, "include_relationships": true, "include_statistics": true, "summary_type": "comprehensive" } } ``` ### Search File Content ```json { "name": "search_file_content", "arguments": { "query": "database connection configuration", "top_k": 10, "similarity_threshold": 0.7, "file_types": [".js", ".ts", ".json"] } } ``` ## Resources The server provides access to several resources: - `files://processed-files` - All processed files and metadata - `graph://file-graph` - Knowledge graph representation - `analytics://file-analytics` - Analytics and statistics ## Development ### Build ```bash npm run build ``` ### Development Mode ```bash npm run dev ``` ### Testing ```bash npm test ``` ## Architecture The server consists of several key components: - **FileProcessor**: Handles file identification, processing, and content analysis - **VectorStore**: Manages vector embeddings and similarity search - **GraphRAGMCPServer**: Main MCP server implementation with tool handlers ## License MIT ## Contributing Contributions are welcome! Please read the contributing guidelines before submitting PRs. ## Support For issues and questions, please use the GitHub issue tracker.