How atharva3131/autonomous-ai-system-for-revenue-operations-aaro- works
Purpose and Runtime
AARO is a Python 3.9+ API service for autonomous B2B revenue operations: ingest CRM data, identify pipeline risks/SOP gaps, produce decisions using sales knowledge, execute corrective actions, and route impactful work through approval. The primary entry point is the ASGI application in aboa/main.py, launched with python -m aboa.main or Uvicorn. A lightweight separate demo UI exists in ui/server.py and ui/app.js.
API Composition and Cross-Cutting Platform
aboa/main.py is the composition root for feature APIs and platform concerns. Core services provide authentication, tenant context, middleware, health endpoints, configuration, logging, and monitoring:
• aboa/core/auth.py
• aboa/core/tenant.py
• aboa/core/health.py
These establish request-level security/isolation and operational boundaries before requests reach domain modules. Environment-driven settings are centralized in aboa/core/config.py.
Data Ingestion Boundary
The ingestion layer exposes CRM-facing APIs and normalizes externally sourced sales data—deals, pipeline state, and activity—into the application’s revenue domain:
• aboa/data_ingestion/api.py
• aboa/data_ingestion/service.py
• aboa/data_ingestion/connectors.py
Connectors are the external-system boundary; the service should isolate provider-specific retrieval/normalization from downstream intelligence. Shared revenue entities and statuses are represented in aboa/models/revenue_entities.py and aboa/models/enums.py.
Revenue Intelligence and Decisioning
The decision subsystem transforms normalized pipeline signals into prioritized revenue interventions. Pipeline-risk detection identifies stalled deals, missing follow-ups, inactive high-value opportunities, and SOP deviations; velocity and sales-process optimizers assess execution improvements:
• aboa/decision/pipeline_risk_detector.py
• aboa/decision/revenue_decision_engine.py
• aboa/decision/pipeline_velocity_optimizer.py
Its API boundary is aboa/decision/api.py. This stage consumes ingestion outputs plus knowledge context, then emits decisions suitable for execution or approval.
Knowledge / RAG Context
Sales SOPs, playbooks, and successful-pattern context are managed behind a dedicated knowledge subsystem:
• aboa/knowledge/manager.py
• aboa/knowledge/embeddings.py
• aboa/knowledge/vector_store.py
This is the RAG and vector-database integration boundary. Decisioning should request relevant policy/context through the knowledge manager rather than couple directly to embedding or vector-store implementations.
Human Approval and Notifications
High-impact decisions are held at a human-control boundary rather than executed autonomously:
• aboa/human_loop/api.py
• aboa/human_loop/approval_handlers.py
• aboa/human_loop/notification_service.py
Approval models and sales-manager interactions live in aboa/human_loop/models.py and aboa/human_loop/sales_manager_interface.py. Approved/rejected outcomes feed back into action execution.
Action Execution and External Integrations
The action layer executes approved or policy-safe interventions—tasks, follow-up messages, CRM updates, and manager alerts—with retry-oriented engine behavior:
• aboa/action/engine.py
• aboa/action/integration_hub.py
• aboa/action/api.py
integration_hub.py is the preferred boundary for outbound CRM/workflow/notification services. aboa/orchestration.py likely coordinates the end-to-end control flow: ingest → detect/decide → approve when needed → execute → observe.
Observability and Deployment
Revenue-impact activity and operational metrics are captured separately from business execution:
• aboa/observability/activity_logger.py
• aboa/observability/metrics_collector.py
• aboa/observability/api.py
Infrastructure supports containerized deployment via Dockerfile, docker-compose.yml, and Kubernetes manifests under k8s/. Database schema and audit evolution are provisioned through scripts/init-db.sql and scripts/migrations/, while Kubernetes monitoring configuration is in k8s/monitoring.yaml.
Main entry points: main.py ASGI API application · revenue_decision_engine.py Revenue decision engine · service.py CRM normalization service · engine.py Action engine
Components 21
Runtime
- ASGI API application · Composes feature APIs and request platform concerns.
aboa/main.py - Demo UI
ui/server.py - End-to-end orchestrator · Coordinates ingest, decide, approve, execute, and observe.
aboa/orchestration.py
Data Ingestion
- Revenue entities · Normalized deals, pipeline state, activity, and statuses.
aboa/models/revenue_entities.py - Ingestion API
aboa/data_ingestion/api.py - CRM normalization service · Isolates provider retrieval and normalization.
aboa/data_ingestion/service.py - CRM connectors
aboa/data_ingestion/connectors.py - CRM providers
Revenue Intelligence
- Decision API
aboa/decision/api.py - Revenue decision engine · Prioritizes revenue interventions from signals and context.
aboa/decision/revenue_decision_engine.py - Pipeline risk detector · Finds stalled, inactive, and SOP-deviant opportunities.
aboa/decision/pipeline_risk_detector.py - Knowledge manager · Provides relevant SOP, playbook, and success-pattern context.
aboa/knowledge/manager.py - Vector store integration
aboa/knowledge/vector_store.py
Human Control & Actions
- Approval API
aboa/human_loop/api.py - Approval handlers · Routes high-impact decisions for manager approval or rejection.
aboa/human_loop/approval_handlers.py - Action engine · Executes policy-safe or approved interventions with retries.
aboa/action/engine.py - Integration hub · Connects CRM, workflow, and notification services.
aboa/action/integration_hub.py
Platform
- Auth & tenant context · Applies request security and tenant isolation.
aboa/core/auth.py - Environment settings
aboa/core/config.py - Health endpoints
aboa/core/health.py - Activity & metrics · Records revenue-impact activity and operational metrics.
aboa/observability/activity_logger.py
Connections 25
- ASGI API application → Auth & tenant context: applies
- ASGI API application → Environment settings: loads
- ASGI API application → Health endpoints: serves
- ASGI API application → Ingestion API: mounts
- ASGI API application → Decision API: mounts
- ASGI API application → Approval API: mounts
- Demo UI → ASGI API application: uses
- Ingestion API → CRM normalization service: ingests
- CRM normalization service → CRM connectors: retrieves from
- CRM connectors → CRM providers: connects to
- CRM normalization service → Revenue entities: normalizes into
- End-to-end orchestrator → CRM normalization service: starts ingestion
- End-to-end orchestrator → Revenue decision engine: requests decision
- Revenue entities → Pipeline risk detector: supplies pipeline signals
- Pipeline risk detector → Revenue decision engine: reports risks
- Decision API → Revenue decision engine: requests
- Revenue decision engine → Knowledge manager: retrieves context
- Knowledge manager → Vector store integration: queries
- Revenue decision engine → Approval handlers: submits high-impact work
- Approval API → Approval handlers: manages
- Approval handlers → Action engine: approved outcome
- Revenue decision engine → Action engine: policy-safe action
- Action engine → Integration hub: executes through
- End-to-end orchestrator → Activity & metrics: records lifecycle
- Action engine → Activity & metrics: emits activity