Project Info
Inspiration
Business decisions rarely fail because teams lack dashboards. They fail because the evidence is scattered across departments, the relationships between metrics are hard to inspect, and recommendations arrive without a clear explanation of why anyone should trust them. MetricThread began with a VP-of-Growth question: when customer acquisition cost starts rising, how can a team quickly determine which upstream business signal deserves attention—and confidently act on it without treating an AI explanation as proof? We wanted to build something more useful than “chat with your CSV.” MetricThread continuously connects Client, Financial, and Partner signals, detects evidence-backed predictive relationships, and turns them into a decision workflow that people can inspect, challenge, and measure.
What it does
MetricThread is an Enterprise Intelligence Agent for auditable business decisions. It monitors cross-functional metrics, detects statistically significant predictive lead–lag relationships, and presents the evidence before generating a recommendation. Its hero scenario identifies a decline in partner referral quality that predicts a rise in client acquisition cost. A user can: Start a live event feed and watch metrics update. Inspect retained signals in an Evidence Ledger. Open an Evidence Casefile to replay the underlying series, see candidate tests, rejected negative controls, ADF preparation, q-values, F-statistics, effect sizes, fingerprints, and confidence components. Review Evidence Resilience, which uses rolling historical windows and a target-history baseline before allowing a new recommendation. Move a recommendation from proposed to planned to implemented, then record a measured outcome. Ask grounded questions that return cited signal and insight IDs—or explicitly refuse when evidence is unavailable. Run a bounded marketing-spend scenario with forecast intervals, assumptions, reliability, and supporting evidence.
How we built it
We built MetricThread as a React/Vite frontend and FastAPI backend, with Supabase Postgres for durable evidence and decision records, and Upstash Redis Streams for the live event pipeline. The system uses a deterministic seeded enterprise dataset spanning 180 days and nine metrics across Client, Financial, and Partner domains. Redis Streams fan each event into independent hot and cold consumer paths: one powers the live dashboard and the other persists data for historical analysis. The statistical core uses Python, pandas, NumPy, and statsmodels. It aligns daily series, checks stationarity, applies differencing when needed, selects model history with BIC, evaluates directed Granger tests, and applies Benjamini–Hochberg correction across the full candidate family. Confidence is computed deterministically from adjusted significance, incremental effect, sample adequacy, and recency. For the intelligence layer, we implemented an OpenAI Responses integration with strict structured output. The model receives only a compact, validated evidence packet; server-side checks require valid cited IDs, preserve deterministic confidence, and reject causal language. Codex helped us plan the architecture, implement the pipeline and product surfaces, build tests, and harden the deployment path.
Challenges we ran into
The hardest problem was making the product genuinely trustworthy rather than merely polished. We had to ensure the signal engine did not simply rediscover the relationship we wanted. That meant testing the complete cross-domain candidate family, using multiple-testing correction, and carrying two unrelated negative controls through the workflow. We also learned that a significant full-history result is not enough. A relationship can look strong overall but fail across historical windows or add no value beyond the target metric’s own history. This led to Evidence Resilience: a rolling-origin validation layer that suppresses unstable signals before they can produce a new recommendation. Finally, we had to make the live demo feel operational. The workspace now supports real persisted decision lifecycle changes and outcome tracking, so judges can experiment with the product rather than only watch a static dashboard.
Accomplishments we're proud of
Built a deterministic-first intelligence system where evidence comes before AI narration. Created the Evidence Casefile: an inspectable forensic record for every retained signal. Added rolling-origin resilience checks, negative-control validation, and baseline comparisons to suppress unstable recommendations. Kept confidence immutable and reproducible rather than model-generated. Built a complete evidence-to-action loop: signal → insight → recommendation → implementation → measured outcome. Made unsupported questions refuse instead of inventing an answer. Delivered a distinctive enterprise product experience that prioritizes inspectability over dashboard theatre.
What we learned
We learned that “AI for analytics” becomes much more compelling when the AI is the final interpreter, not the source of truth. We also learned that explainability is not a tooltip. It needs to be part of the product architecture: persisted evidence, reproducible tests, negative controls, model versions, confidence components, and a clear record of what a recommendation is based on. Most importantly, we learned that predictive evidence should support human judgment—not replace it. MetricThread is designed to help teams make better decisions with an inspectable trail behind every important recommendation.
What's next
Next, we want to connect governed real-world sources such as CRM, ERP, support, and marketing platforms while preserving the same evidence boundary. We also plan to add authenticated workspaces, decision ownership, richer audit attribution, collaboration workflows, scheduled executive briefings, and calibrated recommendation evaluation based on real outcomes. Longer term, MetricThread can become a decision-intelligence layer for enterprises: continuously finding meaningful cross-functional signals, validating them over time, and helping teams turn evidence into accountable action.
MetricThread
Grounded cross-functional intelligence for auditable business decisions.
MetricThread is an Enterprise Intelligence Agent for a VP-of-Growth workflow. It continuously simulates Client, Financial, and Partner signals; identifies statistically corrected predictive lead-lag evidence; exposes every retained signal as an auditable Evidence Casefile; requires resilience validation before a new model narrative can become a recommendation; and lets an executive test one constrained marketing-spend scenario.
MetricThread is a seeded enterprise scenario with a real, persisted decision workflow: lifecycle changes, outcomes, briefings, and forecasts are saved by the workspace.
The executive journey
- Start the live event feed: one compressed business day (nine events) emits every five seconds.
- Inspect the accepted evidence: partner referral quality is predictive of client acquisition cost in the seeded fixture after correction for the complete candidate family.
- Open the Evidence Casefile: replay the source and target series, inspect every candidate/rejected result, stationarity preparation, q/F/effect/sample/fingerprint values, the compact provider packet, cited IDs, immutable confidence, and causal-language refusal.
- Inspect Evidence Resilience: rolling-origin windows compare the signal-assisted forecast with a target-history-only baseline, require every negative control to stay rejected, and suppress unstable signals from new model narratives.
- Review an evidence-linked narrative, recommendation, confidence decomposition, and human-controlled decision status.
- Ask a grounded follow-up. Factual answers cite stored insight and signal IDs; unsupported questions explicitly return
no_evidence. - Test a deterministic marketing-spend change over one through seven days. The returned baseline, forecast interval, reliability, assumptions, and signal IDs are stored with the decision record.
Architecture
flowchart LR
S[Seeded synthetic generator] --> R[Upstash Redis Stream]
R --> H[Hot consumer group\nrolling dashboard window]
R --> C[Cold consumer group\nSupabase Postgres]
C --> E[Deterministic signal engine\nADF, BIC, Granger, BH]
E --> K[Evidence Casefile\nreplay and model boundary]
E --> R[Rolling-origin resilience\nbaseline and control gate]
R --> I[Evidence-linked insight\nand recommendation]
E --> F[Deterministic scenario forecast]
K --> U[React executive dashboard]
I --> U[React executive dashboard]
F --> U
The stream uses independent hot and cold consumer groups, acknowledgements, recovery, and idempotent cold writes. The signal engine requires 60 usable daily observations, applies stationarity preparation and BIC-selected history through seven days, then retains only Benjamini–Hochberg adjusted q <= 0.05 evidence. A score named confidence_v1 is deterministic (significance 40%, incremental effect 25%, sample adequacy 20%, recency 15%); a model may narrate it but cannot change it. resilience_rolling_origin_v1 evaluates four historical origins, requires the accepted signal in at least three, requires at least three target-history baseline wins, and requires both declared controls to remain rejected at every origin before a new recommendation is eligible.
Evidence semantics
- A displayed relationship is predictive lead-lag evidence, never proof that one business event caused another.
- Evidence includes source/target metrics, p and q values, F statistic, effect size, sample size, BIC model history, a stable fingerprint, and confidence components.
- The generator deliberately plants a partner-referral-quality to CAC relationship and two unrelated negative controls. These are test fixtures, not real-world findings.
- Grounded narratives receive a compact accepted-evidence packet, must cite stored IDs, are checked server-side, and reject causal wording or unknown citations.
- A Casefile recomputes the deterministic test family in memory for inspection but never overwrites persisted evidence.
- Resilience assessments are versioned and linked to an exact evidence fingerprint. A missing, stale, or failing assessment blocks a new model-generated recommendation; it does not erase past human decision records.
- Recommendation actions stay human-controlled:
proposed → planned → implemented; only an implemented recommendation can receive a measured outcome.
Local setup
Requirements: Python 3.13+, uv, Node 20+ and npm. Create your own .env; it is ignored by Git.
cp .env.example .env
uv sync
cd frontend && npm ci && cd ..
./scripts/test
Configure the variables in .env:
UPSTASH_REDIS_REST_URLandUPSTASH_REDIS_REST_TOKENare required for the simulator and Stream consumers.SUPABASE_URLandSUPABASE_SECRET_KEYare required for the server-side durable data, evidence, and decision stores. Never place the secret key infrontend/.OPENAI_API_KEYandOPENAI_REASONING_MODELenable evidence-grounded narrative generation. Keep both server-side.
The first two migrations and the canonical 1,620-row fixture are already applied to the project used during development. For a fresh Supabase project, apply the existing foundation and signal-engine migrations and seed according to the SQL/Python commands in the charter. Phase 6 additionally requires db/migrations/003_phase6_readiness.sql and db/migrations/004_evidence_resilience.sql before running the current API against Supabase. If a direct Postgres connection is available, use:
uv run python -m metricthread.cli migrate
uv run python -m metricthread.cli seed
uv run python -m metricthread.cli signals
uv run python -m metricthread.cli resilience
If direct database TCP is unavailable, open Supabase Dashboard → SQL Editor → New query, paste and run db/migrations/003_phase6_readiness.sql followed by db/migrations/004_evidence_resilience.sql. The latter creates versioned resilience records. Then run uv run python -m metricthread.cli resilience to persist the current active-signal assessments through the server-side Supabase Data API.
Start the backend and frontend in separate terminals:
uv run uvicorn metricthread.api:app --reload
cd frontend && npm run dev
Open http://localhost:5173. The Vite development proxy forwards API requests to http://localhost:8000.
Validation
Run the full local check before proposing or committing changes:
./scripts/test
This runs the Python suite and a Vite production build. The raw Postgres integration test is intentionally skipped in the current environment because the Supabase pooler resets direct TCP connections; deployed persistence is tested through the server-side Supabase Data API instead. The exact historical test results and decisions are recorded in the charter.
Deployment and interactive workspace
The supplied configuration builds the FastAPI API as a Render Docker service and the Vite frontend on Vercel. Follow the detailed deployment runbook. In short:
- Apply the Phase 6 and Evidence Resilience Supabase migrations, then persist assessments with
uv run python -m metricthread.cli resilience. - Deploy the API from
render.yamlwithDEMO_READ_ONLY=false. - Deploy the frontend with
VITE_API_BASE_URLset to the Render API origin. - Set
CORS_ALLOWED_ORIGINSon Render to the exact Vercel origin, redeploy, then run the rehearsal command.
The deployed workspace uses a seeded scenario for its data layer while retaining real human decision tracking. Recommendation lifecycle changes, measured outcomes, scenario forecasts, and briefings persist through the server-side Supabase stores. The live pipeline writes through its durable cold path.
uv run python -m scripts.phase6_rehearsal --base-url https://YOUR-RENDER-API.onrender.com
Built with Codex + GPT-5.6
MetricThread was built with Codex as an active engineering collaborator, from the first architecture decisions through implementation, verification, and the judge-ready product surface.
How we used Codex
Codex helped translate the original idea into a phase-gated engineering plan, then implement and validate the product end to end. Its work included:
- designing the generic event schema and deterministic seeded enterprise dataset;
- implementing the React/Vite workspace and FastAPI service;
- building the Upstash Redis Streams hot/cold pipeline with independent consumer groups, acknowledgements, recovery, and idempotent durable writes;
- implementing the ADF, BIC, Granger, Benjamini–Hochberg, confidence, Casefile, and rolling-origin resilience layers;
- writing focused regression tests for negative controls, grounded citations, recommendation transitions, outcome recording, and unsupported-question refusal;
- refining the live demo path, deployment configuration, and auditable project documentation.
The result is not a generated dashboard prototype. It is a testable system with a deterministic evidence layer, an interactive decision workflow, and an explicit model boundary.
How we used GPT-5.6
GPT-5.6 is integrated through the OpenAI Responses API as MetricThread's evidence-grounded reasoning layer. It receives only a compact, validated packet for an already accepted signal and must return strict structured output with the stored signal ID. Server-side validation rejects unknown citations and causal wording, while the deterministic confidence score remains immutable. The model explains evidence; it does not calculate it, select it, or execute a decision.
In practice, the deterministic engine first finds and validates a predictive lead–lag signal. Evidence Resilience then checks that the relationship remains stable across rolling historical windows, beats a target-history baseline, and keeps negative controls rejected. Only then can GPT-5.6 receive the compact evidence packet to write an executive-facing narrative and a human-controlled recommendation. This keeps language generation useful while making the facts, score, and decision boundary inspectable.
The project does not present an unverified model response as GPT-5.6 output. The full implementation record is in the Codex and model collaboration record.
Before submission, a funded OpenAI structured-output call must pass the same groundedness checks, and the public video must accurately show and narrate that result. The remaining evidence and manual checklist are in:
Build Week's public requirements include a working Codex + GPT-5.6 project, setup/sample-data documentation, a public sub-three-minute narrated YouTube demo, a repository with a license, and the relevant /feedback session ID. See the official Devpost challenge page for the current requirements.
API surface
| Endpoint | Purpose |
|---|---|
GET /agent/status, GET /metrics/live | Live-agent status and hot rolling metrics |
POST /simulation/start | Start the seeded live event feed |
GET /signals, POST /signals/run | Accepted evidence and deterministic analysis |
GET /signals/{id}/casefile | Forensic replay, test-family ledger, model packet, citations, and causal-language guard |
GET /signals/{id}/resilience, POST /signals/{id}/resilience/run | Versioned rolling-origin resilience record |
GET /insights, GET /insights/{id}, POST /insights/generate | Grounded narratives and recommendations |
POST /recommendations/{id}/status, POST /recommendations/{id}/outcomes | Human-controlled decision tracking |
GET /briefings/latest, POST /briefings/generate, POST /chat | Executive briefing and structured-retrieval chat |
POST /scenarios/forecast | Bounded marketing-spend scenario |
GET /health | Deployment health check |
Production boundary
MetricThread is a Build Week prototype. It deliberately does not claim multi-tenant RBAC, real-data PII governance, calibrated production forecasts, durable scheduled jobs, or autonomous execution. The production roadmap records the upgrade paths for those capabilities.
License
This repository is available under the MIT License.
Analysis
View
Metric
- 18
Figures cover GitHub contributors during the hackathon window. A co-authored commit counts in full for each author, so per-member totals add up to more than the whole-team figures.
Technology
- CSSIn code
- FastAPIIn code
- HTMLIn code
- JavaScriptIn code
- PythonIn code
- ReactIn code
- SQLIn code
- DockerClaimed
- PostgreSQLClaimed
- RedisClaimed
- SupabaseClaimed
- VercelClaimed
7 of 12 appear in the indexed code. 5 claimed on Devpost could not be matched to code, which may simply mean the tool leaves no trace in the repository.
AI coding agents
- CodexConfig
Detected from committed agent config files and commit authorship. Absence of a signal is not proof an agent was unused.
Codebase size
Source size
495 KB
Source files
62
Counts recognized source files only; vendored directories, binaries and lockfiles are excluded, so this is smaller than the repository on disk.
Repository
Venkat-Kolasani/MetricThread-Enterprise.Intelligence.Agent
73 files · 693 KB · @ cb28ebf
Structure
Interface
10 files · 14%Screens, components and styles rendered to the user.
Application logic
23 files · 32%Domain rules, services and shared utilities.
Data & schema
5 files · 7%Schema definitions, migrations and data access.
Supporting
Layers are inferred from where files sit in the tree, not from reading the code. A project that names its directories unconventionally will read oddly here — open the file browser to check anything the diagram implies.
Languages
- Python44%
- Markdown34%
- JavaScript11%
- CSS9%
- SQL3%
- YAML0%
- Other (1)0%
Share of indexed source by file size. Binary and vendored files are excluded.
Dependencies
pyproject.toml
pypi · 8- fastapi
- httpx
- numpy
- pandas
- psycopg[binary]
- python-dotenv
- statsmodels
- uvicorn[standard]
frontend/package.json
npm · 4- react
- react-dom
- +2 more
Declared in the repository’s manifests at the indexed commit. A declared package is not proof it is used, and runtime dependencies are listed first.
This project’s features have not been analysed yet.
Export this project's context (description, README, evidence, key source files) to chat with an AI agent elsewhere.