Developer Guide - brahm-ai-official/brahm-ai GitHub Wiki
π Home Β· β¨ Features Β· πΊοΈ Roadmap Β· π§ Philosophy Β· π¨βπ» Developer Guide Β· π Live Platform
π¨βπ» BRAHM-AI Developer & Architecture Guide
This page provides a public high-level guide to the BRAHM-AI architecture.
It does not expose private production credentials, protected prompts, internal datasets, infrastructure secrets, or complete commercial source code.
ποΈ Platform Architecture
BRAHM-AI uses a modular and API-oriented architecture.
User Input
βββ Text
βββ Voice
βββ Camera / Image
βββ Document
βββ Supported Action Request
β
Input Normalization
βββ Language Detection
βββ Speech-to-Text
βββ OCR
βββ Vision Observation
βββ Session Context
β
Intent and Capability Router
βββ General Conversation
βββ Scripture Retrieval
βββ Panchang Computation
βββ Vision Intelligence
βββ Live Search
βββ Market
βββ Agriculture
βββ Language
βββ Automation
β
BRAHM Core Reasoning
βββ Exact Response
βββ RAG Response
βββ Live-Data Explanation
βββ General Reasoning
βββ Safe Fallback
β
Response Delivery
βββ Text
βββ Multilingual TTS
βββ Avatar
βββ Structured Data
βββ Action Result
π§ Central Conversation Flow
BRAHM True remains the primary conversational source.
Responsibilities include:
- Intent analysis
- Context management
- Helper selection
- Structured retrieval
- Live-data routing
- Model routing
- Safety formatting
- Final response generation
BRAHM Voice uses this same central flow.
ποΈ Voice Architecture
Microphone
β
Speech-to-Text
β
Central BRAHM Conversation Flow
β
Response Text
β
Text-to-Speech
β
Lipsync / Avatar / Audio Output
Voice-specific responsibilities:
- Microphone permission
- Audio capture
- Silence and end-of-speech detection
- Duplicate-submit protection
- Language-aware STT
- TTS voice selection
- Playback control
- Avatar states
- Text fallback
Voice should not maintain an independent answer engine when BRAHM True is the source of truth.
π Scripture Retrieval Architecture
Preferred flow:
Query
β
Scripture and Section Detection
β
Exact Lookup
β
Alias and Metadata Matching
β
RAG Retrieval when needed
β
Source Validation
β
Explanation
Structured scripture records may contain:
- Scripture identifier
- Kanda or section
- Chapter or Sarga
- Verse number
- Original Sanskrit
- Translation
- Explanation
- Context
- Keywords
- Source edition
- Verification status
Generated content should not be inserted into canonical datasets without verification.
πͺ Panchang and Jyotish Architecture
Required flow:
Date + Time + Location + Timezone
β
Computation or Provider
β
Structured Result
β
BRAHM Explanation
The reasoning model should not generate exact astronomical values without computation.
π· Vision Architecture
Camera / Uploaded Image
β
Image and Frame Validation
β
Detection / OCR / Scene Analysis
β
Confidence and Safety Checks
β
Structured Visual Observation
β
BRAHM Reasoning
Vision services should support:
- Confidence thresholds
- User verification
- File and image limits
- Privacy-aware processing
- Clear uncertainty
- Medical safeguards
- Graceful fallback
π¦ Garudaa LLMG 108 V2 Architecture
Garudaa is being developed as a local model provider inside the BRAHM ecosystem.
BRAHM Request
β
Identity and Quota Validation
β
Language and Intent Detection
β
Exact Helper Lookup
β
RAG Retrieval
β
Garudaa Local Model
β
Safety and Formatting
β
BRAHM True
β
Text or Voice Delivery
Development goals:
- Compact 3B-class model evaluation
- Local Ollama-compatible serving
- CPU and GPU profiles
- Hindi-first instruction quality
- Sanskrit and Devanagari understanding
- RAG grounding
- Quantization
- Timeout protection
- Model pre-warming
- Usage metering
- Structured logging
π API Architecture
Planned public and partner APIs use versioned routes.
Examples:
/api/v1/chat
/api/v1/panchang/daily
/api/v1/scriptures/search
/api/v1/language/process
/api/v1/vision/analyze
/api/v1/mandi/prices
/api/v1/market/analyze
/api/v1/voice/session
/api/v1/automation/plan
Expected platform features:
- API keys
- Bearer authentication
- Scope-based permissions
- Per-key quotas
- Rate limiting
- Request IDs
- Usage metering
- Structured errors
- Source metadata
- Freshness metadata
- Audit logging
- Streaming where supported
- Test and production environments
π¦ Suggested API Response Envelope
{
"success": true,
"request_id": "req_xxxxx",
"data": {},
"usage": {
"units": 1,
"remaining": 999
},
"meta": {
"language": "hi",
"source_mode": "structured",
"generated_at": "ISO-8601 timestamp"
}
}
Errors should use a predictable structured format and appropriate HTTP status code.
π§± Architecture Principles
Specialized Routing
Use the most appropriate helper, database, provider, computation engine, vision model, retrieval system, or reasoning model.
Exact Data Before Generation
Do not ask the language model to invent data already available from a structured source.
API-Driven Frontend
Keep heavy intelligence, authentication, metering, and routing logic in backend services rather than public UI scripts.
Modular Deployment
Voice, True, vision, language, Panchang, scripture, market, agriculture, automation, wallet, and agents should remain independently upgradeable.
Fallback-Oriented Reliability
A provider failure should not crash the entire user experience.
π Security Requirements
Never expose:
- API keys
- Environment files
- Database passwords
- Private keys
- OAuth secrets
- Payment credentials
- Internal prompts
- User conversations
- Camera or voice data
- Production logs containing sensitive information
Security issues should be reported according to:
https://github.com/brahm-ai-official/brahm-ai/blob/main/SECURITY.md
π§ͺ Testing Areas
Depending on the module, testing should include:
- Syntax and build
- Route and API contract
- Authentication
- Quotas and rate limits
- Database compatibility
- Helper-level behaviour
- Exact retrieval
- RAG fallback
- Multilingual input
- STT and TTS
- Camera and OCR
- Mobile browsers
- Provider timeouts
- Safe fallback
- Cross-module regression
A change to one helper should not silently break unrelated modules.
π Production Safety
Production changes should include:
- Backup
- Syntax or build verification
- Deployment steps
- Service restart
- Health check
- Endpoint verification
- Relevant log checks
- Rollback method
π Public Repository Documents
π€ Development and Licensing
BRAHM-AI is proprietary.
Public documentation does not grant rights to copy, deploy, redistribute, train from, reverse engineer, or commercially reuse protected materials.
For approved collaboration:
- Email: [email protected] , [email protected]
- Website: https://brahm-ai.in
Build modularly. Retrieve exactly. Explain honestly.