Finance Agent
The maintained finance showcase is examples/pydantic/finance_agent.py.
It is the main example for:
- a direct module-level
Agent(...)plusAdapterConfig(...)surface PrepareToolsBridgemode shaping- structured native plan generation
- approval-gated writes with
FileSystemProjectionMap - file-backed ACP session persistence
Why This Example Exists
Older examples in this repo split these ideas across separate files. That made the codebase noisy and kept coverage low in files that were too small to justify keeping around.
finance_agent.py intentionally keeps those ACP surfaces together in one realistic workflow:
askmode for read-only inspectionplanmode for ACP-native structured planstrademode for approval-gated note updates
Run It
uv run python -m examples.pydantic.finance_agent
By default the example uses TestModel. Set ACP_FINANCE_MODEL when you want a live model.
Remote ACP hosting path:
acpkit serve examples.pydantic.finance_agent:agent --host 0.0.0.0 --port 8080
acpkit run --addr ws://127.0.0.1:8080/acp/ws
Key Patterns
- the module exports plain
agent,config, andmainsymbols without factory wrappers FinancePlanPersistenceProviderwrites ACP plans into.acpkit/plans/PrepareToolsBridgekeepsask,plan, andtradebehaviors explicit instead of scattering them across separate examplesFileSystemProjectionMapturns note reads and writes into rich ACP diffsNativeApprovalBridgekeeps mutating writes truthfully approval-gated