- Docker and Docker Compose
- OpenAI API key (or Anthropic API key)
-
Clone and run with one command:
git clone https://github.com/mprestonsparks/KnowledgeGraphExpander.git cd KnowledgeGraphExpander ./run.sh -
Access the application:
- Knowledge Explorer UI: http://localhost:8000/explorer
- API Documentation: http://localhost:8000/api/docs
-
Configure API keys through the Settings tab in the Knowledge Explorer UI
-
Stop the application when finished:
./stop.sh
For more options:
./run.sh --helpA self-organizing knowledge graph system that implements Buehler's (2025) agentic deep graph reasoning architecture. The system builds dynamic, evolving knowledge graphs using multi-agent collaborative reasoning, temporal evolution tracking, and advanced self-organization capabilities as described in the original research.
- Explorer Agent: Identifies new concepts and relationships
- Critic Agent: Evaluates quality and relevance of proposals
- Connector Agent: Creates meaningful connections between concepts
- Integrator Agent: Synthesizes final knowledge structures
- Automatic emergence of scale-free properties
- Hierarchical clustering with modularity detection
- Hub and bridge node formation without predefined ontologies
- Continuous growth without saturation
- Monitors graph growth over time
- Tracks hub formation and evolution
- Records historical snapshots for analysis
- Analyzes power law exponents and other network metrics
- Semantic similarity detection for node merging
- Conflict resolution for edge properties
- Maintains merge history for traceability
- Intelligent reconnection of disconnected nodes
- Implements Buehler's (2025) R_{i+1}=f_{eval}(R_i,F_i) formula
- Evaluates expansion quality with multiple metrics
- Generates improvement prompts based on evaluations
- Refines expansion strategies over time
- Interactive graph visualization with D3.js
- Real-time updates via WebSockets
- Analytics dashboard for metrics
- Content analysis input tools
- In-browser API key configuration
- Graph management and analysis (NetworkX)
- Semantic clustering with advanced algorithms
- Multi-agent reasoning system
- PostgreSQL for persistent storage
- OpenAI API for semantic analysis and reasoning
- Claude API for multimodal content analysis
- Structured reasoning with thinking state extraction
- Knowledge extraction pipeline
- Docker and Docker Compose
- OpenAI API key
- Anthropic API key (optional, for multimodal analysis)
-
Clone the repository
git clone https://github.com/mprestonsparks/KnowledgeGraphExpander.git cd KnowledgeGraphExpander -
Set up environment variables
- Create a
.envfile in the root directory or use the provided.env.example:
cp .env.example .env
- Edit the
.envfile to add your API keys
- Create a
-
Run the application
./run.sh
This script will:
- Check for Docker and Docker Compose
- Build the Docker images (if needed)
- Start the application containers
- Automatically find an available port (default: 8000)
- The application will be available at http://localhost:[PORT]
Note: If the default port is in use, the script will automatically find the next available port.
Once the application is running, you can access:
-
Knowledge Graph Explorer: http://localhost:[PORT]/explorer (A user-friendly interface for working with the knowledge graph)
-
API Documentation: http://localhost:[PORT]/api/docs (Interactive Swagger UI for testing the API directly)
The run.sh script supports several options:
./run.sh [options]
Options:
--persist-db Persist database data between runs
--build Force rebuild of Docker images
--dev Run in development mode with hot reloading
--port=PORT Specify custom port (default: 8000)
--help Show this help messageTo stop the application:
./stop.sh
Options:
--clean Remove all data (including database volume)
--force Force removal of containers even if they're running
--help Show this help messageIf you prefer to use Docker commands directly:
-
Build the Docker images:
docker-compose build
-
Start the services:
docker-compose up -d
-
Stop the services:
docker-compose down
-
Remove all data:
docker-compose down -v
For local development with hot reloading:
./run.sh --devThis mounts your local code directories into the container for live code changes.
To persist the database data between container restarts:
./run.sh --persist-dbFor more detailed documentation:
/server: Python backend with FastAPI/models: Database schema definitions/routes: API endpoints/utils: Utility functions
/frontend: React frontend application/src/components: React components/src/hooks: Custom React hooks/src/lib: Frontend utility libraries
/docs: Project documentation/tests: Test suite/shared: Shared type definitions
This project implements the key algorithms and architecture from Buehler's research on agentic deep graph reasoning and self-organizing knowledge networks (Buehler, 2025).
The implementation focuses on the recursive expansion framework, emergent properties of scale-free networks, and the combination of multiple specialized agents for knowledge discovery as described in Buehler's work.
Contributions are welcome! Please see our contributing guidelines for details.
This project is licensed under the MIT License:
MIT License
Copyright (c) 2025 M. Preston Sparks
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
See the LICENSE file for details.
M. Preston Sparks (@mprestonsparks)
- Built using advanced graph theory principles
- Implements research from Buehler (2025) on agentic deep graph reasoning
- Powered by state-of-the-art language models
This project implements the theoretical framework described in:
Buehler, J. (2025). Agentic Deep Graph Reasoning Yields Self-Organizing Knowledge Networks.
arXiv:2502.14958 [cs.AI]