Advanced scientific reasoning framework leveraging graph-of-thoughts and Model Context Protocol to process complex research queries with dynamic confidence scoring, modular design, and seamless AI integration.
Unlock the full potential of NexusMind through LangDB's AI Gateway. Get enterprise-grade security, analytics, and seamless integration with zero configuration.
Free tier available • No credit card required
╔══════════════════════════════════════╗
║ ║
║ 🧠 NexusMind 🧠 ║
║ ║
║ 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
NexusMind leverages graph structures to perform sophisticated scientific reasoning. 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:
graph TD A[🌱 Stage 1: Initialization] --> B[🧩 Stage 2: Decomposition] B --> C[🔬 Stage 3: Hypothesis/Planning] C --> D[📊 Stage 4: Evidence Integration] D --> E[✂️ Stage 5: Pruning/Merging] E --> F[🔍 Stage 6: Subgraph Extraction] F --> G[📝 Stage 7: Composition] G --> H[🤔 Stage 8: Reflection] A1[Create root nodeSet initial confidenceDefine graph structure] --> A B1[Break into dimensionsIdentify componentsCreate dimensional nodes] --> B C1[Generate hypothesesCreate reasoning strategySet falsification criteria] --> C D1[Gather evidenceLink to hypothesesUpdate confidence scores] --> D E1[Remove low-value elementsConsolidate similar nodesOptimize structure] --> E F1[Identify relevant portionsFocus on high-value pathsCreate targeted subgraphs] --> F G1[Synthesize findingsCreate coherent insightsGenerate comprehensive answer] --> G H1[Evaluate reasoning qualityIdentify improvementsFinal confidence assessment] --> H style A fill:#e1f5fe style B fill:#f3e5f5 style C fill:#e8f5e8 style D fill:#fff3e0 style E fill:#ffebee style F fill:#f1f8e9 style G fill:#e3f2fd style H fill:#fce4ec
The core reasoning process follows a sophisticated 8-stage pipeline:
🌱 Initialization
🧩 Decomposition
🔬 Hypothesis/Planning
📊 Evidence Integration
✂️ Pruning/Merging
🔍 Subgraph Extraction
📝 Composition
🤔 Reflection
🔄 Multi-DimensionalConfidence
🧠 Graph-BasedKnowledge
🔌 MCPIntegration
⚡ FastAPIBackend
🐳 DockerDeployment
🧩 ModularDesign
⚙️ ConfigurationManagement
🔒 TypeSafety
🌐 InterdisciplinaryBridge Nodes
🔗 HyperedgeSupport
📊 StatisticalPower Analysis
🎯 ImpactEstimation
Core Features:
networkx
to model complex relationships with hyperedges and multi-layer networks Python 3.13+
FastAPI
NetworkX
Docker
Pytest
Pydantic
Poetry
Uvicorn
NexusMind/
├── 📁 config/ # Configuration files
│ ├── settings.yaml # Application settings
│ ├── claude_mcp_config.json # Claude MCP integration config
│ └── logging.yaml # Logging configuration
│
├── 📁 src/asr_got_reimagined/ # Main source code
│ ├── 📁 api/ # API layer
│ │ ├── 📁 routes/ # API route definitions
│ │ │ ├── mcp.py # MCP protocol endpoints
│ │ │ ├── health.py # Health check endpoints
│ │ │ └── graph.py # Graph query endpoints
│ │ ├── schemas.py # API request/response schemas
│ │ └── middleware.py # API middleware
│ │
│ ├── 📁 domain/ # Core business logic
│ │ ├── 📁 models/ # Domain models
│ │ │ ├── common.py # Common types and enums
│ │ │ ├── graph_elements.py # Node, Edge, Hyperedge models
│ │ │ ├── graph_state.py # Graph state management
│ │ │ ├── confidence.py # Confidence vector models
│ │ │ └── metadata.py # Metadata schemas
│ │ │
│ │ ├── 📁 services/ # Business services
│ │ │ ├── got_processor.py # Main GoT processing service
│ │ │ ├── evidence_service.py # Evidence gathering and assessment
│ │ │ ├── confidence_service.py # Confidence calculation service
│ │ │ ├── graph_service.py # Graph manipulation service
│ │ │ └── mcp_service.py # MCP protocol service
│ │ │
│ │ ├── 📁 stages/ # 8-Stage pipeline implementation
│ │ │ ├── base_stage.py # Abstract base stage
│ │ │ ├── stage_1_initialization.py # Stage 1: Graph initialization
│ │ │ ├── stage_2_decomposition.py # Stage 2: Query decomposition
│ │ │ ├── stage_3_hypothesis.py # Stage 3: Hypothesis generation
│ │ │ ├── stage_4_evidence.py # Stage 4: Evidence integration
│ │ │ ├── stage_5_pruning.py # Stage 5: Pruning and merging
│ │ │ ├── stage_6_extraction.py # Stage 6: Subgraph extraction
│ │ │ ├── stage_7_composition.py # Stage 7: Answer composition
│ │ │ └── stage_8_reflection.py # Stage 8: Quality reflection
│ │ │
│ │ └── 📁 utils/ # Utility functions
│ │ ├── graph_utils.py # Graph manipulation utilities
│ │ ├── confidence_utils.py # Confidence calculation utilities
│ │ ├── statistical_utils.py # Statistical analysis utilities
│ │ ├── bias_detection.py # Bias detection algorithms
│ │ └── temporal_analysis.py # Temporal pattern analysis
│ │
│ ├── 📁 infrastructure/ # Infrastructure layer
│ │ ├── 📁 database/ # Database integration
│ │ ├── 📁 cache/ # Caching layer
│ │ └── 📁 external/ # External service integrations
│ │
│ ├── main.py # Application entry point
│ └── app_setup.py # Application setup and configuration
│
├── 📁 tests/ # Test suite
│ ├── 📁 unit/ # Unit tests
│ │ ├── 📁 stages/ # Stage-specific tests
│ │ ├── 📁 services/ # Service tests
│ │ └── 📁 models/ # Model tests
│ ├── 📁 integration/ # Integration tests
│ └── 📁 fixtures/ # Test fixtures and data
│
├── 📁 scripts/ # Utility scripts
│ ├── setup_dev.py # Development setup
│ ├── add_type_hints.py # Type hint utilities
│ └── deployment/ # Deployment scripts
│
├── 📁 docs/ # Documentation
│ ├── api/ # API documentation
│ ├── architecture/ # Architecture diagrams
│ └── examples/ # Usage examples
│
├── 📁 static/ # Static assets
│ └── nexusmind-logo.png # Application logo
│
├── 📄 Docker Files & Config
├── Dockerfile # Docker container definition
├── docker-compose.yml # Multi-container setup
├── .dockerignore # Docker ignore patterns
│
├── 📄 Configuration Files
├── pyproject.toml # Python project configuration
├── poetry.lock # Dependency lock file
├── mypy.ini # Type checking configuration
├── pyrightconfig.json # Python type checker config
├── .pre-commit-config.yaml # Pre-commit hooks
├── .gitignore # Git ignore patterns
│
└── 📄 Documentation
├── README.md # This file
├── CHANGELOG.md # Version history
├── LICENSE # Apache 2.0 license
└── CONTRIBUTING.md # Contribution guidelines
Clone the repository:
git clone https://github.com/SaptaDey/NexusMind.git cd NexusMind
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
Run the development server:
python src/asr_got_reimagined/main.py
Alternatively, for more control:
uvicorn asr_got_reimagined.main:app --reload --host 0.0.0.0 --port 8000
The API will be available at http://localhost:8000
.
graph TB subgraph "Development Environment" A[👨💻 Developer] --> B[🐳 Docker Compose] end subgraph "Container Orchestration" B --> C[📦 NexusMind Container] B --> D[📊 Monitoring Container] B --> E[🗄️ Database Container] end subgraph "NexusMind 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 nexusmind
Individual Docker Container:
# Build the image docker build -t nexusmind:latest . # Run the container docker run -p 8000:8000 -v $(pwd)/config:/app/config nexusmind:latest
Production Deployment:
# Use production compose file docker-compose -f docker-compose.prod.yml up --build -d
Access the Services:
http://localhost:8000/docs
http://localhost:8000/health
http://localhost:8000/mcp
MCP Protocol: POST /mcp
{ "method": "process_query", "params": { "query": "Analyze the relationship between microbiome diversity and cancer progression", "confidence_threshold": 0.7, "max_stages": 8 } }
Health Check: GET /health
{ "status": "healthy", "version": "0.1.0", "timestamp": "2024-05-23T10:30:00Z" }
Graph Query: POST /api/v1/graph/query
{ "query": "Research question or hypothesis", "parameters": { "disciplines": ["immunology", "oncology"], "confidence_threshold": 0.6, "include_temporal_analysis": true, "enable_bias_detection": true } }
Graph State: GET /api/v1/graph/{session_id}
Analytics: GET /api/v1/analytics/{session_id}
Subgraph Extraction: POST /api/v1/graph/{session_id}/extract
{ "criteria": { "min_confidence": 0.7, "node_types": ["hypothesis", "evidence"], "include_causal_chains": true } }
🧪Testing
🔍Type Checking
✨Linting
📊Coverage
poetry run pytest
poetry run pytest -v
poetry run mypy src/
pyright src/
poetry run ruff check .
poetry run ruff format .
poetry run pytest --cov=src
coverage html
# Run full test suite with coverage poetry run pytest --cov=src --cov-report=html --cov-report=term # Run specific test categories 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 # Type checking and linting poetry run mypy src/ --strict # Strict type checking poetry run ruff check . --fix # Auto-fix linting issues poetry run ruff format . # Format code # Pre-commit hooks (recommended) poetry run pre-commit install # Install hooks poetry run pre-commit run --all-files # Run all hooks
Type Safety:
mypy.ini
and pyrightconfig.json
python scripts/add_type_hints.py
Code Quality:
config/settings.yaml
)# Core application settings app: name: "NexusMind" version: "0.1.0" debug: false log_level: "INFO" # API configuration api: host: "0.0.0.0" port: 8000 cors_origins: ["*"] # ASR-GoT Framework settings asr_got: max_stages: 8 default_confidence_threshold: 0.6 enable_bias_detection: true enable_temporal_analysis: true max_hypotheses_per_dimension: 5 # Graph settings graph: max_nodes: 10000 enable_hyperedges: true enable_multi_layer: true temporal_decay_factor: 0.1
config/claude_mcp_config.json
){ "name": "nexusmind", "description": "Advanced Scientific Reasoning with Graph-of-Thoughts", "version": "0.1.0", "endpoints": { "mcp": "http://localhost:8000/mcp" }, "capabilities": [ "scientific_reasoning", "graph_analysis", "confidence_assessment", "bias_detection" ] }
We welcome contributions! Please see our Contributing Guidelines for details.
git checkout -b feature/amazing-feature
poetry install --with dev
poetry run pytest
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Built with ❤️ for the scientific research community NexusMind - Advancing scientific reasoning through intelligent graph structures
Discover shared experiences
Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!