by SaptaDey
ββββββββββββββββββββββββββββββββββββββββ
β β
β π§ Adaptive Graph of Thoughts π§ β
β β
β Intelligent Scientific β
β Reasoning through β
β Graph-of-Thoughts β
β β
ββββββββββββββββββββββββββββββββββββββββ
**π Next-Generation AI Reasoning Framework for Scientific Research**
Leveraging graph structures to transform how AI systems approach scientific reasoning
For comprehensive information on Adaptive Graph of Thoughts, including detailed installation instructions, usage guides, configuration options, API references, contribution guidelines, and the project roadmap, please visit our full documentation site:
β‘οΈ Adaptive Graph of Thoughts Documentation Site
The site now includes interactive Mermaid diagrams and an improved layout.
Adaptive Graph of Thoughts leverages a Neo4j graph database to perform sophisticated scientific reasoning, with graph operations managed within its pipeline stages. It implements the Model Context Protocol (MCP) to integrate with AI applications like Claude Desktop, providing an Advanced Scientific Reasoning Graph-of-Thoughts (ASR-GoT) framework designed for complex research tasks.
Key highlights:
git clone https://github.com/SaptaDey/Adaptive-Graph-of-Thoughts-MCP-server.git cd Adaptive-Graph-of-Thoughts-MCP-server poetry install poetry run uvicorn src.adaptive_graph_of_thoughts.main:app --reload
Open http://localhost:8000/setup and complete the
wizard. You'll land on the dashboard when finished.
The project is organized as follows (see the documentation site for more details):
Adaptive Graph of Thoughts/
βββ π .github/ # GitHub specific files (workflows)
βββ π config/ # Configuration files (settings.yaml)
βββ π docs_src/ # Source files for MkDocs documentation
βββ π src/ # Source code
β βββ π adaptive_graph_of_thoughts # Main application package
βββ π tests/ # Test suite
βββ Dockerfile # Docker container definition
βββ docker-compose.yml # Docker Compose for development
βββ docker-compose.prod.yml # Docker Compose for production
βββ mkdocs.yml # MkDocs configuration
βββ poetry.lock # Poetry dependency lock file
βββ pyproject.toml # Python project configuration (Poetry)
βββ pyrightconfig.json # Pyright type checker configuration
βββ README.md # This file
βββ setup_claude_connection.py # Script for Claude Desktop connection setup (manual run)
Before running Adaptive Graph of Thoughts (either locally or via Docker if not using the provided docker-compose.prod.yml
which includes Neo4j), ensure you have:
A running Neo4j Instance: Adaptive Graph of Thoughts requires a connection to a Neo4j graph database.
apoc.create.addLabels
, apoc.merge.node
). Without APOC, the application will not function correctly. You can find installation instructions on the official APOC website.config/settings.yaml
(or corresponding environment variables) correctly points to your Neo4j instance URI, username, and password.python scripts/run_cypher_migrations.py
to apply the provided Cypher migrations automatically. See Neo4j Indexing Strategy for details.Note: The provided docker-compose.yml
(for development) and docker-compose.prod.yml
(for production) already include a Neo4j service with the APOC library pre-configured, satisfying this requirement when using Docker Compose.
pyproject.toml
, e.g., the Docker image uses Python 3.11.x or 3.12.x, 3.13.x)Clone the repository:
git clone https://github.com/SaptaDey/Adaptive-Graph-of-Thoughts-MCP-server.git cd Adaptive-Graph-of-Thoughts-MCP-server
Install dependencies using Poetry:
poetry install
This creates a virtual environment and installs all necessary packages specified in pyproject.toml
.
Activate the virtual environment:
poetry shell
Configure the application:
# Copy example configuration cp config/settings.example.yaml config/settings.yaml # Edit configuration as needed vim config/settings.yaml
Set up environment variables (optional):
# Create .env file for sensitive configuration echo "LOG_LEVEL=DEBUG" > .env echo "API_HOST=0.0.0.0" >> .env echo "API_PORT=8000" >> .env
In production environments, set the SECRETS_PROVIDER
environment variable to
aws
, gcp
, or vault
to fetch sensitive values from a supported secrets
manager. Optionally provide <VAR>_SECRET_NAME
variables (for example
OPENAI_API_KEY_SECRET_NAME
) to control the name of each secret. When a secrets
provider is configured, values for OPENAI_API_KEY
, ANTHROPIC_API_KEY
, and
NEO4J_PASSWORD
are loaded automatically at startup.
Run the development server:
python src/adaptive_graph_of_thoughts/main.py
Alternatively, for more control:
uvicorn adaptive_graph_of_thoughts.main:app --reload --host 0.0.0.0 --port 8000
The API will be available at http://localhost:8000
.
An interactive wizard is available to streamline initial configuration.
poetry run python -m agt_setup
Then visit http://localhost:8000/setup
to complete the web-based steps.
Setup wizard demo GIF will appear here in the full documentation.
graph TB subgraph "Development Environment" A[π¨βπ» Developer] --> B[π³ Docker Compose] end subgraph "Container Orchestration" B --> C[π¦ Adaptive Graph of Thoughts Container] B --> D[π Monitoring Container] B --> E[ποΈ Database Container] end subgraph "Adaptive Graph of Thoughts Application" C --> F[β‘ FastAPI Server] F --> G[π§ ASR-GoT Engine] F --> H[π MCP Protocol] end subgraph "External Integrations" H --> I[π€ Claude Desktop] H --> J[π Other AI Clients] end style A fill:#e1f5fe style B fill:#f3e5f5 style C fill:#e8f5e8 style F fill:#fff3e0 style G fill:#ffebee style H fill:#f1f8e9
Quick Start with Docker Compose:
# Build and run all services docker-compose up --build # For detached mode (background) docker-compose up --build -d # View logs docker-compose logs -f adaptive-graph-of-thoughts
Individual Docker Container:
# Build the image docker build -t adaptive-graph-of-thoughts:latest . # Run the container docker run -p 8000:8000 -v $(pwd)/config:/app/config adaptive-graph-of-thoughts:latest
Production Deployment:
# Use production compose file docker-compose -f docker-compose.prod.yml up --build -d
A minimal Helm chart is provided under helm/agot-server
for
running Adaptive Graph of Thoughts on a Kubernetes cluster.
helm install agot helm/agot-server
Customize values in helm/agot-server/values.yaml
to set the image repository,
resource limits, and other options.
smithery.yaml
.
PORT
environment variable (default 8000
)./health
endpoint.Dockerfile
and docker-compose.prod.yml
illustrate the container setup.http://localhost:8000/docs
http://localhost:8000/health
http://localhost:8000/mcp
Adaptive Graph of Thoughts supports integration with various MCP clients:
*Configuration content*
##Available MCP Tools
1. scientific_reasoning_query - Advanced scientific reasoning with graph analysis
2. analyze_research_hypothesis - Hypothesis evaluation with confidence scoring
3. explore_scientific_relationships - Concept relationship mapping
4. validate_scientific_claims - Evidence-based claim validation
The primary API endpoints exposed by Adaptive Graph of Thoughts are:
POST /mcp
asr_got.query
method:poetry run pytest --cov=src --cov-report=html --cov-report=term
make test
poetry run pytest tests/unit/stages/ # Stage-specific tests
poetry run pytest tests/integration/ # Integration tests
poetry run pytest -k "test_confidence" # Tests matching pattern
poetry run mypy src/ --strict # Strict type checking
poetry run ruff check . --fix # Auto-fix linting issues
poetry run ruff format . # Format code
poetry run pre-commit install # Install hooks
poetry run pre-commit run --all-files # Run all hooks (runs Ruff and MyPy)
## π₯ Dashboard Tour
*Dashboard demo GIF coming soon.*
## π» IDE Integration
Use the `vscode-agot` extension to query the server from VS Code. Run the extension and execute **AGoT: Ask Graphβ¦** from the Command Palette.
## β Troubleshooting
If the server fails to start or setup reports errors, ensure your Neo4j instance is running and the credentials in `.env` are correct. Consult the console output for details.
## πΊοΈ Roadmap and Future Directions
We have an exciting vision for the future of Adaptive Graph of Thoughts! Our roadmap includes plans for enhanced graph visualization, integration with more data sources like Arxiv, and further refinements to the core reasoning engine.
For more details on our planned features and long-term goals, please see our [Roadmap](ROADMAP.md) (also available on the documentation site).
## π€ Contributing
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) (also available on the documentation site) for details on how to get started, our branching strategy, code style, and more.
## π License
This project is licensed under the Apache License 2.0. [License](LICENSE).
## π Security
Please see our [Security Policy](SECURITY.md) for reporting vulnerabilities and details on supported versions.
## π Acknowledgments
- **NetworkX** community for graph analysis capabilities
- **FastAPI** team for the excellent web framework
- **Pydantic** for robust data validation
- The scientific research community for inspiration and feedback
---
<p>**Built with β€οΈ for the scientific research community**</p>
<p><em>Adaptive Graph of Thoughts - Advancing scientific reasoning through intelligent graph structures</em></p>
No version information available
0 contributors