# cuhk-aim-group/neurodiscovery architecture

> Architecture diagram of the GitHub repository cuhk-aim-group/neurodiscovery, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cuhk-aim-group/neurodiscovery
- Repository: https://github.com/cuhk-aim-group/neurodiscovery

## Overview

NeuroDiscovery combines a provenance-aware neuroscience knowledge graph, evidence-grounded hypothesis generation, and NeuroRuntime, which executes selected research workflows and uses their outcomes to guide further research. The graph emphasizes that user-to-result loop while retaining the web interface, model-provider layer, and tool-dispatch boundary. Some links reflect README-described capabilities rather than inspected implementation; unsampled subsystems are shown only where the README or source index supports them.

Main entry points: [`core/agent/main.py`](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/agent/main.py) (Agent session), [`core/idea_hypotheses.py`](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/idea_hypotheses.py) (Hypothesis generation), [`neurooracle/src/graph_manager.py`](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/graph_manager.py) (Knowledge graph), [`neurooracle/src/hypothesis_engine.py`](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/hypothesis_engine.py) (Hypothesis engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI<br/>[cli.py]"]
  node_web["Web interface<br/>[server.py]"]
  node_desktop["Desktop client<br/>[main.js]"]
end

subgraph group_discovery["Evidence and discovery"]
  node_hypotheses["Hypothesis generation<br/>[idea_hypotheses.py]"]
  node_evidence["Topic evidence<br/>[topic_evidence.py]"]
  node_claim_evidence["Claim evidence<br/>[claim_evidence.py]"]
  node_novelty["Novelty policy<br/>[novelty_policy.py]"]
  node_atoms["Task atoms<br/>[atoms.py]"]
  node_hypothesis_engine["Hypothesis engine"]
  node_case_studies["Case studies<br/>[case_studies.py]"]
end

subgraph group_runtime["Research execution"]
  node_agent["Agent session<br/>[main.py]"]
  node_autoresearch["AutoResearch<br/>[autoresearch.py]"]
  node_execution["NeuroRuntime execution"]
  node_tools["Tool pipeline<br/>[tool_pipeline.py]"]
  node_outcomes["Tool outcomes<br/>[tool_outcomes.py]"]
end

subgraph group_knowledge["Knowledge graph"]
  node_ingestion["Knowledge ingestion<br/>[ingest_pipeline.py]"]
  node_graph["Knowledge graph<br/>[graph_manager.py]"]
  node_schema["Graph schema<br/>[schema.py]"]
  node_graph_storage["Graph storage<br/>[storage.py]"]
end

subgraph group_platform["Runtime foundations"]
  node_models["Model providers<br/>[adapters.py]"]
  node_capabilities["Model capabilities"]
  node_profiles["Provider profiles"]
  node_checkpoints["File checkpoints<br/>[manager.py]"]
end

node_researcher(("Researcher"))

node_researcher -->|"starts research"| node_cli
node_researcher -->|"starts research"| node_web
node_researcher -->|"starts research"| node_desktop
node_cli -.->|"starts session"| node_agent
node_web -->|"routes chat"| node_agent
node_agent -->|"generates ideas"| node_hypotheses
node_agent -->|"runs research"| node_autoresearch
node_agent -->|"requests completions"| node_models
node_agent -->|"dispatches tools"| node_tools
node_hypotheses -->|"uses task atoms"| node_atoms
node_hypotheses -->|"uses generator"| node_hypothesis_engine
node_hypotheses -->|"uses evidence"| node_evidence
node_evidence -->|"reads claims"| node_claim_evidence
node_hypothesis_engine -->|"traverses graph"| node_graph
node_hypothesis_engine -->|"uses task atoms"| node_atoms
node_hypotheses -->|"applies novelty"| node_novelty
node_ingestion -->|"builds graph"| node_graph
node_graph -->|"uses schema"| node_schema
node_graph_storage -->|"loads and saves"| node_graph
node_graph_storage -->|"serializes entities"| node_schema
node_autoresearch -.->|"coordinates execution"| node_execution
node_execution -.->|"invokes tools"| node_tools
node_tools -->|"normalizes results"| node_outcomes
node_outcomes -.->|"returns results"| node_agent
node_execution -->|"tests hypotheses"| node_case_studies
node_case_studies -->|"uses task atoms"| node_atoms
node_models -->|"checks capabilities"| node_capabilities
node_capabilities -->|"uses provider profiles"| node_profiles
node_agent -.->|"checkpoints workspace"| node_checkpoints

click node_cli "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/cli.py"
click node_web "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/web/server.py"
click node_desktop "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/desktop/main.js"
click node_agent "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/agent/main.py"
click node_hypotheses "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/idea_hypotheses.py"
click node_evidence "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/topic_evidence.py"
click node_claim_evidence "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/web/claim_evidence.py"
click node_novelty "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/novelty_policy.py"
click node_atoms "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/atoms.py"
click node_hypothesis_engine "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/hypothesis_engine.py"
click node_autoresearch "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/autoresearch.py"
click node_execution "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/autoresearch_runtime.py"
click node_tools "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/tool_pipeline.py"
click node_outcomes "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/tool_outcomes.py"
click node_ingestion "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/ingest_pipeline.py"
click node_graph "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/graph_manager.py"
click node_schema "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/schema.py"
click node_graph_storage "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/storage.py"
click node_models "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/llm/adapters.py"
click node_capabilities "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/llm/model_capabilities.py"
click node_profiles "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/llm/provider_profiles.py"
click node_checkpoints "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/checkpoint/manager.py"
click node_case_studies "https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/case_studies.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_web,node_desktop toneBlue
class node_hypotheses,node_evidence,node_claim_evidence,node_novelty,node_atoms,node_hypothesis_engine,node_case_studies toneAmber
class node_agent,node_autoresearch,node_execution,node_tools,node_outcomes toneMint
class node_ingestion,node_graph,node_schema,node_graph_storage toneRose
class node_models,node_capabilities,node_profiles,node_checkpoints,node_researcher toneIndigo
```

## Components

### User interfaces

- [CLI](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/cli.py): `core/cli.py`
- [Web interface](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/web/server.py): `core/web/server.py`
- [Desktop client](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/desktop/main.js): `desktop/main.js`

### Evidence and discovery

- [Hypothesis generation](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/idea_hypotheses.py): `core/idea_hypotheses.py`
- [Topic evidence](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/topic_evidence.py): `core/topic_evidence.py`
- [Claim evidence](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/web/claim_evidence.py): `core/web/claim_evidence.py`
- [Novelty policy](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/novelty_policy.py): `neurooracle/src/novelty_policy.py`
- [Task atoms](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/atoms.py): `neurooracle/src/atoms.py`
- [Hypothesis engine](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/hypothesis_engine.py): `neurooracle/src/hypothesis_engine.py`
- [Case studies](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/case_studies.py): `neurooracle/src/case_studies.py`

### Research execution

- [Agent session](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/agent/main.py): `core/agent/main.py`
- [AutoResearch](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/autoresearch.py): `core/autoresearch.py`
- [NeuroRuntime execution](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/autoresearch_runtime.py): `core/autoresearch_runtime.py`
- [Tool pipeline](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/tool_pipeline.py): `core/tool_pipeline.py`
- [Tool outcomes](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/tool_outcomes.py): `core/tool_outcomes.py`

### Knowledge graph

- [Knowledge ingestion](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/ingest_pipeline.py): `neurooracle/src/ingest_pipeline.py`
- [Knowledge graph](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/graph_manager.py): `neurooracle/src/graph_manager.py`
- [Graph schema](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/schema.py): `neurooracle/src/schema.py`
- [Graph storage](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/neurooracle/src/storage.py): `neurooracle/src/storage.py`

### Runtime foundations

- [Model providers](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/llm/adapters.py): `core/llm/adapters.py`
- [Model capabilities](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/llm/model_capabilities.py): `core/llm/model_capabilities.py`
- [Provider profiles](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/llm/provider_profiles.py): `core/llm/provider_profiles.py`
- [File checkpoints](https://github.com/cuhk-aim-group/neurodiscovery/blob/main/core/checkpoint/manager.py): `core/checkpoint/manager.py`

### Other components

- **Researcher**

## Connections

- Researcher → CLI: starts research (evidence: `README.md`)
- Researcher → Web interface: starts research (evidence: `README.md`)
- Researcher → Desktop client: starts research (evidence: `README.md`)
- CLI → Agent session: starts session
- Web interface → Agent session: routes chat (evidence: `core/web/server.py`)
- Agent session → Hypothesis generation: generates ideas (evidence: `core/agent/main.py`)
- Agent session → AutoResearch: runs research (evidence: `core/agent/main.py`)
- Agent session → Model providers: requests completions (evidence: `core/agent/main.py`)
- Agent session → Tool pipeline: dispatches tools (evidence: `core/agent/main.py`)
- Hypothesis generation → Task atoms: uses task atoms (evidence: `core/idea_hypotheses.py`)
- Hypothesis generation → Hypothesis engine: uses generator (evidence: `core/idea_hypotheses.py`)
- Hypothesis generation → Topic evidence: uses evidence (evidence: `core/idea_hypotheses.py`)
- Topic evidence → Claim evidence: reads claims (evidence: `core/topic_evidence.py`)
- Hypothesis engine → Knowledge graph: traverses graph (evidence: `neurooracle/src/hypothesis_engine.py`)
- Hypothesis engine → Task atoms: uses task atoms (evidence: `neurooracle/src/hypothesis_engine.py`)
- Hypothesis generation → Novelty policy: applies novelty (evidence: `README.md`)
- Knowledge ingestion → Knowledge graph: builds graph (evidence: `neurooracle/src/ingest_pipeline.py`)
- Knowledge graph → Graph schema: uses schema (evidence: `neurooracle/src/graph_manager.py`)
- Graph storage → Knowledge graph: loads and saves (evidence: `neurooracle/src/storage.py`)
- Graph storage → Graph schema: serializes entities (evidence: `neurooracle/src/storage.py`)
- AutoResearch → NeuroRuntime execution: coordinates execution
- NeuroRuntime execution → Tool pipeline: invokes tools
- Tool pipeline → Tool outcomes: normalizes results (evidence: `core/tool_pipeline.py`)
- Tool outcomes → Agent session: returns results (evidence: `core/agent/main.py`)
- NeuroRuntime execution → Case studies: tests hypotheses (evidence: `README.md`)
- Case studies → Task atoms: uses task atoms (evidence: `neurooracle/src/case_studies.py`)
- Model providers → Model capabilities: checks capabilities (evidence: `core/llm/adapters.py`)
- Model capabilities → Provider profiles: uses provider profiles (evidence: `core/llm/model_capabilities.py`)
- Agent session → File checkpoints: checkpoints workspace (evidence: `core/agent/main.py`)
