How deepak156566/a2a works
This repository implements an invoice-audit and question-answering product: invoices enter through upload or folder scanning, are extracted and validated, then reported and stored for review; users can query audited results through structured SQL or retrieval-augmented answers. The main service assembles the workflow, database, indexing, and tool runtime. Separate modules provide ADK agents, ERP integration, and a Streamlit interface. The README is empty, and several workflow and UI excerpts were not provided, so some subsystem connections are intentionally omitted rather than inferred.
Main entry points: main.py Agent API · nodes.py Workflow stages · server.py MCP tool server · indexer.py Vector indexer
Components 28
Invoice intake
- Folder monitor
agent/app/monitoring/watcher.py - Invoice extraction
agent/app/extraction/parsing.py - Field normalization
agent/app/extraction/normalize.py
Audit workflow
- Workflow runner
agent/app/workflow/runner.py - Workflow stages
agent/app/workflow/nodes.py - Data validation
agent/app/validation/data_validator.py - Business validation
agent/app/validation/business_validator.py - Decision severity
agent/app/validation/severity.py - Audit reporting
agent/app/reporting/reporter.py - Audit repository
agent/app/database/repository.py
Agent platform
- ADK agent service
agent/app/adk_agents/server.py - Translation agent
agent/app/adk_agents/translation_agent.py - A2A client
agent/app/a2a_client/client.py - MCP tool server
agent/app/tools/server.py - MCP tool bus
agent/app/tools/mcp_bus.py - Safety guardrails
agent/app/guardrails.py - Runtime configuration
agent/app/config.py
Search and Q&A
- Question answering
agent/app/rag/service.py - Query router
agent/app/rag/query_router.py - RAG answer graph
agent/app/rag/rag_graph.py - Vector indexer
agent/app/rag/indexer.py - Semantic retrieval
agent/app/rag/retrieval.py
User and ERP interfaces
- Streamlit UI
streamlit-ui/app/streamlit_app.py - UI data client
streamlit-ui/app/data.py - Agent API
agent/app/main.py - ERP client
agent/app/erp_client/client.py - Mock ERP service
mock-erp/app/main.py
Other components
- Invoice user
Connections 30
- Invoice user → Streamlit UI: uses
- Streamlit UI → UI data client: requests data
streamlit-ui/app/streamlit_app.py - Invoice user → Agent API: submits invoices
- Agent API → Workflow runner: runs workflow
agent/app/main.py - Agent API → Vector indexer: builds index
agent/app/main.py - Agent API → MCP tool server: builds tools
agent/app/main.py - Agent API → Audit repository: reads audit data
agent/app/main.py - Folder monitor → Audit repository: checks invoices
agent/app/monitoring/watcher.py - Folder monitor → Invoice extraction: extracts files
agent/app/monitoring/watcher.py - Workflow runner → Workflow stages: dispatches stages
- Workflow stages → Data validation: validates fields
- Workflow stages → Business validation: checks business rules
- Workflow stages → Audit reporting: generates report
- Workflow stages → Audit repository: persists audit
- Business validation → ERP client: checks ERP
agent/app/validation/business_validator.py - ERP client → Mock ERP service: requests ERP data
- MCP tool server → Data validation: validates invoice
agent/app/tools/server.py - MCP tool server → Audit reporting: builds report
agent/app/tools/server.py - MCP tool server → Vector indexer: indexes invoice
agent/app/tools/server.py - MCP tool bus → MCP tool server: dispatches tools
agent/app/tools/mcp_bus.py - Agent API → Question answering: answers questions
- Question answering → Query router: routes question
agent/app/rag/service.py - Question answering → RAG answer graph: runs RAG
agent/app/rag/service.py - RAG answer graph → MCP tool bus: invokes tools
agent/app/rag/rag_graph.py - Vector indexer → Audit repository: loads invoice data
agent/app/rag/service.py - Semantic retrieval → Vector indexer: uses embeddings
- ADK agent service → Translation agent: serves agent
agent/app/adk_agents/server.py - Agent API → Safety guardrails: configures safety
agent/app/main.py - ADK agent service → Safety guardrails: configures safety
agent/app/adk_agents/server.py - Agent API → Runtime configuration: loads settings
agent/app/main.py