fredgar-ai

Product Requirements Document (PRD): Fredgar AI

How to use this document: Product vision, roadmap, and “implemented vs planned” live here. For architecture, every REST route, and management commands, use the technical index at docs/README.md — especially docs/architecture.md and docs/api-and-cli.md. Anything labeled future, roadmap, or aspirational may not exist in the codebase yet.

1. Document overview

1.1 Purpose

This PRD describes Fredgar AI (FRED + EDGAR, with AI; repository: fredgar-ai): a web-oriented system to extract, normalize, and explore SEC EDGAR company and filing data alongside FRED macro series, with a path toward AI-assisted interpretation and summaries. The long-term vision includes LLM-driven parsing, narrative insights, and rich visualizations; the current product emphasizes direct SEC APIs, a structured warehouse (companies, filings, XBRL facts, derived metrics), a versioned REST API, and a React UI.

1.2 Scope

Area Status
In scope (vision) EDGAR discovery and sync; structured financial and filing data; API and UI for search and exploration; optional macro series (FRED); future AI summaries, charts, accounts, and alerts.
In scope (shipped today) Django + DRF backend; sec_edgar (SEC client, HTM ingest, submissions/facts sync); warehouse models and CRM staging/match flows; public_data + FRED; Vite/React frontend; Docker Compose; CI (Ruff, migrations, pytest, frontend build).
Out of scope (near term) Real-time trading, brokerage integration, custom model training, non-SEC primary sources (except optional FRED and future third-party enrichments).

1.3 Version history

Version Date Notes
1.0 2025-08-19 Initial draft (AI-centric analyzer concept).
1.1 2025-08-19 User stories added.
2.0 2026-03-28 Aligned with implemented stack; removed duplicate sections; added implementation status and roadmap split.
2.1 2026-09-20 Distributed extract storage spec (incremental EDGAR/FRED cache, Kaggle + local clean snapshots).
2.2 2026-09-20 Bonus: Kaggle inbound identify/extract/enrich for companies, industries, markets, economies.

1.4 Stakeholders


2. Business goals and objectives

2.1 Goals

2.2 Success metrics (aspirational)

Targets below apply once a hosted product and user base exist; the open-source repo is primarily engineering-quality driven.

2.3 Market context

The market for financial data and filing analysis is crowded (aggregators, terminals, EDGAR mirrors). Differentiation for this product is transparent SEC-sourced pipelines, API-first design, CRM-to-CIK workflows, and planned LLM layer on top of structured facts—not a black-box terminal.


3. Target audience and personas

3.1 Audience

3.2 Personas (unchanged themes)

  1. Alex the Analyst — Quarterly and annual views, comparisons, accuracy and speed.
  2. Sam the Student — Search by name, simple exploration, export for assignments.
  3. Ivy the Investor — Ticker-first flows; later: alerts and mobile-friendly views.

4. Features and requirements

4.1 Implementation status (March 2026)

Backend (src/)

Frontend (frontend/)

Data repo (data/)

Optional / peripheral

4.2 Roadmap: core product (from vision, not all built)

  1. Company search and selection
    Search by CIK, ticker, or name with autocomplete; results show name, ticker, CIK, industry/SIC where available. Partially met via API and UI patterns; polish and UX TBD.

  2. Data extraction
    10-K, 10-Q, 8-K, and other forms via submissions index and filing links; historical range; pagination. Partially met via sync and filing models; not all form types or UX filters are product-complete.

  3. Parsing and structure
    HTM parsing and XBRL fact ingestion into relational models; derived metrics and reference-driven KPI definitions. Partially met; full statement views (balance sheet / income / cash flow as polished reports) remain roadmap.

  4. Visualization and analysis
    Charts, multi-company compare, AI-generated summaries. Future; backend data supports stepping stones.

  5. Customization
    Filters by form type, date range, sections; tabular vs chart vs narrative views. Future (API filters exist in places; productized UI TBD).

4.3 Advanced / growth features (future)

4.4 User flows (representative)

Flow Today Target
Find company API/UI search and metadata Autocomplete + richer industry context
Sync EDGAR Commands + API actions One-click sync from UI with progress
Inspect facts API + exploratory UI Curated statement views and charts
CRM match Staging + match commands Guided UI workflow
Ask AI Not in core web app Chat grounded in facts and excerpts

4.5 User stories (with rough status)

Format: As a [user], I want [capability] so that [benefit].

Core

  1. Alex — Search by CIK, ticker, or name → Partial (API/backend; UI evolving).
  2. Sam — Autocomplete search → Planned (polish).
  3. Ivy — Fetch 10-Q / 10-K for a company → Partial (sync + filings; UX TBD).
  4. Alex — AI parses filings into statements → Future (structured facts today; LLM narrative later).
  5. Sam — Trends and ratios over time → Partial (facts/metrics; visualization TBD).
  6. Ivy — Benchmarks and risk-style insights → Future (AI/analytics).

Visualization and customization

  1. Alex — Interactive multi-company charts → Future.
  2. Sam — Filter by form, date, section → Partial (API); UI Planned.
  3. Ivy — Tabular / chart / narrative views → Partial / Future.
  4. Alex — Side-by-side compare (e.g. up to 5 names) → Future.

Advanced

11–16. Accounts, export, alerts, AI chat, collaboration, third-party APIs → Future (see 4.3).


5. Non-functional requirements

5.1 Performance

5.2 Security and compliance

5.3 Usability

5.4 Reliability

5.5 Technical stack (as implemented)

Layer Technology
Backend Django 5+, Django REST Framework, Python 3.12+
Frontend React, TypeScript, Vite
Database SQLite (default), PostgreSQL (DATABASE_URL)
SEC integration Direct HTTP APIs, sec_edgar client and services
Macro data FRED via public_data (optional FRED_API_KEY)
Quality Ruff, pytest, pytest-django, coverage gates in CI
Containers Dockerfile(s), Docker Compose, optional nginx for static UI
Optional AI Anthropic SDK for the leadership narrative analyzer (ENABLE_AI_ANALYSIS, off by default)

6. Assumptions and dependencies

6.1 Assumptions

6.2 Dependencies


7. Risks and mitigations

Risk Probability Impact Mitigation
SEC API or policy changes Medium High Abstract client; document env vars; monitor SEC developer updates.
Rate limiting / blocking Medium Medium Backoff, caching, single descriptive User-Agent.
XBRL / form heterogeneity High Medium Tests on sampled payloads; incremental parser coverage.
AI hallucination (when added) Medium High Ground answers in retrieved facts; citations; human review for high-stakes use.
Scope creep (AI vs data platform) Medium Medium Keep structured pipeline as source of truth; AI as optional layer.

8. Appendix

8.1 Glossary

8.2 References


This PRD is a living document. Update the implementation status section when major capabilities ship or pivot.