A web application for interactive network visualization driven by an LLM agent. Users upload GraphML files and drive all analysis and visual encoding through conversation.
See QUICKSTART.md for full setup instructions.
# 1. Configure your environment (set SECRET_KEY, LLM_PROVIDER and its API key)
cp .env.sample .env
# 2. Start all services
docker compose up -d
# 3. Open your browser
# Frontend: http://localhost:5173
# API Docs: http://localhost:8000/docs- ๐ User Authentication - Secure login and registration
- ๐ค GraphML Upload - Import network data from GraphML files
- ๐ค LLM-Powered Chat - Natural language interaction; swap between cloud and local models per chat
- ๐ Interactive Visualization - Real-time network visualization
- ๐ฏ Smart Analysis - Automatic centrality calculation and visual mapping
- ๐ Real-time Updates - Server-Sent Events for live feedback
- Upload a network: Upload a GraphML file (e.g., social network, citation network)
- Chat with the system:
- "ๅ้ใๅคใไบบใๅคงใใ่กจ็คบใใฆ" (Show people with many friends as larger)
- "ๆฉๆธกใใใใฆใใไบบใๅคงใใ่กจ็คบใใฆ" (Show bridge nodes as larger)
- "ๅฝฑ้ฟๅใฎใใไบบใๅคงใใ่กจ็คบใใฆ" (Show influential people as larger)
- See the results: The visualization updates automatically based on your request
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Frontend โโโโโโถโ Backend โโโโโโถโ NetworkX API โ
โ (React+Vite)โโโโโโโ (FastAPI) โโโโโโโ (FastAPI) โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโ
โ PostgreSQL โ
โโโโโโโโโโโโโโโ
โฒ
โ
โโโโโโโโโโโโโโโ
โ LLM (any) โ
โโโโโโโโโโโโโโโ
- Frontend: React + Vite, D3.js for visualization
- Backend: FastAPI, agent loop over a pluggable LLM provider
- NetworkX API: Network analysis and centrality calculations
- Database: PostgreSQL for data persistence
- Quick Start Guide - Setup, usage, and troubleshooting
- AGENTS.md - How the repository is organised and how to change it
- Specification - The design decisions behind the system (Japanese)
- API reference - http://localhost:8000/docs once the backend is running
- FastAPI (Python web framework)
- Pluggable LLM providers: Google Gemini, Anthropic Claude, OpenAI, and LM Studio (local)
- SQLAlchemy (ORM)
- PostgreSQL (Database)
- NetworkX (Graph analysis)
- React 18
- Vite (Build tool)
- D3.js (Visualization)
- Zustand (State management)
- Axios (HTTP client)
The agent uses tool calling to turn a request into network analysis. Providers are pluggable โ Google Gemini, Anthropic Claude, OpenAI, and LM Studio for local models โ and the provider and model are remembered per chat.
# User: "Show people with many friends as larger"
# The agent:
1. analysis_degree_centrality(...) # compute and store the metric
2. visualization_generate(...) # map it to node size and render
3. Explains what it did, and why
Tools are served over MCP by the NetworkX API service and discovered automatically; see AGENTS.md.
All operations use Server-Sent Events for real-time feedback:
- Upload progress
- LLM thinking process
- Tool execution status
- Visualization updates
Available centrality metrics:
- Degree Centrality: Number of connections
- Betweenness Centrality: Bridge nodes
- Closeness Centrality: Average distance to others
- Eigenvector Centrality: Influence based on connections
cd backend && pytest
cd networkx-api && pytest tests
cd frontend && npm test && npm run lint- Start the services:
docker compose up -d - Open http://localhost:5173
- Register/Login
- Create a chat
- Upload a GraphML file from
sample_data/ - Try example queries
The sample_data/ directory contains example networks:
karate_club.graphml- Zachary's Karate Club networkstar_graph.graphml- Simple star topologyrandom_graph.graphml- Random networkdirected_graph.graphml- Directed network example
- Docker and Docker Compose
- An API key for one LLM provider, or LM Studio running locally
Copy .env.sample to .env and fill it in โ it documents every variable,
including the provider keys and the container egress switches.
cp .env.sample .envWith Docker:
docker compose up -dWithout Docker: scripts/local/start.sh runs the whole stack on macOS. To
run one service at a time, see QUICKSTART.md.
GraphVisAgent can use LM Studio's OpenAI-compatible Chat Completions endpoint, including streaming and tool calls.
-
In LM Studio, load a model with tool-use support and start the server from the Developer tab (the default port is
1234). -
Restart the backend and open the model selector. GraphVisAgent reads
GET /api/v1/modelsand lists the chat-capable models available in LM Studio. -
Optionally set a model to use when a chat has no pinned model:
# Optional LM Studio default; the selector does not require this setting. LM_STUDIO_MODEL=your-default-model-id # Optional when LM Studio server authentication is enabled: # LM_STUDIO_API_KEY=your-lm-studio-token
-
Select LM Studio (Local) and the desired model in each chat. Set
LLM_PROVIDER=lmstudioonly when LM Studio should be the process-wide default provider; multiple providers remain available in the selector.
When the backend runs directly on the host, it connects to
http://localhost:1234/v1. Docker Compose automatically uses
http://host.docker.internal:1234/v1; override LM_STUDIO_BASE_URL if LM
Studio is served elsewhere. Models with native tool-use support give the most
reliable graph-agent behavior.
To have Cline freely design conversations that evaluate the current system prompt, Skills, and MCP descriptions against a real isolated GraphVisAgent:
scripts/evaluate \
--target "GraphVisAgentใฎใทในใใ ใใญใณใใใจSkillsใฎๆๅนๆงใ่ฉไพกใใ"This workflow does not use Git diffs or stored test scenarios. It pins Cline and
GraphVisAgent to google/gemma-4-e4b, records tool/Skill/state/PNG evidence, and
writes recommendation-only JSON and Markdown reports. See
evaluation/README.md for setup and architecture.
POST /api/auth/register- Register new userPOST /api/auth/token- LoginGET /api/auth/users/me- Get current user
GET /api/chat- List all chatsPOST /api/chat- Create new chatPOST /api/chat/{id}/upload- Upload GraphMLPOST /api/chat/{id}/process- Process messageGET /api/chat/{id}/stream- SSE stream
The complete, always-current reference is the OpenAPI schema at http://localhost:8000/docs.
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
[Add your license here]
- Tools exposed over the Model Context Protocol
- Network analysis powered by NetworkX
- Visualization using D3.js
For issues or questions:
- Review the Quick Start Guide
- Check the logs:
docker compose logs