A cursor-like AI agent for your browser that provides intelligent assistance through a side panel interface. This project combines a powerful browser extension frontend with a sophisticated AI backend powered by the Mastra framework, enabling seamless integration with GitHub, Notion, and other productivity tools.
- Browser Side Panel: Clean, responsive chat interface accessible from any web page
- Multi-Agent AI System: Specialized agents for different tasks and integrations
- Persistent Conversations: Thread-based chat history with semantic memory
- Real-time Tool Execution: Watch AI agents perform actions in real-time
- Third-party Integrations: Connect and automate GitHub and Notion workflows
- GitHub Agent: Repository management, issue tracking, pull requests, project boards
- Notion Agent: Page creation, database management, workspace organization
- General Assistant: Conversational AI for general queries and tasks
- GitHub: Full API access for repository operations, issue management, PR workflows
- Notion: Comprehensive workspace and content management capabilities
- Extensible Architecture: Easy to add new integrations via Composio
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Browser β β Backend β β External β
β Extension βββββΊβ (Next.js) βββββΊβ Services β
β β β β β β
β βββββββββββββ β β ββββββββββββββ β β βββββββββββββ β
β β Side Panelβ β β β tRPC β β β β GitHub β β
β β UI β β β β API β β β β API β β
β βββββββββββββ β β ββββββββββββββ β β βββββββββββββ β
β β β β β β
β βββββββββββββ β β ββββββββββββββ β β βββββββββββββ β
β β Auth β β β β Mastra β β β β Notion β β
β β (Clerk) β β β β Agents β β β β API β β
β βββββββββββββ β β ββββββββββββββ β β βββββββββββββ β
β β β β β β
β β β ββββββββββββββ β β βββββββββββββ β
β β β β PostgreSQL β β β β Composio β β
β β β β Database β β β β Platform β β
β β β ββββββββββββββ β β βββββββββββββ β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
- Framework: WXT (Web Extension Toolkit) with React
- UI Components: shadcn/ui with Tailwind CSS
- Communication: tRPC client for type-safe API calls
- Authentication: Clerk Chrome Extension SDK
- Features:
- Side panel interface with chat UI
- Integration management page
- Real-time tool execution visualization
- Persistent conversations across browser sessions
- Framework: Next.js with App Router
- API Layer: tRPC for end-to-end type safety
- AI Framework: Mastra with agent networks
- Database: PostgreSQL with Drizzle ORM
- Authentication: Clerk for user management
- Key Features:
- Multi-agent orchestration
- Conversation memory and threading
- Integration management
- Tool execution and monitoring
- Agent Network: Coordinated multi-agent system with specialized roles
- Memory System: PostgreSQL-backed persistent memory with semantic recall
- Tool Integration: Composio platform for third-party API access
- Models: Claude Sonnet 4 for primary reasoning, GPT-4 Nano for title generation
- Features:
- Contextual conversation threading
- Tool call filtering and token limiting
- Automatic task delegation between agents
- Users: Clerk-based user management
- Conversations: Thread-based chat history
- Memory: Semantic conversation storage
- Traces: Comprehensive execution logging
- Evaluations: AI performance metrics and testing
- WXT: Modern web extension framework
- React 19: Latest React with modern hooks
- TypeScript: Full type safety
- Tailwind CSS: Utility-first styling
- shadcn/ui: Modern component library
- Lucide React: Consistent iconography
- Next.js 15: Latest Next.js with App Router
- tRPC: End-to-end type safety
- Mastra: AI agent framework
- Drizzle ORM: Type-safe database toolkit
- PostgreSQL: Robust data persistence
- Clerk: Authentication and user management
- Anthropic Claude: Primary reasoning model
- OpenAI GPT: Supplementary tasks
- Composio: Third-party integration platform
- GitHub API: Repository and project management
- Notion API: Workspace and content management
browser-cursor/
βββ backend/ # Next.js API server
β βββ src/
β β βββ app/api/ # API routes
β β β βββ chat/ # Main chat endpoint
β β β βββ trpc/ # tRPC router
β β βββ lib/ # Agent configuration
β β β βββ agentConfig.ts # AI agent setup
β β β βββ agentInstructions.ts # Agent prompts
β β βββ server/ # Backend logic
β β βββ api/ # tRPC routers
β β βββ db/ # Database schema & migrations
β βββ package.json
β
βββ extension/ # Browser extension
β βββ src/
β β βββ components/ # React components
β β β βββ ChatInterface.tsx # Main chat UI
β β β βββ IntegrationsPage.tsx # Integration management
β β β βββ ui/ # shadcn/ui components
β β βββ entrypoints/ # Extension entry points
β β β βββ background.ts # Service worker
β β β βββ content.ts # Content script
β β β βββ sidepanel/ # Side panel app
β β βββ lib/ # Utilities
β βββ wxt.config.ts # Extension configuration
β βββ package.json
β
βββ README.md # This file
- Node.js 18+ and pnpm
- PostgreSQL database
- Clerk account for authentication
- Composio account for integrations (optional)
-
Clone the repository
git clone https://github.com/your-username/browser-cursor.git cd browser-cursor -
Install dependencies
# Backend cd backend pnpm install # Extension cd ../extension pnpm install
-
Set up environment variables
# backend/.env.local CLERK_SECRET_KEY=your_clerk_secret_key NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key NEON_URL=your_postgresql_connection_string ANTHROPIC_API_KEY=your_anthropic_api_key OPENAI_API_KEY=your_openai_api_key COMPOSIO_API_KEY=your_composio_api_key -
Initialize database
cd backend pnpm drizzle-kit push -
Start development servers
# Backend (Terminal 1) cd backend pnpm dev # Extension (Terminal 2) cd extension pnpm dev
-
Load extension in browser
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked" and select
extension/.output/chrome-mv3
- Open Chrome and navigate to
Modify agent behavior in backend/src/lib/agentInstructions.ts:
- Update system prompts for different use cases
- Add new specialized agents
- Configure tool access and permissions
Add new integrations in backend/src/lib/agentConfig.ts:
- Define new tool sets via Composio
- Create specialized agent configurations
- Configure authentication flows
Extend the interface in extension/src/components/:
- Modify chat interface styling
- Add new integration cards
- Customize tool execution visualization
- Install and activate the browser extension
- Sign in using Clerk authentication
- Configure integrations (GitHub, Notion) in the integrations tab
- Start chatting with AI agents through the side panel
- Watch tools execute in real-time as agents complete tasks
- "Create a GitHub issue for the bug I mentioned"
- "Update my Notion project status to completed"
- "Show me recent pull requests in my repositories"
- "Create a new Notion page with meeting notes"