Centralized Model Context Protocol (MCP) gateway and vector knowledge service for internal enterprise LLM workflows. Provides semantic retrieval over corporate policy documents via pgvector in PostgreSQL 17, role-based tool execution against Odoo ERP and internal business databases, session memory management, semantic caching, and execution audit logging.
Built for deployment inside the corporate intranet network in close proximity to Odoo 18 core services.
- Model Context Protocol (MCP) Server: Standardized JSON-RPC tools and context provider endpoints exposing approved Odoo actions and internal tools to agent frontends.
- Vector Retrieval: Vector similarity search using
pgvectorin PostgreSQL 17 over internal policies, manuals, and technical documentation. - Agent Session Memory: Persistent conversational session store with configurable context limits and automatic memory pruning.
- RBAC & Token Scoping: Tool execution authorization scoped by department and service account permissions.
- Async Tool Execution Queue: Background processing queue for long-running batch or report generation tools.
- Audit Logging: Structured execution tracking capturing caller identity, tool inputs, execution timing, and response status.
- Dynamic Tool Registry: Runtime tool registration and schema discovery for internal REST APIs and database procedures.
- Resilience Controls: Circuit breaker pattern and exponential backoff retry handler for unstable upstream internal HTTP services.
- Prompt & Instruction Management: Agent role prompt template storage with version control.
- Semantic Caching: Query embedding cache layer to reduce PostgreSQL similarity search load on frequent lookups.
- Webhook Notifications: System events and workflow status triggers sent to internal webhooks (e.g., Slack/Teams bridges).
- Prometheus Metrics: High-resolution execution counters and latency histograms exposed on standard
/metricsendpoint.
+-----------------------+ +-------------------------------+ +-------------------------+
| Internal Chat & LLMs | --> | AI Agent Platform (FastAPI) | --> | Odoo 18 / Internal APIs |
+-----------------------+ +-------------------------------+ +-------------------------+
| |
v v
+-----------------+ +------------------+
| PostgreSQL 17 | | Prometheus / |
| + pgvector | | Audit Logs |
+-----------------+ +------------------+
- Python 3.12+
- PostgreSQL 17 with
pgvectorextension installed (CREATE EXTENSION IF NOT EXISTS vector;) - Network connectivity to corporate Odoo 18 server and internal APIs
git clone git@git.internal.corp:corp-it/ai-agent-platform.git
cd ai-agent-platform
python3.12 -m venv venv
source venv/bin/activate
pip install -r requirements.txtCopy the environment template and adjust database credentials:
cp .env.example .envKey configuration keys in .env:
APP_ENV=development
PORT=8000
DATABASE_URL=postgresql+asyncpg://app_user:secret@localhost:5432/ai_agent_platform
ODOO_HOST=https://odoo.internal.corp
ODOO_DB=odoo_prod
ODOO_ADMIN_API_KEY=your_odoo_key
JWT_SECRET_KEY=super-secret-key-change-in-prodRun migrations to create schema and pgvector indexes:
alembic upgrade headuvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadVerify service health:
curl http://localhost:8000/healthThe platform is containerized using Dockerfile (Python 3.12-slim base) and intended to be deployed in Kubernetes or Docker Swarm inside the intranet zone.
docker build -t registry.internal.corp/ai-agent-platform:v1.2.0 .
docker run -d -p 8000:8000 --env-file .env registry.internal.corp/ai-agent-platform:v1.2.0