AI-powered market research that runs in minutes, not days
Multi-agent system that collects live data, analyzes markets in parallel, and self-refines reports before delivery
Quick Start β’ Features β’ Architecture β’ Roadmap
Make professional-grade market intelligence accessible to everyone β founders, analysts, students, and researchers β without expensive subscriptions or manual data collection. MNI uses coordinated AI agents and real-time public data to generate structured reports grounded in actual sources, not hallucinations.
Traditional market research is:
- Slow: Analysts spend 4-8 hours manually collecting data from news sites, job boards, Wikipedia, and forums
- Fragmented: Information scattered across dozens of sources with no unified view
- Expensive: Professional reports cost $500-$5,000 per market
- Stale: By the time a report is finished, parts are already outdated
Existing AI tools either:
- Summarize a single source (limited scope)
- Generate confident-sounding text with no real data backing (hallucinations)
- Require manual prompt engineering for each section (not automated)
MNI runs an 8-stage autonomous pipeline with specialized AI agents:
- Research Agent β Fetches live data from DuckDuckGo, Wikipedia, and HackerNews (no LLM calls)
- Market + Capability Agents β Run in parallel via ThreadPoolExecutor to analyze market dynamics and required skills
- Strategy Agent β Synthesizes entry paths, opportunities, and risks
- Critic Agent β Reviews all sections for weak claims and contradictions, provides structured feedback
- Refinement Loop β Automatically reruns flagged sections with critic's improvement instructions
- Visualization Agent β Extracts chart-ready JSON for 7 interactive Plotly visualizations
- TL;DR Agent β Generates executive summary card with key metrics and verdict
Every section is grounded in data collected at runtime. No hardcoded content. No simulated results.
| Feature | Description |
|---|---|
| 7 Specialized Agents | Each agent has one job: research, market analysis, capability mapping, strategy, critique, refinement, visualization, or executive summary |
| Parallel Execution | Market and Capability agents run concurrently, cutting pipeline time by ~40% |
| Self-Refinement Loop | Critic agent scores each section (1-10); sections scoring <7 are automatically rewritten with specific improvement instructions |
| TL;DR Summary Card | Executive brief with market size, growth rate, entry difficulty, time-to-revenue, best opportunity, biggest risk, and verdict |
| Market Disambiguation | Vague inputs like "trading" or "AI" are automatically clarified before search to avoid irrelevant results |
| SHA-256 LLM Cache | Identical prompts served from memory β no duplicate API calls within a session |
| 7 Interactive Charts | Market metrics, trend momentum, skills radar, risk matrix, quality gauges, learning timeline, key players |
| Intelligence War Room UI | Dark obsidian theme with amber accents, real-time pipeline progress, inline charts in tabs |
| CLI Runner | Headless mode for scripting, automation, or CI pipelines |
| Export Options | Download full report as Markdown or research data separately |
| Timestamp Tracking | Every report shows generation time, data freshness, sources fetched, and refinement count |
| Inline Visualizations | Charts embedded directly in relevant tabs (trends in Market, skills in Capabilities, risks in Strategy) |
Input: "Cybersecurity"
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Stage 1 β Research Agent β
β Fetches live data from DuckDuckGo, Wikipedia, β
β and HackerNews. No LLM calls β pure data collection. β
β Stores everything in shared AgentMemory. β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
β
βββββββββββββββββ΄ββββββββββββββββ
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββββββ
β Stage 2a β β Stage 2b β
β Market Agent β PARALLEL β Capability Agent β
β Market size, βββββββββββββΊβ Skills, tools, β
β players, β β salaries, hiring β
β funding, β β trends, learning β
β disruption β β roadmap β
ββββββββββ¬βββββββββ ββββββββββββ¬βββββββββββ
βββββββββββββββββ¬ββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Stage 3 β Strategy Agent β
β Synthesizes market-entry plan from both analyses. β
β Identifies entry paths, risks, and unfair advantages. β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Stage 4 β Critic Agent (Backend Only) β
β Reviews all sections for contradictions and weak β
β claims. Returns structured JSON feedback with scores. β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Stage 5 β Refinement Loop β
β Automatically reruns agents for sections scoring <7. β
β Injects critic's improvement instructions into prompt. β
β User never sees critic feedback β only improved output.β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Stage 6 β Visualization Agent β
β Makes one LLM call to extract chart-ready JSON β
β from the full report for all 7 Plotly charts. β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Stage 7 β TL;DR Agent β
β Generates executive summary card with key metrics, β
β verdict, sentiment, and top 3 companies. β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββ
βΌ
Output: Structured Report
+ TL;DR Summary Card
+ 7 Interactive Charts
+ Markdown Export
market-narrative-intelligence/
β
βββ agents/
β βββ base_agent.py # Abstract base: cache-aware LLM call + memory helpers
β βββ research_agent.py # Stage 1: live data collection (no LLM)
β βββ market_agent.py # Stage 2a: market size, players, funding, disruption
β βββ capability_agent.py # Stage 2b: skills, tools, salaries, hiring trends
β βββ strategy_agent.py # Stage 3: market-entry strategy synthesis
β βββ critic_agent.py # Stage 4: quality review with structured JSON feedback
β βββ visualization_agent.py # Stage 6: chart-ready JSON extraction
β βββ tldr_agent.py # Stage 7: executive summary card generation
β
βββ app/
β βββ streamlit_app.py # Intelligence War Room UI (dark theme, inline charts)
β βββ charts.py # 7 Plotly chart functions + render_all_charts()
β
βββ core/
β βββ orchestrator.py # 8-stage pipeline coordinator (ThreadPoolExecutor)
β βββ cache.py # SHA-256 in-memory LLM response cache
β βββ memory.py # Shared key-value store for inter-agent communication
β
βββ llm/
β βββ groq_client.py # Groq API wrapper (call tracking + token counting)
β
βββ mcp/
β βββ tools.py # Tool dispatcher: DuckDuckGo, Wikipedia, HackerNews
β
βββ .env.example # Environment variable template
βββ requirements.txt # Python dependencies
βββ run_analysis.py # CLI runner (argparse, markdown/json output)
Key Design Decisions:
- Agent Isolation: Agents communicate exclusively through
AgentMemoryβ no direct agent-to-agent calls - Cache Strategy: LLM responses cached via SHA-256 hash of prompt+system; tool calls never cached (always fresh data)
- Parallel Stage 2: Market and Capability agents run concurrently via
ThreadPoolExecutorto reduce total pipeline time - Backend-Only Critic: Critic feedback and refinement details never shown to user β only the improved final report
- Single Orchestrator: Only
Orchestratorknows the pipeline order; agents are stateless and reusable
| Step | Action | What Happens |
|---|---|---|
| 1 | Open dashboard | Intelligence War Room UI loads at localhost:8501 |
| 2 | Enter market name | Type "Cybersecurity" or click suggested market button |
| 3 | Click INITIATE ANALYSIS | 8-stage pipeline starts; real-time progress updates |
| 4 | View TL;DR card | Executive summary with market size, growth, difficulty, verdict |
| 5 | Read sections | Research, Market, Capabilities, Strategy tabs |
| 6 | Explore inline charts | Trends in Market tab, skills radar in Capabilities, risk matrix in Strategy |
| 7 | View all charts | Charts Overview tab shows all 7 visualizations together |
| 8 | Check full report | Full Report tab shows complete Markdown document |
| 9 | Export | Download as .md with one click |
| Component | Technology | Notes |
|---|---|---|
| LLM Provider | Groq | Free tier: 14,400 requests/day |
| Model | llama-3.1-8b-instant |
Fast inference, high rate limits |
| Temperature | 0.3 |
Low for factual, consistent output |
| Max Tokens | 2048 per call |
Per agent call |
| Source | Used For | API |
|---|---|---|
| DuckDuckGo Search | Market size, news, skills, tools, salaries, hiring data | duckduckgo-search library |
| Wikipedia | Background context and industry overviews | wikipedia library |
| HackerNews | Developer sentiment and trending discussions | Algolia public API |
| Layer | Technology | Purpose |
|---|---|---|
| Web UI | Streamlit 1.35+ | Intelligence War Room dashboard |
| Charts | Plotly 5.18+ | 7 interactive visualizations |
| Concurrency | Python ThreadPoolExecutor |
Parallel Stage 2 execution |
| Caching | SHA-256 in-memory | Custom SimpleCache for LLM responses |
| HTTP | requests library |
API calls to HackerNews |
| Environment | python-dotenv |
.env file management |
Requirements: Python 3.10+, a free Groq API key
git clone https://github.com/your-username/market-narrative-intelligence.git
cd market-narrative-intelligencepip install -r requirements.txtcp .env.example .envOpen .env and set your key:
GROQ_API_KEY=your_groq_api_key_herepython -m streamlit run app/streamlit_app.pyOpen http://localhost:8501 in your browser.
# Output to terminal (Markdown)
python run_analysis.py "Cybersecurity"
# Save as Markdown file
python run_analysis.py "FinTech" --output report.md
# Save as JSON
python run_analysis.py "AI SaaS" --format json --output report.json- Obsidian black background (
#0c0c0c) with dot-grid texture - Amber/gold accents (
#f59e0b) for highlights and borders - Typography: Courier Prime (headings), IBM Plex Sans (body), IBM Plex Mono (metrics)
- Custom metric cards with amber top borders (no default Streamlit metrics)
- Animated pipeline progress with stage numbers
[00]through[07]
Appears immediately after metrics row, before tabs:
- Market size and growth rate
- Entry difficulty with explanation
- Time to revenue estimate
- Best opportunity and biggest risk
- Opinionated verdict
- Sentiment badge (BULLISH/NEUTRAL/BEARISH)
- Top 3 key players
Charts embedded directly in relevant tabs:
- Market Analysis tab: Trend momentum chart
- Capabilities tab: Skills radar + learning timeline (2 columns)
- Strategy tab: Risk matrix + company relevance (2 columns)
- Charts Overview tab: All 7 charts in one view
8 error types with clear explanations and actionable guidance:
- API key required/invalid
- Rate limit reached
- Network error
- Empty/too short market name
- Analysis failed
Contributions are welcome! A few guidelines to keep the codebase clean:
- One agent, one job: Each agent reads from and writes to
AgentMemory. Agents must not call other agents directly. - No hardcoded data: All data must come from live tool calls in
mcp/tools.py. - Keep the pipeline order: The 8-stage sequence in
core/orchestrator.pyis intentional β don't reorder stages without understanding memory dependencies. - Test with real markets: Before opening a PR, run the full pipeline against at least one market and verify output quality.
# Fork β branch β commit β PR
git checkout -b feature/your-feature-name
git commit -m "feat: describe your change"
# Open a pull request against main# Run a full analysis to test changes
python run_analysis.py "test market" --output test_report.md
# Or use the dashboard
python -m streamlit run app/streamlit_app.pyInput: "Cybersecurity"
TL;DR Card:
- Market Size: $190B
- Growth Rate: 12% CAGR
- Entry Difficulty: HIGH (Requires deep technical expertise and security certifications)
- Time to Revenue: 12-18 months
- Best Opportunity: Cloud security for SMB segment
- Biggest Risk: Regulatory compliance complexity
- Verdict: Attractive for well-funded teams with domain expertise β avoid if bootstrapping
- Sentiment: BULLISH
- Key Players: CrowdStrike Β· Palo Alto Networks Β· Fortinet
Report Sections:
- Research Summary (data sources and counts)
- Market Analysis (size, players, funding, disruption)
- Capability Analysis (skills, tools, salaries, learning roadmap)
- Strategic Entry Plan (entry paths, opportunities, risks)
Charts:
- Market Metrics Overview (bar chart)
- Trend Momentum (horizontal bar)
- Skills Demand Radar (spider chart)
- Risk Assessment Matrix (scatter plot)
- Section Quality Scores (gauge charts)
- Learning Timeline (Gantt-style)
- Key Market Players (horizontal bar)
MIT License β free to use, modify, and distribute. See LICENSE for details.
Built with:
- Groq β Ultra-fast LLM inference
- DuckDuckGo β Privacy-focused search
- Wikipedia β Free knowledge base
- HackerNews β Developer community
- Streamlit β Rapid web app framework
- Plotly β Interactive visualizations
Built with π€ AI agents Β· π Live data Β· π Self-refinement
No hallucinations. No hardcoded data. Just real intelligence.