How bhaskar2303/bankstatementprocessor works
Purpose and Entry Points
This is a Python document-processing/agent pipeline centered on bank-statement inputs, persistent memory, approval artifacts, and telemetry. Primary executable/control entry points are app.py and process_pipeline.py.
Pipeline Orchestration
process_pipeline.py likely coordinates the end-to-end workflow: loading a bank statement, applying configured agent/task stages, storing outputs, and producing approval-ready results. app.py is the application-facing entry point that likely invokes or exposes this pipeline.
Paths: process_pipeline.py, app.py, utils.py
Agent and Task Definition Boundary
Agent behavior and workflow stages are declaratively separated from Python orchestration through YAML configuration. This makes agent roles and task sequencing replaceable without changing the pipeline implementation.
Paths: config/agents.yaml, config/tasks.yaml, config/config_registry.py
Input, Approval, and Output Data Boundary
The pipeline consumes bank statement documents from a dedicated source directory. Structured approved output is kept separately, establishing a clear distinction between raw input and reviewed/accepted records.
Paths: data/bank_statements/bank_statement.pdf, data/approved/bank_statement.json, data/bank_statements
Memory Subsystem
A dedicated memory package persists cross-run or multi-stage context. The presence of episodic and semantic stores suggests separate handling for event/history-oriented memory versus reusable factual knowledge.
Paths: memory/store.py, data/episodic.json, data/semantic.json
Observability and Usage Tracking
Telemetry is isolated from core processing and records tracing and token-consumption information. This is the principal operational boundary for monitoring agent/pipeline execution cost and behavior.
Paths: telemetry/tracing.py, telemetry/data/token_usage_log.csv, telemetry/__init__.py
Runtime and External Dependencies
The runtime is Python, with package boundaries represented by config/__init__.py, memory/__init__.py, and telemetry/__init__.py. Dependencies are declared in requirement.txt. The agent/task configuration and token telemetry indicate integration with an LLM or agent runtime, though no specific provider or service is identifiable from the repository tree alone.
Paths: requirement.txt, config/__init__.py, telemetry/tracing.py
Main entry points: process_pipeline.py Processing pipeline · config_registry.py Configuration registry · store.py Memory store · bank_statements Bank statements
Components 15
Application
- Application entry · Application-facing launcher for the processing workflow.
app.py - Processing pipeline · Coordinates statement processing, agent stages, persistence, and approval output.
process_pipeline.py - Pipeline utilities
utils.py - Dependencies · Runtime dependency declaration.
requirement.txt
Agent Workflow
- Agent definitions · Declarative agent roles and behavior.
config/agents.yaml - Task definitions · Declarative workflow stages and sequencing.
config/tasks.yaml - Configuration registry · Loads or exposes workflow configuration.
config/config_registry.py
Documents & Memory
- Bank statements · Raw bank-statement input directory.
data/bank_statements - Statement PDF
data/bank_statements/bank_statement.pdf - Approved record · Reviewed or accepted structured statement output.
data/approved/bank_statement.json - Memory store · Persists context across pipeline stages or runs.
memory/store.py - Episodic memory · Event and history-oriented memory.
data/episodic.json - Semantic memory · Reusable factual knowledge memory.
data/semantic.json
Observability
- Tracing · Captures pipeline and agent execution telemetry.
telemetry/tracing.py - Token usage log · Records agent-runtime token consumption.
telemetry/data/token_usage_log.csv
Connections 14
- Application entry → Processing pipeline: invokes
- Processing pipeline → Pipeline utilities: uses
- Processing pipeline → Configuration registry: loads workflow config
- Configuration registry → Agent definitions: reads
- Configuration registry → Task definitions: reads
- Statement PDF → Bank statements: stored in
- Bank statements → Processing pipeline: input documents
- Processing pipeline → Approved record: produces approval artifact
- Processing pipeline → Memory store: reads and writes context
- Memory store → Episodic memory: persists events
- Memory store → Semantic memory: persists knowledge
- Processing pipeline → Tracing: emits telemetry
- Tracing → Token usage log: records usage
- Dependencies → Processing pipeline: provides runtime packages