- v0.2.0-alpha
A web-based research application that helps you discover meaningful connections between sources, observations, hypotheses, and concepts using graph database technology.
β Node Management - Create and manage observations, sources, and hypotheses β Relationship Tracking - Connect nodes with typed relationships (SUPPORTS, CONTRADICTS, RELATES_TO, etc.) β Interactive Graph Visualization - Visualize your knowledge graph with Cytoscape.js (zoom, pan, click nodes) β RESTful API - Complete API for programmatic access β Node Details Panel - Click nodes to view details β Real-time Updates - Activity feed ready for live updates (WebSocket integration coming soon) β AI-Powered Analysis - LLM-powered graph operations via REST API, LangGraph agents, and MCP server β Claude Desktop Integration - Use Claude to interact with your knowledge graph via MCP β Intelligent Agents - LangGraph agents with automatic tool selection for complex reasoning β Vector Search - Semantic similarity search using OpenAI embeddings
- Python 3.11+ (
python3 --version) - Node.js 18+ (
node --version) - Docker & Docker Compose (
docker --version)
# Linux/Mac/WSL/Git Bash
./scripts/setup.sh
# Windows (PowerShell)
.\scripts\setup.ps1This will:
- β Choose your development mode (Docker, Mixed, or Local)
- β Install Python dependencies (using uv)
- β Install Node.js dependencies
- β
Create and configure
.envfiles - β Start Docker services (Neo4j, Redis)
- β Initialize Neo4j database
./scripts/start.shThis starts backend and frontend servers. Open http://localhost:5173 in your browser.
./scripts/stop.sh # Stop all servers
./scripts/restart.sh # Restart all servers
./scripts/start-docker.sh # Start fully containerizedFor detailed script documentation, see SCRIPTS.md or docs/SCRIPTS.md.
If you prefer to set things up manually:
docker-compose up -d
docker-compose ps # Verify services are healthycd backend
uv venv && source .venv/bin/activate # Windows: .venv\Scripts\activate
uv pip install -r requirements.txt
cp .env.example .env
# Edit .env and set SECRET_KEY (or setup.sh does this automatically)
uvicorn app.main:app --reloadcd frontend
npm install
cp .env.example .env
npm run devdocker exec research-graph-neo4j cypher-shell -u neo4j -p research_graph_password < docker/neo4j/init.cypher- Open http://localhost:5173
- Click "+ Add Node" button
- Select node type (Observation, Source, Hypothesis, Entity)
- Fill in the form and click "Create"
# Create an observation
curl -X POST "http://localhost:8000/api/v1/nodes/observations" \
-H "Content-Type: application/json" \
-d '{"text": "I observed that X leads to Y", "confidence": 0.8}'
# Create a source
curl -X POST "http://localhost:8000/api/v1/nodes/sources" \
-H "Content-Type: application/json" \
-d '{"title": "Research Paper", "url": "https://example.com", "source_type": "paper"}'curl -X POST "http://localhost:8000/api/v1/nodes/relationships" \
-H "Content-Type: application/json" \
-d '{
"from_id": "node-id-1",
"to_id": "node-id-2",
"relationship_type": "SUPPORTS",
"confidence": 0.9
}'Relationship types: SUPPORTS, CONTRADICTS, RELATES_TO, OBSERVED_IN, DISCUSSES, EXTRACTED_FROM, DERIVED_FROM
- Zoom: Mouse wheel or pinch gesture
- Pan: Click and drag background
- Select Node: Click to view details
- Node Colors:
- π΅ Blue (circle) = Observation
- π’ Green (diamond) = Hypothesis
- π‘ Yellow (rectangle) = Source
- π£ Purple (hexagon) = Concept
- π΄ Red (rounded rectangle) = Entity
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
- Health Check: http://localhost:8000/health
thoughtlab/
βββ setup.sh # One-command setup
βββ start.sh # Start all servers
βββ stop.sh # Stop all servers
βββ restart.sh # Restart servers
βββ backend/ # Python FastAPI backend
β βββ app/
β β βββ api/routes/ # API endpoints
β β βββ agents/ # LangGraph agents
β β βββ ai/ # AI workflow (embeddings, similarity)
β β βββ core/ # Configuration
β β βββ db/ # Database connections
β β βββ mcp/ # MCP server (mounted at /mcp)
β β βββ models/ # Pydantic models
β β βββ services/ # Business logic
β β β βββ tools/ # Modular tool service
β β βββ tools/ # Shared tool definitions
β βββ tests/ # Backend tests
βββ frontend/ # React TypeScript frontend
β βββ src/
β β βββ components/ # React components
β β βββ services/ # API client
β β βββ types/ # TypeScript types
β βββ package.json
βββ docker-compose.yml # Database services
βββ docs/ # Documentation
βββ scripts/ # Utility scripts
βββ setup.ps1 # Windows PowerShell setup
βββ install-hooks.sh # Install git hooks
cd backend && source .venv/bin/activate
pytest # Run tests
pytest --cov=app --cov-report=html # With coveragecd frontend
npm test # Run tests
npm run test:coverage # With coverageSee TESTING.md for details.
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=research_graph_password
DATABASE_URL=sqlite:///./research_graph.db
REDIS_URL=redis://localhost:6379
SECRET_KEY=your-secret-key-here
# AI Configuration (required for AI tools)
THOUGHTLAB_OPENAI_API_KEY=sk-...
THOUGHTLAB_LLM_MODEL=gpt-4o-mini
THOUGHTLAB_EMBEDDING_MODEL=text-embedding-3-small
# MCP Server (optional)
THOUGHTLAB_MCP_ADMIN_MODE=false # Enable dangerous tools in MCPVITE_API_URL=http://localhost:8000/api/v1This project includes security scanning:
- GitHub Action: Scans for secrets on every push/PR using Gitleaks
- Pre-commit hook: Local secret detection (install with
./scripts/install-hooks.sh) - Dependency audits: npm and pip dependencies are scanned
See SECURITY.md for details.
# Check if port 8000 is in use
lsof -i :8000 # or: netstat -an | grep 8000
# Make sure venv is activated
source backend/.venv/bin/activate- Verify backend is running: http://localhost:8000/health
- Check
frontend/.envhas correctVITE_API_URL
# Check service logs
docker-compose logs neo4j
# Reset (WARNING: deletes data)
docker-compose down -v && docker-compose up -dNeo4j takes ~30 seconds to start. Wait and retry, or check:
docker-compose ps # Should show "healthy"- DEVELOPMENT_GUIDE.md - Comprehensive dev guide (architecture, setup, workflows, extending)
- PROJECT_MAP.md - Code structure and file locations
- SECURITY.md - Security policy
- SETUP.md - Detailed setup instructions
- RAILWAY_DEPLOYMENT.md - Deploy to Railway
- TESTING.md - Testing guide
- DEPENDENCIES.md - Dependency management
- MCP_SERVER_GUIDE.md - MCP server setup and usage
- PHASE_7_API_SPEC.md - Backend API reference
- PHASE_8_LANGGRAPH_INTEGRATION.md - LangGraph integration guide
- Backend API with CRUD operations
- Frontend UI with node creation
- Graph database (Neo4j) integration
- Relationship management
- Interactive graph visualization
- Activity feed with processing status
- AI-powered relationship discovery (LangChain + LangGraph)
- Vector embeddings and similarity search
- Automatic connection suggestions based on semantic similarity
- Comprehensive test suite
- Security scanning (Gitleaks)
- LLM-powered graph operations (10 AI tools: find related, summarize, reclassify, merge nodes, etc.)
- MCP server at
/mcpendpoint for Claude Desktop integration - LangGraph agents with intelligent tool selection
- Unified tool architecture - shared definitions for REST API, LangGraph, and MCP
- Real-time WebSocket updates
- Advanced search and filtering
- User authentication
- Graph export/import
- Chrome extension for web capture
MIT License - See LICENSE for details.
- Install git hooks:
./scripts/install-hooks.sh - Create a feature branch
- Make changes and run tests
- Submit a pull request
See SECURITY.md for security guidelines.