How johnsonhk88/ai-bank-statement-document-automation-by-llm-and-personal-finanical-analysis-prediction works
This repository is a bank-statement automation product: users submit statement PDFs, the system processes and analyzes them asynchronously, and users can inspect results or ask questions. The React SPA fronts a FastAPI service with document, authentication, model-catalog, and agent-run endpoints; Celery provides the documented asynchronous execution path. A separate Deep Agents harness exposes the clearest internal extraction-to-RAG workflow. The README also documents CrewAI and Hermes harnesses, but their implementations are absent from this file tree. Some API-to-worker and UI-to-API links are documented only at product level, so those links are marked unverified.
Main entry points: main.py FastAPI application · agent.py Deep Agents harness · router.tsx Page routing · main.tsx React application
Components 29
Web application
- React application
web/src/main.tsx - Page routing
web/src/router.tsx - Sign in
web/src/pages/LoginPage.tsx - Submit statements
web/src/pages/NewBatchPage.tsx - Batch list
web/src/pages/BatchListPage.tsx - Batch results
web/src/pages/BatchDetailPage.tsx - Web API client
web/src/api/client.ts
API and persistence
- FastAPI application
api/app/main.py - Authentication endpoints
api/app/api/auth.py - Document endpoints
api/app/api/documents.py - Agent-run endpoints
api/app/api/agent_runs.py - Model catalog endpoint
api/app/api/llm.py - LLM provider catalog
api/app/agents/llm_provider.py - Upload storage
api/app/core/storage.py - PostgreSQL
api/app/db/session.py - Celery task queue
api/app/worker/celery_app.py - Run-item task
api/app/worker/tasks.py - Agent run executor
api/app/worker/runner.py
Agent processing
- Agent registry
api/app/agents/registry.py
Deep Agents pipeline
- Deep Agents harness
agents/deep-agents/agent.py - PDF text extraction
agents/deep-agents/tools/pdf_extract.py - PII redaction
agents/deep-agents/tools/pii_redact.py - Vector storage
agents/deep-agents/tools/vector_store.py - RAG retrieval
agents/deep-agents/tools/rag_query.py
Agent harnesses
- CrewAI adapter
api/app/agents/crewai/adapter.py - CrewAI domain skills
backend/app/skills - Hermes harness
Other components
- Statement user
- Configured LLM
Connections 27
- Statement user → React application: uses
README.md - React application → Page routing: renders
web/src/main.tsx - Page routing → Sign in: routes to
web/src/router.tsx - Page routing → Submit statements: routes to
web/src/router.tsx - Page routing → Batch list: routes to
web/src/router.tsx - Page routing → Batch results: routes to
web/src/router.tsx - React application → Web API client: uses
- Web API client → FastAPI application: calls REST
- FastAPI application → Authentication endpoints: mounts
api/app/main.py - FastAPI application → Document endpoints: mounts
api/app/main.py - FastAPI application → Agent-run endpoints: mounts
api/app/main.py - FastAPI application → Model catalog endpoint: mounts
api/app/main.py - Model catalog endpoint → LLM provider catalog: lists models
api/app/api/llm.py - Document endpoints → Upload storage: saves uploads
- FastAPI application → PostgreSQL: checks health
api/app/main.py - Agent-run endpoints → Celery task queue: dispatches work
- Celery task queue → Run-item task: dispatches task
api/app/worker/tasks.py - Run-item task → Agent run executor: invokes
api/app/worker/tasks.py - Agent run executor → Agent registry: selects agent
- Agent registry → CrewAI adapter: selects adapter
- CrewAI adapter → CrewAI domain skills: uses skills
README.md - Deep Agents harness → PDF text extraction: calls
agents/deep-agents/agent.py - Deep Agents harness → PII redaction: calls
agents/deep-agents/agent.py - Deep Agents harness → Vector storage: stores text
agents/deep-agents/agent.py - Deep Agents harness → RAG retrieval: queries
agents/deep-agents/agent.py - Deep Agents harness → Configured LLM: uses model
README.md - Statement user → Hermes harness: can run harness
README.md