RabbitHole is an AI-powered visual knowledge exploration platform that transforms Q&A into interactive mind maps. Powered by agentic search using Exa AI and MCP tools, it gathers data from any source at any granularity. Ask a question, dive deeper with follow-ups, highlight specific text for contextual queries, and watch your curiosity branch into a beautiful web of connected knowledge.
๐ฏ User Question
|
โโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโ
| |
๐จ FRONTEND (Next.js) ๐ง BACKEND (FastAPI)
| |
โโโโโโโโโโโโโดโโโโโโโโโโโโ โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโ
| | | |
๐ Canvas View ๐ฌ Chat View ๐ค OpenAI API ๐ฆ Vector Store
| | | |
| | โโโโโโโโโดโโโโโโโโ โโโโโโโโโโดโโโโโโโโโ
| | | | | |
โโโโโดโโโโ โโโโโโโโโดโโโ Generate Auto Cluster Embeddings Cache
| | | | Content Mode Analysis (similarity) (MD5)
| | | | | | |
Cards Edges Linear Highlights | | |
Nodes Colors Thread Context | | |
| | |
โโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโโดโโโโโโโโโ
| |
โก TENTACLES (Core Features) |
| |
โโโโโโโโโโโโโผโโโโโโโโโโโโฌโโโโโโโโโโโโฌโโโโโโโโโโโโฌโโโโโโโโโโโโโผโโโโโโโโโ
| | | | | | |
๐ฏ Text ๐ Color ๐พ Session ๐งฉ Semantic ๐ Context ๐ Markdown ๐จ Viz
Highlight Coding Persist Clustering Chain Render Layout
| | | | | | |
(Select & (Trace (Auto- (K-Means (Path (Prose (Dagre
Query) Paths) Save) Grouping) Building) + GFM) Engine)
| |
โโโโโโโโโดโโโโโโโโ โโโโโโโโโโโโดโโโโโโโโโโโ
| | | |
๐ Agentic ๐ MCP Tools ๐ง Claude Agent ๐ก Exa AI
Search (Model Context) SDK (Web Search)
| | | |
(Exa AI + MCP) (Any Data Source) (Orchestration) (Internet Access)
- User Input โ User asks a question from any node
- Frontend Processing โ React Flow canvas renders interactive cards
- Context Building โ System builds path from root to current node
- API Request โ Backend receives query + full conversation context
- Agentic Search โ For deep queries, Claude Agent SDK orchestrates:
- Exa AI web search for comprehensive internet research
- MCP tools to access any data source at any granularity
- Multiple search iterations for thorough coverage
- AI Generation โ GPT-4 synthesizes findings into concise, focused response
- Visualization โ New node appears with auto-layout
- Exploration โ User can:
- Click follow-up button to ask more
- Highlight text to ask contextual questions
- View conversation as linear chat
- Switch between sessions
- Interactive Canvas: Zoom, pan, and explore your knowledge graph
- Auto-Layout: Intelligent hierarchical layout using Dagre algorithm
- Color-Coded Paths: Each question branch gets a unique color for easy tracking
- Dual View: Toggle between canvas (mind map) and chat (linear conversation)
- Agentic Search: Uses Exa AI to search the entire internet for real-time, comprehensive information
- MCP Tools Integration: Access any data source through Model Context Protocol (MCP) tools
- Infinite Granularity: Dive infinitely deep into any topic - no knowledge base limitations
- Contextual Responses: AI understands the full conversation path
- Smart Content Generation: Concise, focused answers (max 80 words)
- Text Highlighting: Select any text and ask specific questions about it
- Suggested Follow-ups: AI proposes 2 relevant next questions
- Semantic Clustering: Group related nodes using K-means on embeddings
- Auto Mode: Find most relevant node for a query using cosine similarity
- Session Management: Save, load, and switch between multiple "rabbit holes"
- Persistent Highlights: Visual memory of what you've explored
- Embedding Cache: MD5-based caching for faster repeated queries
- Root Node Entry Point: Start with "What's your rabbit hole? ๐ฐ"
- Loading States: Elegant spinners during content generation
- Markdown Support: Rich text rendering with GFM (GitHub Flavored Markdown)
- External Links: Automatic link detection with icons
- Selection Popup: Context menu appears when you highlight text
- Active Path Highlighting: Visual emphasis on currently selected conversation thread
- Framework: Next.js 16 (React 19)
- Visualization: ReactFlow (interactive node graphs)
- Layout Engine: Dagre (hierarchical auto-layout)
- Styling: Tailwind CSS 4
- Markdown: react-markdown + remark-gfm
- Icons: Lucide React
- Language: TypeScript
- Framework: FastAPI (Python)
- AI/ML:
- OpenAI API
- GPT-4o (with search preview) for content generation
- text-embedding-3-small for semantic search
- Exa AI: Agentic web search for comprehensive internet research
- Claude Agent SDK: For agentic search orchestration
- OpenAI API
- MCP Tools: Model Context Protocol integration
- Exa AI MCP server for web search
- OpenAI summary tools for content synthesis
- ML Libraries:
- NumPy (vector operations)
- scikit-learn (K-means clustering)
- Server: Uvicorn (ASGI)
- Configuration: python-dotenv
- State Management: React hooks + ReactFlow state
- API Communication: REST (JSON)
- Data Persistence: localStorage (client-side sessions)
- Caching: In-memory embedding cache with content hashing
- Node.js 20+ and npm
- Python 3.8+
- OpenAI API Key
- Exa AI API Key (for agentic search features)
# Navigate to backend directory
cd backend
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Create .env file with your API keys
echo "OPENAI_API_KEY=your-key-here" > .env
echo "EXA_API_KEY=your-exa-key-here" >> .env
# Start the server
python main.py
# Server runs on http://localhost:8000# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
# App runs on http://localhost:3000Backend (.env in backend/):
OPENAI_API_KEY=sk-...
EXA_API_KEY=your-exa-api-keyFrontend (optional, .env.local in frontend/):
NEXT_PUBLIC_API_URL=http://localhost:8000-
Ask Initial Question: Type your question in the root node
- Example: "How does quantum computing work?"
-
Explore Response: Read the AI-generated answer in the new card
-
Dive Deeper: Click the โ button below any card to ask follow-up questions
-
Highlight & Query:
- Select any text in a card
- A colored popup appears
- Type your question about that specific text
- Creates a color-coded branch
-
View as Chat: Click the ๐ button (top-right) to see linear conversation view
-
Switch Sessions: Click the session dropdown (top-left) to:
- Create new rabbit hole
- Load previous sessions
- Delete old sessions
- Agentic Search: When you ask deep questions, the system uses Exa AI to search the internet and gather information from any source at any level of detail
- MCP Tools: The platform leverages Model Context Protocol tools to access diverse data sources beyond traditional knowledge bases
- Infinite Depth: Unlike static knowledge bases, you can explore topics to any level of granularity - from high-level concepts to specific technical details
- Color Coding: Each highlighted text question gets a random color - both the edge and the resulting node use this color
- Active Path: When viewing chat, the selected path glows on the canvas
- Context Awareness: The AI always has access to the full path from root to current node
- Markdown Support: Responses can include bold, italic, lists, and links
Generate AI content for a node
Request:
{
"user_query": "What are the benefits?",
"selected_context": "quantum superposition", // optional
"path": "node-1/node-2/node-3",
"context": {
"node-1": { "id": "node-1", "title": "...", "content": "..." },
"node-2": { "id": "node-2", "title": "...", "content": "..." }
}
}Response:
{
"title": "Benefits of Quantum Computing",
"response": "Quantum computers can solve certain problems exponentially faster...",
"suggested_questions": [
"How does quantum entanglement work?",
"What are current limitations?"
]
}Find most relevant node for a query using semantic similarity
Request:
{
"query": "machine learning applications",
"nodes": {
"node-1": { "id": "node-1", "title": "...", "content": "...", "query": "..." }
}
}Response:
{
"node_id": "node-42",
"similarity": 0.87
}Cluster nodes by semantic similarity and generate titles
Request:
{
"context": {
"node-1": { "id": "node-1", "title": "...", "content": "...", "query": "..." },
"node-2": { "id": "node-2", "title": "...", "content": "...", "query": "..." }
}
}Response:
{
"Quantum Mechanics": ["node-1", "node-5", "node-8"],
"Computer Architecture": ["node-2", "node-6"],
"Applications": ["node-3", "node-4", "node-7"]
}rabbithole/
โโโ backend/
โ โโโ main.py # FastAPI server + endpoints
โ โโโ agent.py # Agentic search with Exa AI & MCP tools
โ โโโ requirements.txt # Python dependencies
โ โโโ .env # API keys (OpenAI, Exa AI)
โ
โโโ frontend/
โ โโโ app/
โ โ โโโ components/
โ โ โ โโโ Canvas.tsx # Main ReactFlow canvas
โ โ โ โโโ CardNode.tsx # Individual card component
โ โ โ โโโ ChatPanel.tsx # Linear conversation view
โ โ โ โโโ CustomEdge.tsx # Edge rendering
โ โ โ โโโ SessionManager.tsx # Session controls
โ โ โโโ data/
โ โ โ โโโ initialNodes.ts # Starting state
โ โ โโโ utils/
โ โ โ โโโ api.ts # Backend API calls
โ โ โ โโโ layout.ts # Dagre layout engine
โ โ โโโ page.tsx # Next.js root page
โ โ โโโ layout.tsx # App layout
โ โ โโโ globals.css # Global styles
โ โโโ package.json
โ โโโ tsconfig.json
โ
โโโ README.md # This file!
- Agentic Search Architecture: First-of-its-kind integration of Exa AI and MCP tools for unlimited knowledge exploration
- Infinite Granularity: Access any data source at any level of detail - no knowledge base boundaries
- Novel UI Pattern: Transforms traditional chat into explorable mind maps
- Context-Aware AI: Full conversation history passed to model
- Visual Memory: Color-coded highlights show what you've explored
- Dual Modality: Seamlessly switch between spatial and linear views
- Agentic Search: Exa AI integration for comprehensive web research
- MCP Tools: Model Context Protocol enables access to any data source
- Smart Caching: MD5-based embedding cache reduces API costs
- Semantic Search: Vector similarity for intelligent node matching
- Auto-Clustering: K-means with elbow method for optimal grouping
- Real-time Layout: Dagre algorithm for hierarchical positioning
- Zero Friction: No login, instant start
- Visual Feedback: Loading states, highlights, color coding
- Persistent Sessions: Auto-save with localStorage
- Responsive: Smooth transitions and animations
- Modular Architecture: Clean separation of concerns
- Type Safety: Full TypeScript coverage
- Performance: Efficient React rendering with memoization
- Extensible: Easy to add new AI models or visualization modes
- Collaborative Mode: Share rabbit holes with others
- Export Options: PDF, PNG, or JSON export
- Custom Models: Support for different AI models
- Voice Input: Ask questions by speaking
- Search & Filter: Find nodes across all sessions
- Themes: Light mode and custom color schemes
- Mobile Support: Touch-optimized interface
- Cloud Sync: Save sessions to cloud
- Graph Analytics: Insights about exploration patterns
- Bookmarks: Mark important nodes
This project was built for the Neo 2025 Hackathon. Contributions, ideas, and feedback are welcome!
# Backend hot-reload
cd backend
uvicorn main:app --reload
# Frontend hot-reload
cd frontend
npm run devMIT License - feel free to use this for your own knowledge exploration!
- Neo 2025 Hackathon for inspiring this project
- OpenAI for GPT-4 and embeddings API
- Exa AI for agentic web search capabilities
- Anthropic for Claude Agent SDK and MCP tools
- ReactFlow for the amazing graph visualization library
- FastAPI for the elegant Python backend framework
- Dagre for hierarchical layout algorithms
Built with โค๏ธ for Neo 2025 Hackathon
Happy exploring! Fall down the rabbit hole! ๐ฐ๐ณ๏ธ