EcoAgent — Real-Time Economic Intelligence, Spoken by AI

Inspiration

Most people find out about economic shifts after they've already been affected — after inflation spikes, after markets crash, after rate decisions ripple through their savings. Financial intelligence has always been locked behind Bloomberg terminals, expensive subscriptions, and jargon-heavy reports written for professionals. I wanted to build the opposite: an agent that monitors the economic pulse of the world for you, briefs you like a personal analyst, and speaks the answer aloud in plain English. JARVIS for the economy — for anyone.

What It Does

EcoAgent is a voice-activated AI economic intelligence agent. You say "Hey Eco, what's happening with US inflation?" and within seconds it:

Ingests live financial news from multiple sources Synthesises signals across CPI data, market movements, and geopolitical context Delivers a concise, cited spoken briefing — "Boss, US CPI dropped to 2.88% as energy prices stabilised..." Displays source-linked news cards and economic indicators on a mission-control dashboard

It moves beyond chat. It reasons across live data, plans a response, and executes — the definition of an agent.

How I Built It

Agent Architecture: User speaks "Hey Eco" Wake word detection triggers Speech Recognition Query hits FastAPI /ask endpoint

Backend runs three things in parallel:

  • Gemini 1.5 Flash: synthesises response, cites sources, returns structured JSON
  • NewsAPI: pulls live financial headlines
  • Economic signals: CPI, Fed rate context, market data Response shape: { speech, countries, prediction, newsCards, sources } ElevenLabs converts speech field to audio Frontend renders news cards, ticker, and indicators

Stack:

AI Brain: Google Gemini 1.5 Flash — handles reasoning, synthesis, citation, and structured JSON output Backend: FastAPI (Python) on Railway — orchestrates data ingestion and agent logic Frontend: React + Next.js deployed on Vercel — real-time news ticker, conversation memory, mission-control UI Voice: Web Speech API (wake word) + ElevenLabs (TTS output) Data: NewsAPI for live headlines; structured prompting for economic signal extraction

Partner Integration — Elastic MCP: EcoAgent uses the Elastic MCP server to index and search ingested news articles, enabling the agent to ground its reasoning in semantically retrieved documents rather than raw API dumps. This gives Gemini a retrieval layer — the agent searches the Elastic index for relevant prior briefings and live documents before synthesising its response, dramatically improving answer quality and citation accuracy.

Challenges

The hardest part wasn't the AI — it was the infrastructure.

Next.js TypeScript compilation errors blocked deployment for days (next.config.ts vs .js, missing type declarations for browser Speech APIs, Three.js namespace collisions) Getting Gemini to return consistently structured JSON required careful prompt engineering with explicit fallback parsing ElevenLabs latency meant careful async handling — the agent had to feel responsive, not laggy Keeping the UI non-generic was a deliberate design choice; most AI dashboards look identical. EcoAgent's mission-control aesthetic is intentional and functional

What I Learned

Agentic architecture is fundamentally about tool orchestration — the AI is only as good as what you give it to work with Structured output from LLMs requires treating the prompt as a contract, not a suggestion Voice-first UX is underexplored in the agent space — most demos are text-only; adding speech changes the entire feel of the product Real deployments surface edge cases that local testing never will

What's Next

Elastic vector search for semantic news retrieval (deeper MCP integration) World Bank + FRED API for richer macro data Country-level globe highlighting as EcoAgent speaks User authentication + personalised briefing profiles Mobile app (React Native)

Built With

  • elastic
  • elevenlabs
  • fastapi
  • google-gemini
  • newsapi
  • next.js
  • python
  • react
  • vercel
Share this project:

Updates