How malkzidan/brandora-ai works
Brandora AI is an HTTP reply service called by the NestJS backend. Its implemented request path authenticates and validates input, then throttles, cleans, and short-circuits empty messages or exact greeting/thanks rules; remaining messages go to a provider and pass an output guard before returning contract-shaped JSON. The README also describes intent, FAQ, catalog, order, and product-media stages as planned capabilities, but their implementation files are absent from this tree. The mock provider replays scenario answers. Edges for undocumented or unsampled feature wiring are omitted; README-described capability links are identified as such.
Main entry points: orchestrator.py Reply Orchestrator · main.py HTTP API · __init__.py Provider Factory · output_guard.py Output Guard
Components 22
HTTP Contract
- HTTP API
app/main.py - Service Settings
app/config.py - Request Schema
app/schemas/request.py - Response Schema
app/schemas/response.py
Reply Flow
- Reply Orchestrator
app/pipeline/orchestrator.py - Rate Throttle
app/pipeline/throttle.py - Text Preprocessor
app/pipeline/preprocess.py - Fixed Reply Rules
app/pipeline/rules.py - Arabic Normalizer
app/text.py - Output Guard
app/validation/output_guard.py
Answer Providers
- Provider Factory
app/providers/__init__.py - Provider Interface
app/providers/base.py - Mock Provider
app/providers/mock.py - Golden Scenarios
mock_data/scenarios
AI Capabilities
- Intent Detection
app/pipeline - FAQ Answers
app/pipeline - Catalog Search
app/pipeline - Order Candidate
app/pipeline - Product Media
app/pipeline - Redacted Logging
app/observability
Other components
- NestJS Backend
- WhatsApp Customer
Connections 25
- NestJS Backend → HTTP API: posts request
README.md - HTTP API → Request Schema: validates input
app/main.py - HTTP API → Service Settings: loads settings
app/main.py - HTTP API → Provider Factory: builds provider
app/main.py - HTTP API → Reply Orchestrator: dispatches request
app/main.py - HTTP API → Response Schema: validates response
app/main.py - Reply Orchestrator → Rate Throttle: checks limit
app/pipeline/orchestrator.py - Reply Orchestrator → Text Preprocessor: cleans message
app/pipeline/orchestrator.py - Reply Orchestrator → Fixed Reply Rules: checks fixed rules
app/pipeline/orchestrator.py - Fixed Reply Rules → Arabic Normalizer: normalizes phrases
app/pipeline/rules.py - Reply Orchestrator → Provider Interface: requests answer
app/pipeline/orchestrator.py - Reply Orchestrator → Output Guard: validates answer
app/pipeline/orchestrator.py - Output Guard → Arabic Normalizer: normalizes reply
app/validation/output_guard.py - Output Guard → Request Schema: checks catalog context
app/validation/output_guard.py - Provider Factory → Provider Interface: implements contract
app/providers/__init__.py - Provider Factory → Mock Provider: selects mock
app/providers/__init__.py - Service Settings → Provider Factory: configures provider
app/providers/__init__.py - Mock Provider → Golden Scenarios: replays answers
app/providers/mock.py - NestJS Backend → WhatsApp Customer: sends reply
README.md - Reply Orchestrator → Intent Detection: planned feature stage
README.md - Reply Orchestrator → FAQ Answers: planned feature stage
README.md - Reply Orchestrator → Catalog Search: planned feature stage
README.md - Reply Orchestrator → Order Candidate: planned feature stage
README.md - Reply Orchestrator → Product Media: planned feature stage
README.md - Reply Orchestrator → Redacted Logging: planned feature stage
README.md