A unified AI assistant that connects your work across Slack, Notion, and WhatsApp Business into a single intelligent chat interface. Search for information and take actions across your entire workspace—no more jumping between apps.
Work is scattered across multiple platforms, forcing constant context-switching to stay updated. ThreadWeaver solves this by acting as a single hub for both retrieval (finding info) and action (performing tasks), streamlining your workflow into one intelligent interface.
- AI-Powered Chat: Powered by AI for intelligent conversations
- Unified Search: Search across all connected platforms (Notion, Slack, WhatsApp Business)
- Action Execution: Perform tasks across integrated services via MCP protocol
- Session Management: Persistent conversation history with session tracking
- Platform Integrations: Connect Notion (active), with Slack and WhatsApp Business coming soon
- Backend: FastAPI (Python) with async/await
- Frontend: React 18 + Vite with TypeScript
- Database: Supabase (PostgreSQL)
- AI: (currently) Anthropic Claude (claude-sonnet-4-20250514)
- Integration Protocol: MCP (Model Context Protocol)
- Styling: Tailwind CSS
ThreadWeaver follows a three-tier architecture with clear separation of concerns:
- React 18 with Vite for fast development
- TypeScript for type safety
- Tailwind CSS for styling
- Axios for API communication
- Local state management for chat UI
- API Layer (
app/api/): REST endpoints for chat, sessions, and users - Service Layer (
app/services/): LLM chat service with tool execution loop - Integration Layer (
app/integrations/): MCP clients for external services (Notion) - Database Layer (
app/db/): Supabase client management - Schemas (
app/schemas/): Pydantic models for request/response validation
- Supabase PostgreSQL database
- Tables:
chat_sessions,messages,users - Row-Level Security (RLS) for data isolation
- Anthropic Claude: Primary LLM for chat and tool orchestration
- Notion MCP Server: Search and retrieval via MCP protocol
- Future: Slack, WhatsApp Business integrations
- User sends message → Frontend updates state
- Frontend →
POST /api/v1/chatwith message history of current user - Backend →
LLMChatServicefetches available tools from MCP - Backend → Claude API with tools and conversation context
- Claude → Tool execution requests (if needed)
- Backend → Execute tools via MCP (direct api calls right now), return results to Claude
- Backend → Persist messages to database
- Backend → Final response → Frontend
- Frontend → Display assistant message
- Python 3.10+
- Node.js 18+
- Supabase account
- Anthropic API key
cd threadweaver-backend
# Create virtual environment
python -m venv .venv
# Activate virtual environment
source .venv/bin/activate # macOS/Linux
# or
.venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txt
# Create .env file (see Environment Configuration below)
# Then run the server
uvicorn main:app --reloadThe backend will run on http://localhost:8000
cd threadweaver-frontend
# Install dependencies
npm install
# Run development server
npm run devThe frontend will run on http://localhost:5173
Create threadweaver-backend/.env with the following variables:
SUPABASE_URL=your_supabase_url
SUPABASE_KEY=your_supabase_key
ANTHROPIC_API_KEY=your_anthropic_api_key
OPENAI_API_KEY=your_openai_api_key # Optional, for embeddings
CORS_ORIGINS=["http://localhost:5173"]- POST
/api/v1/chat- Send a message and get AI response- Request:
{ session_id: UUID, messages: ChatMessage[] } - Response:
{ response_message: ChatMessage, session_id: UUID, query_used: string }
- Request:
- GET
/api/v1/sessions/{session_id}/messages- Get all messages in a session - POST
/api/v1/sessions- Create a new session
- GET
/api/v1/users/{user_id}/sessions/current- Get or create current session for user
- GET
/api/v1/search- Get related documents given a user query
- POST
api/v1/document/upload- Process documents for RAG process
- GET
/health- Health check endpoint - GET
/- Welcome message
API documentation available at http://localhost:8000/docs when the backend is running.
threadweaver/
├── threadweaver-backend/
│ ├── app/
│ │ ├── api/ # FastAPI route handlers (chat.py, search.py, documents.py, etc.)
│ │ ├── db/ # Supabase client setup
│ │ ├── schemas/ # Pydantic models for requests/responses
│ │ ├── services/ # Service layer for LLM, RAG etc.
│ │ ├── agents/ # (placeholder for agent logic)
│ │ └── prompts/ # (placeholder for LLM prompts)
│ ├── supabase/
│ │ └── migrations/ # Database migrations (if using)
│ ├── config.py # Centralized environment/config
│ └── main.py # FastAPI app entry point
├── threadweaver-frontend/
│ ├── src/
│ │ ├── components/ # React components
| | ├── pages/ # UI Pages
│ │ ├── App.tsx # Main app component (if using TypeScript)
│ │ └── main.jsx # React entry point
│ └── package.json
├── CLAUDE.md # Claude code collaborating guidance
└── README.md
-
✅ Core chat functionality with Anthropic Claude
-
✅ Basic Notion integration via MCP protocol (plan to improve)
-
✅ Session management and message persistence
-
✅ Database schema with Supabase
-
(WIP) Document Upload Feature (RAG only on text documents)
-
(WIP) User authentication (planned)
-
🚧 Slack integration (planned)
-
🚧 WhatsApp Business integration (planned)
- FastAPI auto-reload enabled with
--reloadflag - Logging configured at INFO level
- Hot module replacement for development
- Vite HMR (Hot Module Replacement) enabled
- TypeScript for type checking
- Tailwind CSS with PostCSS
- Service Layer Pattern: Business logic isolated from API routes
- Router Pattern: Domain-based API organization
- Singleton Pattern: Single Supabase client instance
- Schema Validation: Pydantic models for type safety and validation
This is a personal project in active development. Contributions welcome!