GraphMind is an intelligent knowledge graph visualization and analysis platform that leverages AI to extract, analyze, and explore complex relationships from unstructured documents.
- 📊 Interactive 3D Graph Visualization – Explore knowledge graphs in an immersive 3D environment powered by Three.js
- 🤖 AI-Powered Entity Extraction – Automatically extract entities and relationships from PDF documents using NVIDIA Nemotron LLM
- 💬 Intelligent Chat Interface – Ask questions about your graph with context-aware AI responses
- 🔍 Advanced Query System – Analyze node relationships and connections with natural language queries
- 🧠 Reasoning Display – View AI's internal reasoning process for transparency and debugging
- ⚡ Real-time Updates – Dynamic graph updates as new data is processed
GraphMind/
├── backend/ # FastAPI server & graph processing
│ ├── main.py # API endpoints and AI integration
│ ├── generate_data.py # Sample data generation
│ └── data.json # Knowledge graph data store
├── frontend/ # React + Vite + Three.js
│ ├── src/
│ │ ├── App.jsx # Main UI component
│ │ └── main.jsx # Entry point
│ └── package.json # Frontend dependencies
└── README.md
- Python 3.9+
- Node.js 18+
- NVIDIA API Key (for Nemotron LLM access)
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Edit .env and add your NVIDIA_API_KEY
# Generate sample data (optional)
python generate_data.py
# Run the server
uvicorn main:app --reloadBackend runs on: http://127.0.0.1:8000
API Documentation: http://127.0.0.1:8000/docs
cd frontend
# Install dependencies
npm install
# Start development server
npm run devFrontend runs on: http://localhost:5173
Returns the current knowledge graph data.
{
"nodes": [
{"id": "Entity1", "group": "Category", "type": "Type"}
],
"links": [
{"source": "Entity1", "target": "Entity2", "value": "relationship"}
]
}Send a query about the graph with optional node context.
Request:
{
"message": "What is connected to this node?",
"node_id": "Entity1"
}Response:
{
"reply": "Entity1 is connected to Entity2 through a relationship..."
}Extract entities and relationships from a PDF document.
Request: Multipart form with file field containing PDF
Response:
{
"status": "success",
"new_nodes": 15
}Create a .env file in the backend/ directory:
NVIDIA_API_KEY=your_nvidia_api_key_hereSee .env.example for all available options.
Terminal 1 (Backend):
cd backend
source venv/bin/activate # or venv\Scripts\activate on Windows
uvicorn main:app --reloadTerminal 2 (Frontend):
cd frontend
npm run devBackend:
# No build step needed - deploy uvicorn server directlyFrontend:
cd frontend
npm run build
# Output: frontend/dist/cd frontend
npm run lint- PDF Upload → Extract text from documents
- AI Processing → Use Nemotron LLM to identify entities and relationships
- Graph Construction → Build NetworkX graph from extracted data
- Visualization → Render interactive 3D graph in React
- Query & Analysis → Chat interface for graph exploration with AI assistance
- API CORS is set to allow all origins (
*) in development. Restrict this in production. - API keys should never be committed to version control. Use
.envfiles. - Validate and sanitize all user inputs before processing.
- Consider rate limiting for production deployments.
- FastAPI – Modern Python web framework
- NetworkX – Graph data structures and algorithms
- OpenAI SDK – Integration with Nemotron LLM
- pypdf – PDF text extraction
- python-dotenv – Environment variable management
- React 19 – UI library
- Vite – Build tool
- Three.js (via react-force-graph-3d) – 3D visualization
- react-markdown – Markdown rendering
The AI response may contain non-JSON content like <think> tags. The backend now strips these automatically. If the issue persists, check:
- NVIDIA API key is valid
- PDF has extractable text (not scanned image-only)
- Check backend logs for detailed error messages
- Ensure backend is running (
http://127.0.0.1:8000/docs) - Check browser console for network errors
- Verify CORS settings are correct
- Ensure WebGL is supported in your browser
- Try a different browser (Chrome, Firefox, Edge)
- Clear browser cache and restart dev server
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
See CONTRIBUTING.md for detailed guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
- FastAPI Documentation
- React Documentation
- Three.js Documentation
- NetworkX Documentation
- NVIDIA API Documentation
For issues, questions, or suggestions:
- Open an issue on GitHub
- Check existing issues for solutions
- Review the troubleshooting section above
Made with ❤️ using React, FastAPI, and AI