Skip to main content

RAG Entity Definitions

Entity definitions, key concepts, relationships, business logic state machines, and integration points for AI agent context.

Core Entities

EntityDefinitionExample
TenantTop-level organization (franchise, enterprise)"Burger Chain Inc."
LocationPhysical restaurant or virtual location"Downtown SF Store #42"
UserPerson with platform accessStaff member, manager, customer
RolePermission set assigned to users"Server", "Manager", "Owner"
OrderCustomer food/drink transactionOrder #12345 with 3 items
MenuCollection of items for sale"Lunch Menu", "Happy Hour"
TablePhysical or virtual dining spot"Table 7", "Takeout #3"
TicketKitchen order display recordKDS ticket for Order #12345

Business Entities

EntityDefinitionExample
ShiftScheduled work period"9AM-5PM Server Shift"
Time PunchClock in/out record"Clocked in at 8:55 AM"
ReservationFuture table booking"Party of 4, 7PM, Smith"
Gift CardStored value payment method"$50 Gift Card #GC123"
LoyaltyCustomer rewards program"Gold member, 500 points"
CampaignMarketing promotion"20% off first order"

Technical Entities

EntityDefinitionExample
Edge ServerOlympusEdge on-premise device"edge-sf-downtown-001"
Sync QueuePending cloud sync items"45 orders queued"
PolicyBusiness rule configuration"Auto-gratuity 18% for 6+"
Feature FlagFeature toggle"voice_ordering_enabled"
WebhookEvent notification endpoint"orders.created -> POS"

Business Logic Summary

Order State Machine

DRAFT → OPEN → SENT → PREPARING → READY → SERVED → CLOSED
↓ ↓
MODIFIED PAID

Table States

AVAILABLE → SEATED → ORDERED → SERVED → CHECK_DROPPED → CLEARED

PAID

Payment States

PENDING → AUTHORIZED → CAPTURED → COMPLETED
↓ ↓
DECLINED REFUNDED (partial/full)

Shift States

SCHEDULED → CLOCKED_IN → ON_BREAK → CLOCKED_OUT → APPROVED

OFF_BREAK

Integration Points

Payment Processors

ProcessorUse CaseIntegration
StripePrimary card processingAPI + Terminal SDK
SquareAlternative processorAPI
AdyenEnterprise clientsAPI

Delivery Platforms

PlatformIntegration Type
DoorDashAPI + Webhook
Uber EatsAPI + Webhook
GrubhubAPI + Webhook

Accounting

SystemIntegration
QuickBooksOAuth + API
XeroOAuth + API
SageAPI

Communication

ChannelProvider
SMSTwilio
EmailSendGrid
VoiceTwilio
PushFCM/APNs

Error Handling

Common Error Codes

CodeMeaningResolution
400Bad requestCheck request body format
401UnauthorizedRefresh token or re-login
403ForbiddenUser lacks permission
404Not foundResource doesn't exist
409ConflictConcurrent modification
422Validation errorCheck field requirements
429Rate limitedReduce request frequency
500Server errorRetry with backoff

Error Response Format

{
"error": {
"code": "VALIDATION_ERROR",
"message": "Order items cannot be empty",
"details": [
{"field": "items", "message": "At least one item required"}
],
"request_id": "req-abc123"
}
}

AI Agent Specific Context

Maximus (Cockpit AI)

Maximus is the operations AI assistant in Cockpit. Capabilities:

  • Monitor system health and alerts
  • Answer operational questions
  • Execute runbooks (with approval for risky actions)
  • Provide real-time metrics and insights
  • Manage incident response

Common Commands:

  • "What's the current P1 status?"
  • "Who is on-call for platform?"
  • "Show me orders per minute for SF Downtown"
  • "Why did auth-service latency spike?"
  • "Execute memory runbook for order-service"

Minerva (Sales AI)

Minerva is the sales and marketing AI. Capabilities:

  • Lead qualification and scoring
  • Meeting scheduling
  • Demo assistance
  • ROI calculations
  • Competitive analysis

Common Queries:

  • "What features does competitor X have?"
  • "Calculate ROI for 5-location restaurant"
  • "Schedule demo with lead #1234"
  • "What's our pricing for enterprise tier?"

AI assistant for restaurant staff. Capabilities:

  • Answer menu questions
  • Suggest items based on preferences
  • Handle dietary restrictions
  • Explain ingredients and allergens

Common Queries:

  • "What's gluten-free on the menu?"
  • "Describe the chef's special"
  • "What pairs well with the ribeye?"
  • "Is the pasta vegan-friendly?"

Customer Support Agent

AI assistant for customer support. Capabilities:

  • Answer common questions
  • Process simple requests
  • Escalate complex issues
  • Track order status

Common Queries:

  • "Where is my order?"
  • "How do I update my payment method?"
  • "I need to cancel my reservation"
  • "How do I earn loyalty points?"

Data Freshness

Data TypeUpdate FrequencyCache TTL
OrdersReal-time0 (no cache)
Menu itemsOn change5 minutes
InventoryReal-time0 (no cache)
SchedulesOn change15 minutes
Analytics5 minutes5 minutes
ReportsHourly1 hour

Security Context

Data Classification

ClassificationExamplesHandling
PublicMenu items, hoursNo restrictions
InternalRevenue, metricsEmployee access
ConfidentialCustomer PIIEncrypted, audit logged
RestrictedPayment dataPCI compliant, tokenized

Access Control

  • RBAC - Role-based access control for all operations
  • MFA - Required for admin and financial access
  • Audit Logging - All data access is logged
  • Encryption - Data encrypted at rest and in transit

Performance Benchmarks

OperationTarget LatencyP99
Order creationUnder 100msUnder 200ms
Payment processingUnder 2sUnder 3s
Menu fetchUnder 50msUnder 100ms
KDS updateUnder 50msUnder 100ms
SearchUnder 200msUnder 500ms
Report generationUnder 5sUnder 10s

  • Querying - Query patterns and retrieval strategies
  • Indexing - How documents are indexed
  • Overview - RAG Knowledge Base overview