An advanced AI deep research assistant with an interactive Cedar-OS frontend and powerful Mastra backend. Features human-in-the-loop workflows that allow users to explore topics, evaluate results, and generate comprehensive reports.
This project combines two powerful frameworks:
- Cedar-OS Frontend: Modern Next.js app with AI-native chat interface
- Mastra Backend: Workflow-based agent system with research capabilities
├── src/
│ ├── app/ # Next.js app directory (Cedar-OS frontend)
│ ├── backend/ # Mastra backend with agents and workflows
│ │ └── src/mastra/ # Agents, tools, and workflows
│ ├── cedar/ # Cedar-OS message renderers
│ └── lib/ # Shared utilities
- Interactive Chat Interface: Floating chat with beautiful UI
- Custom Message Renderers: Visual feedback for tool calls and results
- Real-time Updates: See research progress as it happens
- Workflow-Based Architecture: Structured research process with human-in-the-loop
- Research Agent: Autonomous web search and evaluation
- Custom Tools:
webSearchTool: Searches the web using Exa APIevaluateResultTool: Assesses result relevanceextractLearningsTool: Identifies key learnings and generates follow-ups
- Report Generation: Transforms findings into comprehensive markdown reports
# Install frontend dependencies
npm install
# Install backend dependencies
npm run backend:installCopy .env.example to .env in both root and backend:
# Root .env
cp .env.example .env
# Backend .env
cp src/backend/.env.example src/backend/.envEdit both .env files with your API keys:
# Backend API Keys
OPENAI_API_KEY="your-openai-api-key"
EXA_API_KEY="your-exa-api-key"
# Frontend
NEXT_PUBLIC_MASTRA_BASE_URL="http://localhost:4111"You'll need two terminal windows:
Terminal 1 - Start Backend (Mastra):
npm run backend:devTerminal 2 - Start Frontend (Next.js):
npm run dev- Open http://localhost:3000
- Click the chat icon to open the Cedar-OS interface
- Ask the assistant to research a topic:
- "Research quantum computing applications"
- "Research the latest developments in AI safety"
- Review the research findings as they stream in
- Approve or request more research
- Receive a comprehensive markdown report
- User Request: You ask for research on a topic via the Cedar-OS chat
- Web Search: The research agent uses Exa to find relevant information
- Evaluation: Each result is evaluated for relevance
- Learning Extraction: Key learnings and follow-up questions are identified
- Human Approval: You review and approve or iterate
- Report Generation: A comprehensive report is generated
- Cedar-OS: AI-native React framework for building copilot interfaces
- Mastra: Agent orchestration framework with workflows
- Next.js 15: React framework with App Router
- Tailwind CSS: Utility-first CSS framework
- Exa API: Advanced web search for AI agents
- OpenAI: GPT-4 for research and analysis
# Frontend
npm run dev # Start Next.js dev server (port 3000)
npm run build # Build Next.js app
npm run start # Start production server
npm run lint # Run ESLint
# Backend
npm run backend:dev # Start Mastra dev server (port 4111)
npm run backend:install # Install backend dependenciesagentic-web-deep-research/
├── src/
│ ├── app/ # Next.js app directory
│ │ ├── layout.tsx # Root layout with CedarCopilot
│ │ ├── page.tsx # Home page with FloatingCedarChat
│ │ └── globals.css # Global styles
│ ├── backend/ # Mastra backend
│ │ ├── src/mastra/ # Agents, tools, workflows
│ │ ├── package.json # Backend dependencies
│ │ └── mastra.config.yaml # Mastra configuration
│ ├── cedar/ # Cedar-OS customizations
│ │ └── messageRenderers.tsx
│ └── lib/ # Shared utilities
├── package.json # Frontend dependencies
└── README.md # This file
- Ensure
.envfile exists insrc/backend/with valid API keys - Check that port 4111 is available
- Run
npm run backend:installto ensure dependencies are installed
- Make sure backend is running on port 4111
- Verify
NEXT_PUBLIC_MASTRA_BASE_URLin root.env - Check browser console for detailed error messages
- Verify
OPENAI_API_KEYandEXA_API_KEYare set in backend.env - Check backend terminal for error messages
- Ensure Exa API key is valid and has credits
Apache-2.0