BRI is an open-source, empathetic multimodal agent for video processing that enables users to upload videos and ask natural language questions to receive context-aware, conversational responses.
π New to BRI? Check out the Quick Start Guide to get up and running in 5 minutes!
- π₯ Video Upload & Management: Drag-and-drop upload with library view and thumbnails
- π¬ Conversational Interface: Chat naturally about your video content with context awareness
- π Multimodal Analysis:
- Frame extraction and captioning (BLIP)
- Audio transcription with timestamps (Whisper)
- Object detection and tracking (YOLOv8)
- π§ Smart Memory: Maintains conversation history per video for seamless follow-ups
- π¨ Warm UI/UX: Feminine design touches with soft colors and friendly interactions
- β‘ Fast Responses: Intelligent Redis caching and optimized processing
- π― Intelligent Routing: Automatically determines which tools to use based on your question
- π Timestamp Navigation: Click timestamps in responses to jump to specific moments
- π‘ Proactive Suggestions: Get relevant follow-up questions after each response
- Content Questions: "What's happening in this video?"
- Timestamp Queries: "What did they say at 2:30?"
- Object Search: "Show me all the cats in this video"
- Transcript Search: "Find when they mentioned 'deadline'"
- Follow-ups: "Tell me more about that" (BRI remembers context!)
BRI is designed to be:
- Empathetic: Warm, supportive tone throughout
- Accessible: No technical knowledge required
- Conversational: Like discussing content with a knowledgeable friend
- Privacy-Focused: Local storage by default
- Graceful: Friendly error messages and fallback strategies
The fastest way to get BRI up and running:
-
Set your API key in
.env:nano .env # Update: GROQ_API_KEY=your_actual_key -
Deploy with one command:
./deploy_test.sh
-
Access the app: http://localhost:8501
π Full guide: DEPLOY_TO_TEST.md | β‘ Quick reference: QUICK_START.md
For development and customization:
- Python 3.9 or higher
- Groq API key (Get one here)
- Redis (optional, for caching)
- Clone the repository:
git clone <repository-url>
cd bri-video-agent- Install dependencies:
pip install -r requirements.txt- Set up environment variables:
cp .env.example .env
# Edit .env and add your GROQ_API_KEY- Initialize the database:
python scripts/init_db.py- (Optional) Validate your setup:
python scripts/validate_setup.py- Start the MCP server (in one terminal):
python mcp_server/main.py- Start the Streamlit UI (in another terminal):
streamlit run app.py- Open your browser to
http://localhost:8501
bri-video-agent/
βββ models/ # Data models and schemas
βββ services/ # Core business logic
βββ tools/ # Video processing tools
βββ mcp_server/ # Model Context Protocol server
βββ ui/ # Streamlit UI components
βββ storage/ # Database and file storage
βββ scripts/ # Utility scripts
βββ tests/ # Test suite
All configuration is managed through environment variables in the .env file. See .env.example for all available options.
GROQ_API_KEY: Your Groq API key (required)- Get one at console.groq.com
- The application will not start without this
GROQ_MODEL: LLM model to use (default:llama-3.1-70b-versatile)GROQ_TEMPERATURE: Response creativity (0-2, default:0.7)GROQ_MAX_TOKENS: Maximum response length (default:1024)
REDIS_URL: Redis connection URL (default:redis://localhost:6379)REDIS_ENABLED: Enable/disable Redis caching (default:true)- Falls back gracefully if Redis is unavailable
DATABASE_PATH: SQLite database location (default:data/bri.db)VIDEO_STORAGE_PATH: Uploaded videos directory (default:data/videos)FRAME_STORAGE_PATH: Extracted frames directory (default:data/frames)CACHE_STORAGE_PATH: Processing cache directory (default:data/cache)
MCP_SERVER_HOST: Server host (default:localhost)MCP_SERVER_PORT: Server port (default:8000)
MAX_FRAMES_PER_VIDEO: Maximum frames to extract (default:100)FRAME_EXTRACTION_INTERVAL: Seconds between frames (default:2.0)CACHE_TTL_HOURS: Cache expiration time (default:24)
MAX_CONVERSATION_HISTORY: Messages to keep in context (default:10)TOOL_EXECUTION_TIMEOUT: Tool timeout in seconds (default:120)REQUEST_TIMEOUT: Request timeout in seconds (default:30)LAZY_LOAD_BATCH_SIZE: Images per lazy load batch (default:3)
DEBUG: Enable debug mode (default:false)LOG_LEVEL: Logging level - DEBUG, INFO, WARNING, ERROR (default:INFO)
The application validates configuration on startup and will:
- β Fail if required values are missing or invalid
β οΈ Warn about suboptimal settings (e.g., Redis disabled, debug mode enabled)- β Create necessary directories automatically
π Complete Documentation Index - Find all documentation in one place
- User Guide - Complete guide to using BRI
- Troubleshooting - Solutions to common issues
- Configuration Reference - All configuration options explained
- MCP Server API - API endpoints and tool documentation
- API Examples - Practical code examples for API integration
- Requirements - Feature requirements
- Design - System architecture and design
- Implementation Tasks - Development task list
- Deployment Guide - Production deployment instructions
- Quick Start - Get started in 5 minutes
# Run all tests
pytest
# Run with coverage
pytest --cov=. tests/
# Run specific test file
pytest tests/unit/test_memory.py
# Run integration tests
pytest tests/integration/-
Setup Development Environment:
python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt cp .env.example .env # Edit .env with your API key
-
Run in Development Mode:
# Terminal 1: MCP Server with auto-reload python mcp_server/main.py # Terminal 2: Streamlit with auto-reload streamlit run app.py
-
Run Tests Before Committing:
pytest
-
Check Code Quality:
# Format code black . # Lint code flake8 . # Type checking mypy .
BRI uses a modular, layered architecture:
βββββββββββββββββββββββββββββββββββββββββββ
β Streamlit UI Layer β
β (Chat, Library, Player, History) β
βββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββββββββββββββββ
β Agent Layer β
β (Groq Agent, Router, Memory, Context) β
βββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββββββββββββββββ
β MCP Server Layer β
β (FastAPI, Tool Registry, Redis Cache) β
βββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββββββββββββββββ
β Video Processing Tools β
β (OpenCV, BLIP, Whisper, YOLO) β
βββββββββββββββ¬ββββββββββββββββββββββββββββ
β
βββββββββββββββΌββββββββββββββββββββββββββββ
β Storage Layer β
β (SQLite Database, File System) β
ββββββββββββββββββββββββββββββββββββββββββββ
- UI Layer: Streamlit-based interface with warm, approachable design
- Agent Layer: Groq-powered conversational agent with intelligent tool routing
- MCP Server: FastAPI server exposing video processing capabilities
- Tools Layer: Open-source video processing tools (OpenCV, BLIP, Whisper, YOLO)
- Storage Layer: SQLite for metadata and memory, file system for videos and frames
For detailed architecture documentation, see Design Document.
- Frontend: Streamlit with custom CSS
- LLM: Groq API (Llama 3.1 70B)
- Video Processing:
- OpenCV (frame extraction)
- BLIP (image captioning)
- Whisper (audio transcription)
- YOLOv8 (object detection)
- API Server: FastAPI with CORS support
- Caching: Redis (optional but recommended)
- Database: SQLite
- Language: Python 3.9+
- Groq: Fast, high-quality LLM inference
- Open-source tools: No vendor lock-in, community-driven
- Streamlit: Rapid UI development with Python
- SQLite: Simple, reliable, no separate server needed
- Redis: Optional caching for performance boost
BRI exposes a REST API through the MCP server for programmatic access to video processing tools.
http://localhost:8000
GET /- Server informationGET /health- Health checkGET /tools- List available toolsPOST /tools/{tool_name}/execute- Execute a toolPOST /videos/{video_id}/process- Batch process videoGET /cache/stats- Cache statistics
For complete API documentation, see MCP Server README.
| Issue | Quick Fix |
|---|---|
| Missing API key | Copy .env.example to .env and add your Groq API key |
| Connection refused | Ensure both MCP server and Streamlit are running |
| Redis errors | Set REDIS_ENABLED=false in .env (Redis is optional) |
| Slow processing | Reduce MAX_FRAMES_PER_VIDEO in .env |
| Out of memory | Reduce MAX_FRAMES_PER_VIDEO and LAZY_LOAD_BATCH_SIZE |
For comprehensive troubleshooting, see the Troubleshooting Guide which covers:
- Installation issues
- Configuration problems
- Server startup failures
- Video processing errors
- Performance optimization
- Database and cache issues
- Complete error message reference
-
Check Documentation:
- User Guide - How to use BRI
- Troubleshooting Guide - Common issues and solutions
- Configuration Reference - All settings explained
-
Run Diagnostics:
python scripts/validate_setup.py
-
Enable Debug Mode:
# In .env: DEBUG=true LOG_LEVEL=DEBUG -
Report Issues:
- Open a GitHub issue with:
- Error messages and logs
- Configuration (mask sensitive values)
- Steps to reproduce
- System information
- Open a GitHub issue with:
We welcome contributions to BRI! Here's how you can help:
- π Report Bugs: Open an issue with details and reproduction steps
- π‘ Suggest Features: Share your ideas for new capabilities
- π Improve Documentation: Help make docs clearer and more comprehensive
- π§ Submit Pull Requests: Fix bugs or implement features
- π§ͺ Write Tests: Improve test coverage
- π¨ Enhance UI/UX: Suggest or implement design improvements
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/bri-video-agent.git - Create a branch:
git checkout -b feature/your-feature-name - Make your changes
- Run tests:
pytest - Commit:
git commit -m "Add your feature" - Push:
git push origin feature/your-feature-name - Open a Pull Request
- Follow existing code style and conventions
- Write tests for new features
- Update documentation as needed
- Keep commits focused and atomic
- Write clear commit messages
- Be respectful and constructive in discussions
- Be welcoming and inclusive
- Respect differing viewpoints
- Accept constructive criticism gracefully
- Focus on what's best for the community
- Show empathy towards others
[Add your license here - e.g., MIT, Apache 2.0, GPL]
BRI is built with amazing open-source technologies:
- Groq - Fast LLM inference
- OpenCV - Computer vision library
- Hugging Face - BLIP image captioning model
- OpenAI Whisper - Audio transcription
- Ultralytics YOLOv8 - Object detection
- Streamlit - Web UI framework
- FastAPI - Modern API framework
Special thanks to the open-source community for making projects like BRI possible! π
- π Documentation: See docs/ directory
- π¬ Discussions: GitHub Discussions
- π Issues: GitHub Issues
- π§ Email: [[email protected]]
Made with π by the BRI community
Ask. Understand. Remember.