Advanced Multi-Agent Personality Intelligence System
A comprehensive, production-ready toolkit for developing, evaluating, and managing AI personalities using OpenAI's Agents SDK, GPT-4o, and advanced AI engineering patterns.
- Multi-dimensional Analysis: Personality consistency, coherence, and authenticity scoring
- Real-time Monitoring: Live personality drift detection and behavioral analysis
- Comparative Metrics: Cross-personality evaluation and benchmarking capabilities
- Custom Evaluation Frameworks: Extensible evaluation criteria and scoring systems
- OpenAI Agents SDK Integration: Native support for structured agent interactions
- Multi-Agent Coordination: Sophisticated inter-agent communication and collaboration
- Dynamic Personality Injection: Runtime personality trait modification and adaptation
- Context-Aware Responses: Personality-driven contextual response generation
- Real-time Dashboards: Live personality metrics and performance monitoring
- Advanced Visualizations: Multi-dimensional personality trait mapping and evolution tracking
- Predictive Analysis: Personality consistency forecasting and drift prediction
- Export Capabilities: Comprehensive reporting and data export functionality
- Scalable FastAPI Backend: High-performance, async API with automatic documentation
- SQLite/PostgreSQL Support: Flexible database backend with migration support
- Docker Containerization: Complete containerized deployment with orchestration
- Comprehensive Testing: Unit, integration, and performance test suites
- CI/CD Pipeline: Automated testing, building, and deployment workflows
# Clone the repository
git clone https://github.com/llamasearchai/OpenPersona.git
cd OpenPersona
# Set up Python environment
cd python
poetry install
# Configure environment
cp env.example .env
# Edit .env with your OpenAI API key and other settings
# Run the application
poetry run python run_enhanced.py
# Visit http://localhost:8001/docs for API documentation- Python 3.11+ with Poetry
- Node.js 18+ with npm/yarn (for UI components)
- Rust 1.70+ (for performance-critical components)
- Docker & Docker Compose (for containerized deployment)
- OpenAI API Key (for AI-powered features)
-
Clone and Setup
git clone https://github.com/llamasearchai/OpenPersona.git cd OpenPersona -
Backend Setup
cd python poetry install cp env.example .env # Configure your .env file
-
Frontend Setup
cd ui npm install -
Database Setup
cd python poetry run python -c "from persona_agent_backend.utils.database import create_tables; create_tables()"
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-4o
OPENAI_MAX_TOKENS=4000
# Database Configuration
DATABASE_URL=sqlite:///./openpersona.db
# or for PostgreSQL:
# DATABASE_URL=postgresql://user:password@localhost/openpersona
# API Configuration
API_HOST=0.0.0.0
API_PORT=8001
DEBUG=true
LOG_LEVEL=INFO
# Security
SECRET_KEY=your-secret-key-here
ACCESS_TOKEN_EXPIRE_MINUTES=30
# Features
ENABLE_ANALYTICS=true
ENABLE_CACHING=true
CACHE_TTL=3600The system supports extensive configuration through:
- Environment Variables: Runtime configuration
- Configuration Files: Structured YAML/JSON configuration
- Database Settings: Advanced database tuning
- Logging Configuration: Detailed logging setup
# Create a personality profile
POST /api/personalities
{
"name": "Analytical Assistant",
"description": "Logical, data-driven personality",
"traits": {
"openness": 0.8,
"conscientiousness": 0.9,
"extraversion": 0.4,
"agreeableness": 0.7,
"neuroticism": 0.2
}
}
# Get all personalities
GET /api/personalities
# Update personality
PUT /api/personalities/{personality_id}# Create an agent
POST /api/agents
{
"name": "DataBot",
"personality_id": "personality-abc123",
"system_prompt": "You are a data analysis assistant..."
}
# Send message to agent
POST /api/agents/{agent_id}/message
{
"content": "Analyze this dataset",
"context": "Previous conversation context"
}# Run personality evaluation
POST /api/evaluations
{
"conversation_id": "conv-123",
"evaluation_type": "consistency",
"criteria": ["personality_adherence", "response_quality"]
}
# Get evaluation results
GET /api/evaluations/{evaluation_id}Visit /docs when running the server for complete interactive API documentation with:
- Live API Testing: Test endpoints directly from the browser
- Schema Documentation: Complete request/response schemas
- Authentication Examples: Authentication flow examples
- Error Handling: Comprehensive error response documentation
# Run all tests
cd python
poetry run pytest
# Run with coverage
poetry run pytest --cov=persona_agent_backend
# Run specific test categories
poetry run pytest tests/test_evaluations.py
poetry run pytest -m integration- Unit Tests: Individual component testing
- Integration Tests: End-to-end workflow testing
- Performance Tests: Load and stress testing
- API Tests: Comprehensive API endpoint testing
# Build and run with Docker Compose
docker-compose up --build
# Production deployment
docker-compose -f docker-compose.prod.yml up -dThe system supports deployment on:
- AWS: ECS, EKS, Lambda
- Google Cloud: GKE, Cloud Run
- Azure: AKS, Container Instances
- DigitalOcean: App Platform, Kubernetes
- Environment-based: Different configs for dev/staging/prod
- Secret Management: Secure handling of API keys and credentials
- Health Checks: Comprehensive health monitoring
- Logging: Structured logging with log aggregation
The system provides comprehensive monitoring through:
- Application Metrics: Response times, error rates, throughput
- Business Metrics: Personality evaluation scores, agent performance
- Infrastructure Metrics: Resource usage, database performance
- Custom Dashboards: Tailored monitoring views
# System health
GET /health
# Detailed system status
GET /api/system/stats
# Database health
GET /api/system/db-health- FastAPI Backend: High-performance async API server
- SQLite/PostgreSQL: Flexible data persistence layer
- OpenAI Integration: Native Agents SDK integration
- Evaluation Engine: Multi-dimensional personality analysis
- Analytics Dashboard: Real-time monitoring and insights
- Docker Environment: Containerized deployment system
- Repository Pattern: Clean data access layer
- Factory Pattern: Dynamic personality and agent creation
- Observer Pattern: Real-time event monitoring
- Strategy Pattern: Pluggable evaluation algorithms
- Async Operations: Non-blocking I/O for high concurrency
- Database Optimization: Efficient queries and indexing
- Caching Layer: Redis-based response caching
- Connection Pooling: Optimized database connections
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
- Python: Follow PEP 8 with Black formatting
- TypeScript: ESLint + Prettier configuration
- Rust: Standard Rust formatting with Clippy
- Documentation: Comprehensive docstrings and comments
This project is licensed under the MIT License - see the LICENSE file for details.
- Documentation: Comprehensive guides and API docs
- Community: GitHub Discussions and Issues
- Email: NikJois@llamasearch.ai
Built with care for the AI personality evaluation community