“Wall Street trades on numbers. ECHO trades on the drift between the promise and the reality.”
ECHO is a stateful forensic engine designed to track, audit, and verify corporate commitments over time (earnings calls, transcripts, SEC filings). Unlike generic RAG systems that summarize, ECHO emphasizes temporal linking, contradiction detection, and a glass-box audit trail you can inspect end-to-end.
Most LLM workflows are stateless: they retrieve “similar” chunks from different quarters and treat them as isolated paragraphs. They rarely answer the real investor question:
“Did management keep the promise — or did it drift?”
ECHO approaches this as a pipeline:
- Extraction (LLM / embeddings): turn messy executive language into structured entities and evidence.
- Evaluation (code + rules): compare across time and compute alerts/flags consistently.
ECHO follows a split-brain model: Right Brain for semantic extraction, Left Brain for deterministic evaluation.
We don’t just chunk text; we preserve pointers needed for auditability (speaker/section/quarter/paragraph where possible).
Unstructured language is projected into a strict-ish schema (“FIBO-lite”) for:
- Financial targets (revenue, margins, EPS, OpEx, CapEx)
- Tech milestones (process nodes, product timelines)
- Guidance statements (forward-looking commitments + confidence language)
- Risk factors (hedges, uncertainty, warnings)
Entities are linked across quarters (the “same promise” becomes the “same object” across time), enabling differential analysis instead of “fresh summarization” each quarter.
ECHO uses rules and computed signals to flag issues (examples):
if delta_days > 90:
return "TIMELINE_SLIPPAGE"
if hedge_density > 0.15:
return "CONFIDENCE_EROSION"To reduce “black box anxiety”, ECHO emits a JSON audit trail that includes:
- the extracted entities + linked occurrences
- contradiction vectors / slippage metrics (when available)
- confidence components and why the UI shows a risk banner
- Promise timeline: visualize how a commitment evolves quarter-to-quarter (commit → hedge → omission).
- Contradiction alerts: structured contradictions (timeline shifts, conflicting numbers, silence/omission).
- Audit mode: a “glass box” JSON viewer that exposes the reasoning / computed signals.
- Cache warmup for demos: pre-compute a curated Intel query set for instant UX.
- Live market context (optional): integrate real-time analyst consensus (e.g., via Perplexity) alongside internal management claims.
- Backend: FastAPI (
app/), async PostgreSQL (asyncpg), optional Redis caching - Search / RAG: embeddings + hybrid search (
langchain,sentence-transformers), reranking (where enabled) - LLMs: used for extraction/analysis (Cerebras + OpenAI in this repo’s configuration)
- Frontend: Vite + React (
frontend/), Framer Motion, Lucide icons, custom CSS
echo/
├── agent/ # Agent & RAG system
│ ├── rag/ # RAG implementation + services
│ │ ├── echo_reasoning.py
│ │ ├── question_analyzer.py
│ │ ├── search_engine.py
│ │ ├── cache_manager.py
│ │ ├── finance_postprocessor.py
│ │ └── data_ingestion/ # Data pipelines (SEC filings, transcripts, etc.)
│ └── prompts.py # Extraction prompts / schemas
├── app/ # FastAPI application
│ ├── routers/ # API routes (ECHO endpoints live here)
│ ├── schemas/ # Pydantic models (FIBO-lite)
│ └── websocket/ # WebSocket handlers
├── db/ # Database utilities
├── frontend/ # Vite + React UI
└── config.py # Centralized configuration + env accessors
- Python 3.9+
- Node.js 16+
- PostgreSQL (recommended) +
pgvectorextension if you want vector search in Postgres
pip install -r requirements.txtCreate a local .env (ignored by git) and set at least:
DATABASE_URL=postgresql://username:password@localhost:5432/echo
OPENAI_API_KEY=...
CEREBRAS_API_KEY=...
# Optional (for live market context)
PERPLEXITY_API_KEY=...
# Optional (if you enable redis caching)
REDIS_URL=redis://localhost:6379/0python -c "from app.utils.database_init import init_database; import asyncio; import os; asyncio.run(init_database(os.getenv('DATABASE_URL')))"uvicorn app:app --host 0.0.0.0 --port 8000API docs:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
cd frontend
npm install
npm run devOpen: http://localhost:5173
Common endpoints (see /docs for the authoritative list):
GET /echo/config: dynamic tickers/quarters for the UIPOST /echo/analyze: run the ECHO verification flowGET /echo/cache/list: list cached queriesGET /echo/cache/query/{hash}: retrieve a cached resultPOST /echo/cache/warmup: precompute a demo cache set
Example request:
curl -X POST http://localhost:8000/echo/analyze \
-H "Content-Type: application/json" \
-d '{
"question": "Did Intel deliver on their 18A process node promise from Q4 2024?",
"company_id": "INTC",
"anchor_quarter": "Q4 2024",
"verification_quarters": ["Q1 2025"]
}'See agent/rag/data_ingestion/README.md for the full guide. Useful entry points:
# Create tables
python agent/rag/data_ingestion/create_tables.py
# Ingest SEC filings / transcripts (see scripts in agent/rag/data_ingestion/)
python agent/rag/data_ingestion/ingest_sp500_10k.py --max-tickers 5Intel demo helpers (optional):
agent/rag/data_ingestion/ingest_8k_filings.pyagent/rag/data_ingestion/fetch_yahoo_financials.pyagent/rag/data_ingestion/download_all_intel.sh
MIT License