This local web application is designed for quantum computing research, industry analysis, and knowledge-based forecasting. It brings together a quantum computing knowledge graph, a 3D research map, a 2D knowledge graph, multi-step reasoning, multi-agent simulation, IMA source references, and report export in a single interface.
Default endpoints:
- Local application: http://127.0.0.1:6122/quantum_reasoning.html
- Local API: http://127.0.0.1:6122/api
- Cloud deployment: http://8.153.83.178:6122
- Visualizes the quantum computing knowledge graph in a 3D globe/vector-space layout.
- Includes node types such as concepts, hardware, algorithms, companies, people, institutions, materials, tools, reports, and quantum error correction (QEC) roadmaps.
- Supports satellite-style nodes around the globe for outer-layer entities such as companies, institutions, tools, people, and reports.
- Lets users select nodes to inspect sources, evidence chains, difficulty, and research evolution paths.
- Supports attack-path filtering. In this project, an "attack path" means a research evolution path, such as the progression from problem definition to an algorithmic breakthrough and then to hardware implementation.
- Supports Chinese and English node labels.
- Supports switching between 3D and 2D maps.
- The 2D mode embeds the original
quantum_knowledge_graph.htmlpage. - The reasoning engine remains available in the right-hand panel in both 2D and 3D modes.
- This mode is useful for quickly finding entities and relationships in dense graph regions.
The reasoning panel on the right supports two modes.
Step-by-step reasoning:
- Parses the question and retrieves a relevant subgraph.
- Performs multi-step logical reasoning over the knowledge graph.
- Produces multidimensional analysis, predictions, confidence scores, supporting evidence, and uncertainty factors.
- Automatically lists relevant references after reasoning, including IMA articles, knowledge bases, related nodes, and chapter or content excerpts.
Multi-agent simulation:
- Dynamically selects relevant entities according to question complexity instead of always using a fixed set of six.
- Generates an agent persona for each relevant entity.
- Runs multiple discussion rounds, after which a coordinator summarizes consensus, disagreements, and the combined prediction.
- Produces a final forecast report, detailed simulation records, and relevant references.
- Uses a local fallback summary when the model does not return a summary for a round, such as round two.
Graph nodes read source information from metadata. The primary source collections include:
- Quantum Computing Learning Materials
- Quantum Industry Research Reports
- Professor Jin Yirong's Live Course Materials
- Quantum Computing
- Dr. Li's Projects
The post-reasoning reference list attempts to include:
- Document title
- Knowledge base
- Document count
- Related nodes
- Relevant chapters or content excerpts
- Original evidence and related topics
The application supports the following export formats:
- HTML
- Word
.docx
Exported reports include:
- Question, mode, date, and graph size
- Step-by-step reasoning or multi-agent simulation process
- Prediction and confidence score
- Supporting evidence and key factors
- Relevant references
- Document chapters or content excerpts
The export pipeline removes Markdown markers such as ###, - **, and > from model output so that reports read like formal research documents.
QuanKnowledeg/
|-- graph/
| `-- graph_data.json # Standalone graph data; only this directory is updated monthly in production
|-- graph_data.json # Legacy compatibility file; the service prefers graph/graph_data.json
|-- quantum_reasoning.html # 3D research map and reasoning interface
|-- quantum_knowledge_graph.html # Original 2D knowledge graph
|-- reasoning_server.py # FastAPI backend, reasoning, simulation, and export APIs
|-- package.json # Local development scripts
|-- scripts/
| |-- dev-server.js # Static server, API proxy, and backend startup checks
| `-- update-graph-only.sh # Production script that synchronizes only graph/
|-- expand_graph*.py # Graph expansion scripts
|-- generate_html*.py # Legacy HTML generation scripts
|-- server.log # Backend runtime log
`-- README.md
Recommended environment:
- macOS or Linux
- Node.js 18+
- Python 3.10+
- Access to local port
6122
Primary Python dependencies:
fastapiuvicornhttpxpydanticpython-docxreportlabweasyprintis optional and preferred for PDF generation. When it is unavailable, the system automatically falls back to ReportLab.
Frontend dependencies:
- The page loads Three.js from a CDN.
- The local development server only requires Node.js's built-in
httpmodule.
The backend does not store API keys in the source code. Set the following environment variable before running a reasoning task:
export DEEPSEEK_API_KEY="your_deepseek_api_key"You can inject this variable through your shell configuration, process manager, or local .env workflow. .env files are excluded from Git by default.
Alternatively, open Model Settings in the upper-right corner of the page and add your own LLM API instead of using the default DeepSeek environment variable. Built-in provider presets include:
- DeepSeek
- OpenAI
- Anthropic Claude
- Google Gemini
- Alibaba Cloud Qwen
- Moonshot Kimi
- Zhipu GLM
- Volcano Engine Doubao
- SiliconFlow
- OpenRouter
- Custom OpenAI-compatible endpoints
After enabling Use my own LLM API for reasoning, you must select Test Model and pass the connection test before the page allows that model to run step-by-step reasoning or multi-agent simulation. The API key is stored only in the current browser's localStorage; it is never written to project files or committed to Git.
Run the following command from the project root:
npm run devBy default, the script:
- Checks whether the current project is already serving
http://127.0.0.1:6122/api/health. - Starts
python3 reasoning_server.pywhen no service is running. - Serves the frontend, static graph files, and
/api/*endpoints from port6122.
Open:
http://127.0.0.1:6122/quantum_reasoning.html
To start only the unified service:
python3 reasoning_server.pyHealth check:
curl http://127.0.0.1:6122/api/healthExample response:
{
"status": "ok",
"base_dir": "/Users/avalok/work/QuanKnowledeg",
"graph_loaded": true,
"node_count": 385,
"edge_count": 1223
}If the server exposes only port 6122, configure FastAPI to listen on 0.0.0.0:6122:
HOST=0.0.0.0 PORT=6122 python3 reasoning_server.pyYou can also use the project script:
HOST=0.0.0.0 PORT=6122 npm run devAfter allowing inbound TCP traffic on port 6122 in the Alibaba Cloud security group, access the application at:
http://8.153.83.178:6122
The root path / serves the main page. /quantum_reasoning.html, /quantum_knowledge_graph.html, /graph_data.json, and /api/* are all available through the same port. /graph_data.json remains available for legacy links, while the service prefers the data in graph/graph_data.json.
Monthly graph updates do not require replacing the page code, service code, or model API keys stored in users' browsers. The production service prefers the standalone graph file:
graph/graph_data.json
Whenever a graph-related endpoint is requested, the backend checks this file's modification time. If the file has changed, the service automatically reloads it and rebuilds the node, edge, adjacency, and label indexes without restarting reasoning_server.py.
After generating a new graph locally, commit graph/graph_data.json to GitHub:
git add graph/graph_data.json
git commit -m "Update graph data"
git pushFrom the project directory on an Alibaba Cloud ECS instance, synchronize only the graph/ directory from GitHub:
cd /path/to/QuanKnowledeg
./scripts/update-graph-only.shIf the default GitHub branch is not main, or the project directory is different, specify the values explicitly:
BRANCH=master ./scripts/update-graph-only.sh /path/to/QuanKnowledeg/graphConfirm that the service has loaded the updated graph:
curl http://127.0.0.1:6122/api/healthInspect graph_path, node_count, edge_count, and graph_load_error in the response. Under normal conditions, graph_path points to graph/graph_data.json and graph_load_error is null.
GET /api/healthGET /api/statsGET /api/graph/fullParameters:
limit_nodes: defaults to 500limit_edges: defaults to 2000
POST /api/subgraphExample request:
{
"question": "When will quantum error correction achieve a major breakthrough?",
"max_nodes": 80
}POST /api/reasonReturns a Server-Sent Events stream.
Example request:
{
"question": "Can superconducting quantum computing achieve fault tolerance?",
"mode": "reasoning",
"max_nodes": 80,
"lang": "en",
"model_config": {
"provider": "openai",
"api_kind": "openai",
"model": "gpt-4.1",
"base_url": "https://api.openai.com/v1",
"api_key": "your_api_key"
}
}model_config is optional. When omitted, the backend uses the DEEPSEEK_API_KEY environment variable and the default model configuration.
POST /api/simulateReturns a Server-Sent Events stream.
Example request:
{
"question": "What are the core devices required for neutral-atom quantum computing?",
"mode": "simulation",
"rounds": 3,
"lang": "en"
}Get the provider presets available to the frontend:
GET /api/models/providersTest a user-supplied LLM configuration:
POST /api/models/testExample request:
{
"provider": "qwen",
"api_kind": "openai",
"model": "qwen-plus",
"base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"api_key": "your_api_key"
}POST /api/ima/referencesExample request:
{
"question": "Quantum error correction roadmap",
"subgraph_nodes": ["node_318", "node_604"]
}POST /api/export/reportRequest fields:
question: research questionmode:reasoningorsimulationsteps: step-by-step reasoning recordsprediction: prediction resultima_references: relevant reference listlang:zhorenformat:html,pdf, ordocxexport_dir: export directory; defaults to~/Downloadssimulation_data: multi-agent simulation process data
The main graph file is graph/graph_data.json. Common top-level fields include:
nodes: node listedges: relationship edge listmetadata: graph metadata
Common node fields:
id: node IDlabel: Chinese display namelabel_en: English display name, when availabletype: node typedescription: node descriptionproperties.importance: importance scoreproperties.source_documents: source documentsproperties.source_knowledge_bases: source knowledge basesproperties.evidence: evidence textproperties.related_terms: related topics
Common edge fields:
source: source node IDtarget: target node IDlabel: relationship typeweight: relationship weight
3D: displays the enhanced 3D research map.2D: displays the original 2D knowledge graph page.
- Switches the display language of nodes in the 3D graph.
- The control is in the upper-right area of the map, aligned with the 3D / 2D toggle.
The bottom of the page includes several path filters:
- Algorithm Breakthrough Path
- NISQ Application Path
- Error Correction and Fault Tolerance Path
- Hardware Implementation Path
- Cryptography Attack and Defense Path
These controls highlight the corresponding research evolution paths.
For PDF exports, the system first attempts to use WeasyPrint and automatically falls back to ReportLab when necessary. The export endpoint saves the report in export_dir and returns the file as a download response.
If the browser reports that you must complete a reasoning task before exporting, verify that:
- A final prediction appears in the right-hand reasoning panel.
- The browser is on
/quantum_reasoning.html, not an API endpoint such as/api/export/report. - You refresh the page and run the reasoning task again.
Check the service:
curl http://127.0.0.1:6122/api/healthIf the backend is not running:
python3 reasoning_server.pyOr restart the full development service:
npm run devThe project uses port 6122 by default. If another project is using that port, stop the conflicting process first. For cloud deployments, also confirm that the security group allows inbound traffic on port 6122.
lsof -nP -iTCP:6122 -sTCP:LISTENCheck that:
graph/graph_data.jsonexists.- The browser console does not report a Three.js CDN loading error.
graph_loadedistruein the/api/healthresponse.
Report references depend on the entities, evidence, and local graph source metadata in the current reasoning task. Missing references usually indicate that relevant nodes do not contain source_documents or source_knowledge_bases. Add the missing source metadata to those nodes in graph/graph_data.json.
- Do not modify unrelated files currently being edited by a user.
- Most frontend logic is in
quantum_reasoning.html. - Backend reasoning, simulation, IMA references, and export logic are in
reasoning_server.py. - Frontend changes usually take effect after refreshing the browser.
- Backend changes require restarting
reasoning_server.py; replacing onlygraph/graph_data.jsondoes not. - Report export has separate HTML, Word, and PDF generation paths. Check all three formats when changing report formatting.
- Unified service port:
6122 - Default export directory:
~/Downloads - Default reasoning model:
deepseek-v4-pro - Default graph file:
graph/graph_data.json
- When adding a new report, store its title, chapter summary, and key conclusions in
source_documents,evidence, anddescription. - Keep version numbers in graph expansion script names, such as
expand_graph_v10.py, to preserve historical build logic. - If the project later integrates a live IMA API, upgrade
/api/ima/referencesfrom graph metadata lookup to live knowledge-base retrieval. - As the 3D map grows, extract node layout, color, path, and rendering logic into separate JavaScript modules to reduce the maintenance burden in
quantum_reasoning.html.