🌐 Memory Orders API
LIVELLO 2 service for coherence checks, RAG health aggregation, and sync planning.
📍 Location
- Service:
services/api_memory_orders/ - Pure core:
vitruvyan_core/core/governance/memory_orders/
🚪 Base URL / Port
- Config default:
MEMORY_API_PORT=8016(services/api_memory_orders/config.py)
Deploy note: other documents may refer to a different “fleet” port. Treat docker-compose mapping as the source of truth.
🧭 Endpoints (implemented)
Defined in services/api_memory_orders/api/routes.py:
GET /— service infoGET /health— simple health checkGET /health/rag— full dependency + coherence health (returns503when degraded/critical)POST /coherence— drift analysis between Postgres and QdrantPOST /sync— sync planning (planning only, no execution)GET /metrics— Prometheus (defined inservices/api_memory_orders/main.py)
🧾 Request/Response models
See services/api_memory_orders/models/schemas.py.
📉 POST /coherence
Request (CoherenceRequest):
table: str = "entities"collection: str | nullembedded_column: str = "embedded"
Response (CoherenceResponse):
status: healthy|warning|criticaldrift_percentage: floatrecommendation: strpg_count: intqdrant_count: intdrift_absolute: inttimestamp: strtable: strcollection: str
🔁 POST /sync
Request (SyncRequest):
mode: incremental|full(defaultincremental)table: str = "entities"collection: str | nulllimit: int = 1000
Response (SyncResponse):
operations: SyncOperationResponse[]estimated_duration_s: floatmode: strtotal_operations: int
⚙️ Env vars (service-level)
Loaded in services/api_memory_orders/config.py:
- Service:
MEMORY_API_PORT,LOG_LEVEL - Postgres:
POSTGRES_HOST,POSTGRES_PORT,POSTGRES_DB,POSTGRES_USER,POSTGRES_PASSWORD - Qdrant:
QDRANT_HOST,QDRANT_PORT,QDRANT_COLLECTION - Redis:
REDIS_HOST,REDIS_PORT,REDIS_DB,REDIS_URL - External checks:
EMBEDDING_API_URL,BABEL_GARDENS_URL - Coherence thresholds:
COHERENCE_THRESHOLD_HEALTHY,COHERENCE_THRESHOLD_WARNING - Audit:
MEMORY_AUDIT_TABLE - Flags:
ENABLE_AUTO_SYNC,ENABLE_PROMETHEUS