# Architecture

The repository contains two deployable applications.

- `src/enterprise_ai/` is the Enterprise AI gateway. It owns the public API, authentication, persistence, execution logging, agent registration, and external service adapters.
- `services/chatbot/` is an independent chatbot API. The gateway can call it through `CHATBOT_AGENT_URL`.

Within the gateway, dependencies flow inward: `api` routes call `core` execution services, which use `agents` registration metadata and `services/adapters` integrations. Database entities live in `models`; HTTP and database payloads live in `schemas`.

Add an external agent by adding one entry to `enterprise_ai.agents.catalog.AGENT_ROUTES` and its adapter under `services/adapters/`.
