A simplified market research and gap analysis system powered by Letta's native multi-agent capabilities. MarketGap AI discovers untapped market opportunities by analyzing consulting firm white papers, social signals, and industry trends using a clean, Letta-native architecture.
This implementation follows Letta best practices exactly:
- π€ Manager-Worker Pattern: Single Orchestrator Agent manages all worker agents
- π Shared Memory Blocks: All agents share state via Letta's native memory system
- π οΈ Built-in Tools: Uses Letta's native multi-agent communication tools
- π Exact Workflow: Follows the precise 8-step sequence from workspace rules
- πΎ Persistent State: All agent state persists automatically in Letta's database
graph TD
A[Orchestrator Agent] --> B[Shared Memory Blocks]
A --> C[Worker Agents Created On-Demand]
B --> D[consulting_groups]
B --> E[consulting_docs]
B --> F[gap_list]
B --> G[audience_signals]
B --> H[problem_queue]
B --> I[user_feedback]
B --> J[idea_history]
B --> K[final_ideas]
C --> L[Market Research]
L --> |white-papers| E
C --> N[Market Analyzer]
N --> |gaps| F
C --> M[Social Listener]
M --> |signals| G
C --> O[Solution Generator]
consulting_groups(100 KB) - CSV/JSON of consulting firmsconsulting_docs(10 MB) - PDF chunks {tag, text}gap_list(256 KB) - Market gaps {id, title, severity, summary}audience_signals(5 MB) - Social signals {platform, author, text, sentiment}problem_queue(64 KB) - Ordered gaps sent to UIuser_feedback(64 KB) - User feedback {problemId, action, notes}idea_history(2 MB) - All brainstorming iterationsfinal_ideas(128 KB) - Approved novel ideas
- marketResearch (async) β crawl PDFs from consulting firms
- marketAnalyzer (wait) β produce
gap_list - socialListener (wait) β write combined audience & Google insights to
audience_signals - solutionGenerator (wait) β brainstorm first batch of ideas β
final_ideas - (Competitor check skipped in demo)
- Emit
workflow_completeand show ideas on dashboard
- Node.js 16+ and npm
- Letta Cloud Account (Sign up here)
- Letta API Key (Get one here)
# Clone the repository
git clone <your-repo-url>
cd market-gap
# Install dependencies
npm install
# Set up environment variables
cp .env.example .env.local
# Edit .env.local and add your LETTA_API_KEYCreate a .env.local file:
# Required: Letta Configuration
LETTA_API_KEY=your_letta_cloud_api_key_here
LETTA_BASE_URL=https://api.letta.comnpm run dev
# Navigate to http://localhost:3000/workflow# Start workflow
curl -X POST http://localhost:3000/api/letta-workflow \
-H "Content-Type: application/json" \
-d '{"action": "start", "industry": "FinTech"}'
# Check status
curl http://localhost:3000/api/letta-workflow?action=statusmarket-gap/
βββ src/
β βββ agents/
β β βββ orchestrator/ # Manager agent
β β βββ marketResearch/ # Worker agents
β β βββ marketAnalyzer/
β β βββ socialListener/
β β βββ solutionGenerator/
β β βββ competitorResearch/
β βββ simple-orchestrator.ts # Main Letta-native orchestrator
βββ components/ # React UI components
βββ context/ # React context
βββ types/ # TypeScript types
βββ app/
β βββ api/
β β βββ letta-workflow/ # Single API endpoint
β βββ workflow/ # Dashboard page
β βββ [other pages]/ # Additional UI pages
βββ README.md # This file
βββ SIMPLIFIED_APPROACH.md # Detailed documentation
You can validate everything is wired up in two ways:
- Web UI β Run
npm run devand watch the workflow update live athttp://localhost:3000/workflow. - Direct API β Use the cURL commands in the Quick-Start section to start a workflow and poll for status.
No extra scripts are required.
- Creates and manages all worker agents using Letta's built-in tools
- Uses
send_message_to_agent_asyncfor non-blocking tasks - Uses
send_message_to_agent_and_wait_for_replyfor blocking steps - Maintains workflow state in shared memory blocks
- All agents access the same memory blocks
- Memory persists automatically across sessions
- Follows exact memory block structure from workspace rules
- 10 MB block cap with automatic archival
web_searchβ For research tasksrun_codeβ For data processing- Native multi-agent communication tools
- No custom tools needed
| Before (Complex) | After (Simplified) |
|---|---|
| 7 agent classes + custom tools | 1 orchestrator using Letta's built-ins |
| Multiple API routes | 1 API endpoint |
| Complex agent manager | Native Letta multi-agent system |
| Custom memory system | Shared memory blocks |
| 500+ lines of config | Environment variables only |
- SIMPLIFIED_APPROACH.md β Detailed technical documentation
- Letta Multi-Agent Systems β Official Letta docs
- Multi-Agent Shared Memory β Shared memory guide
- β Letta-Native: Uses built-in multi-agent capabilities
- β Shared Memory: Proper shared memory blocks following workspace rules
- β Manager-Worker: Single orchestrator manages worker agents
- β Exact Workflow: Follows 8-step sequence precisely
- β Dashboard & API Testing: No extra scripts required
- β Clean Architecture: No unnecessary complexity
- β Proper Documentation: Clear, comprehensive guides
- Open http://localhost:3000/workflow and start a new workflow.
- Check shared memory blocks are updating correctly via the dashboard or API.
- Extend with additional worker agents as needed.
- Deploy to production using Letta Cloud.
The multi-agent backend (Orchestrator β Market-Research β Market-Analyzer β Social-Listener) is fully functional and passes all automated tests.
However, the Next.js front-end is still under heavy development β navigation works, but many pages show placeholder data and WebSocket updates are stubbed. Use the dashboard or the API endpoints to exercise the workflow until the UI is finished.
For demo speed we run one Solution-Generator pass and stop. Novelty & competitor checks can be re-enabled after the event.
Built with Letta's stateful agent framework - the future of AI applications.