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— especiallydocs/architecture.mdanddocs/api-and-cli.md. Anything labeled future, roadmap, or aspirational may not exist in the codebase yet.
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.
| 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). |
| 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. |
User-Agent policy; FRED API terms when used.Targets below apply once a hosted product and user base exist; the open-source repo is primarily engineering-quality driven.
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.
Backend (src/)
requirements.txt), Django REST Framework.warehouse (Company, Filing, Fact, sections/tables, derived metrics, CRM staging, listed issuers, EDGAR sync state), sec_edgar (client, parsers, sync/ingest services, management commands), public_data (FRED series bundles and observations), api (v1 routes + legacy /api/ alias).data/reference/ (schemas, taxonomies, financial model, SIC reference, accounting map); bulk and ZIP loaders where implemented./api/v1/companies/, filings, facts, sections, tables, derived metrics, peer groups, company metadata, SIC reference, health, series bundles and observations; actions such as sync submissions/facts and ingest HTM where exposed on viewsets.DATABASE_URL; Docker Compose (API, Postgres, optional Vite dev, nginx static UI, CI test profile); GitHub Actions CI.Frontend (frontend/)
Data repo (data/)
data/reference/; samples under data/samples/; large proprietary exports in data/local/ (gitignored; see README.md).Optional / peripheral
warehouse/services/leadership_ai.py, analyze_leadership command / POST /companies/{id}/analyze-leadership/) that extracts initiatives, verbatim quotes, and direction strictly from ingested SEC filing excerpts into LeadershipAnalysis. Gated behind ENABLE_AI_ANALYSIS (off by default; NoopAnalyzer no-op), with the anthropic SDK as a lazy optional dependency (requirements-ai.txt)—not part of the core web API or PRD MVP for the Django app.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.
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.
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.
Visualization and analysis
Charts, multi-company compare, AI-generated summaries. Future; backend data supports stepping stones.
Customization
Filters by form type, date range, sections; tabular vs chart vs narrative views. Future (API filters exist in places; productized UI TBD).
docs/distributed-storage.md): content-addressed raw EDGAR/FRED cache, revalidate-not-refetch pulls, local compressed backup, Kaggle clean snapshots.| 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 |
Format: As a [user], I want [capability] so that [benefit].
Core
Visualization and customization
Advanced
11–16. Accounts, export, alerts, AI chat, collaboration, third-party APIs → Future (see 4.3).
User-Agent (USER_AGENT_EMAIL).DJANGO_SECRET_KEY when DEBUG=false.| 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) |
User-Agent.requirements.txt, requirements-dev.txt; Node.js for frontend build.sec.gov (and related); fred.stlouisfed.org when using FRED.data/reference/ and data/manifest.json index.| 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. |
docs/ (e.g. EDGAR API summaries).This PRD is a living document. Update the implementation status section when major capabilities ship or pivot.