-
Notifications
You must be signed in to change notification settings - Fork 0
ai assistant
ITG Media App's built-in AI features — Avatar Agent for guest pre-show preparation and Site Chat Assistant for visitor support.
ITG Media App includes two AI-powered features:
| Feature | Purpose | Technology |
|---|---|---|
| Avatar Agent | Pre-show guest greeting and preparation | LiveKit AI Agent pipeline, Ollama |
| Site Chat Assistant | Site-wide FAQ chatbot with conversation memory | Ollama + local LLMs |
Both features use Ollama for local LLM inference — your data stays on your server, no API keys or third-party AI services needed.
The Avatar Agent greets guests in a private pre-show room, helps them prepare, and gets them ready before they go live.
Guest joins guest room
│
▼
Avatar Agent greets guest
- Asks for name, intro
- Explains show format
- Tests audio/video
- Answers questions
- Preps talking points
│
▼
Guest is ready → Director brings them on air
| Feature | Description |
|---|---|
| Voice Interaction | Natural voice conversation — no typing required |
| Pre-Show Briefing | Explains the show format, topic, and guest's role |
| AV Check | Verifies guest's camera and microphone are working |
| Talking Points | Reviews key topics the host plans to cover |
| Calming Presence | Helps nervous guests feel comfortable before going live |
| Q&A | Answers guest questions about the show or process |
The Avatar Agent runs as a LiveKit AI Agent using a voice pipeline:
Guest Audio ▶ LiveKit ▶ Whisper (STT) ▶ LLM (Ollama) ▶ TTS ▶ LiveKit ▶ Guest Speaker
| Component | Technology |
|---|---|
| Speech-to-Text | Whisper (via LiveKit) |
| Language Model | Ollama (Llama 3, Mistral, or any local model) |
| Text-to-Speech | LiveKit TTS plugin |
| Orchestration | LiveKit Agents Python framework |
The agent container is defined in agents/Dockerfile.agent:
# Build the agent image
cd agents/
docker build -f Dockerfile.agent -t mediasite-avatar-agent .
# Run alongside LiveKit
docker run -d \
--name avatar-agent \
--network host \
-e LIVEKIT_URL=ws://localhost:7880 \
-e LIVEKIT_API_KEY=$LIVEKIT_API_KEY \
-e LIVEKIT_API_SECRET=$LIVEKIT_API_SECRET \
-e OLLAMA_HOST=http://localhost:11434 \
mediasite-avatar-agentA site-wide FAQ chatbot that helps visitors navigate ITG Media App and answers common questions. Available as a floating chat widget on every page.
| Feature | Description |
|---|---|
| FAQ Responses | Answers common questions about the platform |
| Conversation Memory | Remembers context from previous messages in the session |
| Navigation Help | Directs visitors to the right pages and features |
| Business Hours Mode | Different behavior during business/after hours |
| Rate Limiting | Configurable rate limits to prevent abuse |
| Fallback to Human | Escalates to contact form when AI can't help |
Visitor types message
│
▼
Chat backend receives message
│
▼
Rate limit check
│
▼
FAQ lookup (cached responses for common questions)
│
├── Match found? → Return cached response
│
└── No match? → Query Ollama LLM
│
▼
Return AI-generated response
The Site Chat Assistant is managed via Django Admin under SiteChatConfig:
| Setting | Description |
|---|---|
| Business Hours | Define when the assistant operates in "business" vs "after hours" mode |
| Rate Limits | Max messages per minute/hour per user |
| Fallback Message | Message shown when AI can't answer |
| Welcome Message | Initial greeting shown to visitors |
| Model Selection | Which Ollama model to use |
FAQs are stored as SiteChatFAQ models in Django Admin:
{
"question": "How do I join as a guest?",
"answer": "Click the guest link provided by your host...",
"category": "broadcasting",
"priority": 1
}| Field | Description |
|---|---|
| Question | The FAQ question (triggers a direct match) |
| Answer | Pre-written answer (returned instantly, no LLM call) |
| Category | Group FAQs by topic |
| Priority | Higher priority FAQs are checked first |
Both AI features require Ollama running locally.
# Install Ollama (Linux)
curl -fsSL https://ollama.com/install.sh | sh
# Pull a model (recommended: Llama 3.1 8B or Mistral 7B)
ollama pull llama3.1:8b
# Or a smaller, faster model
ollama pull mistral:7b
# Verify it's running
ollama list
curl http://localhost:11434/api/tags| Model | Size | Speed | Best For |
|---|---|---|---|
llama3.1:8b |
~4.7 GB | Good | Best overall quality, good for both features |
mistral:7b |
~4.1 GB | Fast | Good balance, slightly faster responses |
phi3:mini |
~2.3 GB | Very Fast | Lightweight, good for FAQ-only use |
llama3.2:3b |
~2.0 GB | Very Fast | Budget option, good for simple Q&A |
Ollama automatically uses NVIDIA GPUs if available. For CPU-only servers, expect slower responses but still functional.
# Check if GPU is detected
ollama run llama3.1:8b --verboseUpdate your .env:
# Ollama (optional — for AI features)
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=llama3.1:8b💡 No external API keys needed. Ollama runs entirely on your server. Your conversations stay private.
All chat sessions are stored in the database with conversation history:
| Model | Purpose |
|---|---|
AIPersonality |
Defines the assistant's personality, tone, and behavior |
AIChatSession |
Stores a single chat session with conversation history |
AIChatMessage |
Individual messages within a session |
- View all chat sessions
- See message history per session
- Delete sessions for privacy
- Monitor usage patterns
- Adjust AI personality settings
The AI features use Django Channels for real-time WebSocket communication:
Browser Chat Widget
│
▼ WebSocket
Daphne (ASGI Server)
│
▼
Django Channels Consumer
│
├── FAQ match? → Return directly
│
└── No match? → Ollama API → Return response
The consumer is defined in members/ai_consumer.py and automatically connected via Django Channels routing.
| Aspect | Policy |
|---|---|
| Data Location | All AI processing happens on your server |
| Third-Party APIs | None required — Ollama runs locally |
| Chat Storage | Conversations stored in your PostgreSQL database |
| Data Retention | Configurable — delete old sessions via admin |
| PII Handling | No personal data sent to external services |
- Admin Panel — Manage AI settings and monitor chat sessions
- Deployment — Production Nginx + SSL setup
← Back to Wiki Home