Vizra.ai |

Documentation

โš™๏ธ

Configuration

Customize your perfect AI agent setup with Vizra ADK's flexible configuration system ๐ŸŽ›๏ธ

๐ŸŽจ

Configuration Made Simple!

Think of configuration as painting your masterpiece! ๐Ÿ–Œ๏ธ With Vizra ADK, you have all the colors (options) at your fingertips. Let's make your AI agents work exactly how you want them to!

๐Ÿ“ Your Configuration Hub

After installing Vizra ADK, your shiny new configuration file lives at:

config/vizra-adk.php

๐Ÿ’ก Pro tip: Haven't published it yet? No worries! Run this magic command:

php artisan vendor:publish --tag=vizra-adk-config

๐Ÿค– Choose Your AI Provider

๐ŸŽฏ Default Provider

Pick your favorite AI companion! Set it in your .env file:

VIZRA_ADK_DEFAULT_PROVIDER=openai

โœจ Available Providers

Choose from these amazing AI providers:

โœ“ openai - GPT models
โœ“ anthropic - Claude models
โœ“ gemini - Google's finest

๐ŸŽช Pick Your Model

Choose the AI model that powers your agents' brilliance:

VIZRA_ADK_DEFAULT_MODEL=gemini-pro

๐ŸŸข OpenAI Models

gpt-4-turbo gpt-3.5-turbo

๐ŸŸฃ Anthropic Models

claude-3-opus-20240229 claude-3-sonnet-20240229

๐Ÿ”ต Google Models

gemini-pro gemini-1.5-pro

๐ŸŽธ Fine-Tune Your AI's Personality

Adjust these dials to make your AI agents more creative or focused! ๐ŸŽฏ

# Default generation parameters
VIZRA_ADK_DEFAULT_TEMPERATURE=0.7      # null uses provider default
VIZRA_ADK_DEFAULT_MAX_TOKENS=2000     # null uses provider default
VIZRA_ADK_DEFAULT_TOP_P=0.9           # null uses provider default

๐ŸŒก๏ธ Temperature

Controls creativity: 0 = focused, 1 = wild imagination!

๐Ÿ“ฆ Max Tokens

Maximum response length. More tokens = longer answers!

๐ŸŽฉ Top P

Controls diversity. Lower = more focused responses!

๐Ÿ”‘ Your API Keys

Time to connect to the AI magic! Add your provider API keys:

# OpenAI
OPENAI_API_KEY=your-openai-api-key

# Anthropic Claude
ANTHROPIC_API_KEY=your-anthropic-api-key

# Google Gemini
GOOGLE_API_KEY=your-google-api-key
๐Ÿ”’

Security First!

Never commit API keys to your repository! Keep them safe in your .env file and add it to .gitignore.

๐Ÿ“„ The Complete Configuration Blueprint

Here's your complete configuration file in all its glory! ๐ŸŽ†

return [
    /**
     * Default LLM provider to use with Prism-PHP.
     * This can be overridden by specific agent configurations.
     * 
     * Supported providers:
     * - 'openai' - OpenAI (GPT-4, GPT-3.5, etc.)
     * - 'anthropic' - Anthropic (Claude models)
     * - 'gemini' or 'google' - Google Gemini
     * - 'deepseek' - DeepSeek AI
     * - 'ollama' - Ollama (local models like Llama, CodeLlama, Phi)
     * - 'mistral' - Mistral AI (Mistral, Mixtral models)
     * - 'groq' - Groq (Fast inference)
     * - 'xai' or 'grok' - xAI (Grok models)
     * - 'voyageai' or 'voyage' - Voyage AI (Embeddings)
     */
    'default_provider' => env('VIZRA_ADK_DEFAULT_PROVIDER', 'openai'),

    /**
     * Default LLM model to use with Prism-PHP.
     * This can be overridden by specific agent configurations.
     * Example: 'gemini-pro', 'gpt-4-turbo', 'claude-3-opus-20240229'
     */
    'default_model' => env('VIZRA_ADK_DEFAULT_MODEL', 'gemini-1.5-flash'),

    /**
     * Default generation parameters for LLM requests.
     * These can be overridden by specific agent configurations.
     */
    'default_generation_params' => [
        'temperature' => env('VIZRA_ADK_DEFAULT_TEMPERATURE', null), // null means use provider default
        'max_tokens' => env('VIZRA_ADK_DEFAULT_MAX_TOKENS', null),   // null means use provider default
        'top_p' => env('VIZRA_ADK_DEFAULT_TOP_P', null),             // null means use provider default
    ],

    /**
     * Sub-agent delegation settings.
     * Controls behavior of agent hierarchies and delegation.
     */
    'max_delegation_depth' => env('VIZRA_ADK_MAX_DELEGATION_DEPTH', 5), // Maximum depth for nested sub-agent delegation

    /**
     * Database table names used by the package.
     */
    'tables' => [
        'agent_sessions' => 'agent_sessions',
        'agent_messages' => 'agent_messages',
        'agent_memories' => 'agent_memories',
        'agent_vector_memories' => 'agent_vector_memories',
        'agent_trace_spans' => 'agent_trace_spans',
    ],

    /**
     * Tracing configuration.
     */
    'tracing' => [
        'enabled' => env('VIZRA_ADK_TRACING_ENABLED', true),
        'cleanup_days' => env('VIZRA_ADK_TRACING_CLEANUP_DAYS', 30),
    ],

    /**
     * Namespaces for user-defined classes.
     */
    'namespaces' => [
        'agents' => 'App\\Agents',
        'tools' => 'App\\Tools',
        'evaluations' => 'App\\Evaluations',
    ],

    /**
     * Routes configuration.
     */
    'routes' => [
        'enabled' => true,
        'prefix' => 'api/vizra-adk',
        'middleware' => ['api'],
        'web' => [
            'enabled' => env('VIZRA_ADK_WEB_ENABLED', true),
            'prefix' => 'vizra',
            'middleware' => ['web'],
        ],
    ],

    /**
     * OpenAI API Compatibility Configuration
     * Maps OpenAI model names to your agent names for the /chat/completions endpoint.
     */
    'openai_model_mapping' => [
        'gpt-4' => env('VIZRA_ADK_OPENAI_GPT4_AGENT', 'chat_agent'),
        'gpt-4-turbo' => env('VIZRA_ADK_OPENAI_GPT4_TURBO_AGENT', 'chat_agent'),
        'gpt-3.5-turbo' => env('VIZRA_ADK_OPENAI_GPT35_AGENT', 'chat_agent'),
        'gpt-4o' => env('VIZRA_ADK_OPENAI_GPT4O_AGENT', 'chat_agent'),
        'gpt-4o-mini' => env('VIZRA_ADK_OPENAI_GPT4O_MINI_AGENT', 'chat_agent'),
        // Add more mappings as needed
    ],

    /**
     * Default agent to use when no specific mapping is found
     */
    'default_chat_agent' => env('VIZRA_ADK_DEFAULT_CHAT_AGENT', 'chat_agent'),

    /**
     * Model Context Protocol (MCP) Configuration
     * Define MCP servers that agents can connect to for enhanced capabilities.
     * 
     * Each server configuration includes:
     * - command: The command to start the MCP server
     * - args: Arguments to pass to the server command
     * - enabled: Whether this server is enabled (default: true)
     * - timeout: Connection timeout in seconds (default: 30)
     */
    'mcp_servers' => [
        'filesystem' => [
            'command' => 'npx',
            'args' => [
                '@modelcontextprotocol/server-filesystem',
                env('MCP_FILESYSTEM_PATH', storage_path('app')),
            ],
            'enabled' => env('MCP_FILESYSTEM_ENABLED', false),
            'timeout' => 30,
        ],
        
        'github' => [
            'command' => 'npx',
            'args' => [
                '@modelcontextprotocol/server-github',
                '--token',
                env('GITHUB_TOKEN', ''),
            ],
            'enabled' => env('MCP_GITHUB_ENABLED', false) && !empty(env('GITHUB_TOKEN')),
            'timeout' => 45,
        ],
        
        'postgres' => [
            'command' => 'npx',
            'args' => [
                '@modelcontextprotocol/server-postgres',
                '--connection-string',
                env('MCP_POSTGRES_URL', env('DATABASE_URL', '')),
            ],
            'enabled' => env('MCP_POSTGRES_ENABLED', false) && !empty(env('DATABASE_URL')),
            'timeout' => 30,
        ],
        
        'brave_search' => [
            'command' => 'npx',
            'args' => [
                '@modelcontextprotocol/server-brave-search',
                '--api-key',
                env('BRAVE_API_KEY', ''),
            ],
            'enabled' => env('MCP_BRAVE_SEARCH_ENABLED', false) && !empty(env('BRAVE_API_KEY')),
            'timeout' => 30,
        ],
        
        'slack' => [
            'command' => 'npx',
            'args' => [
                '@modelcontextprotocol/server-slack',
                '--bot-token',
                env('SLACK_BOT_TOKEN', ''),
            ],
            'enabled' => env('MCP_SLACK_ENABLED', false) && !empty(env('SLACK_BOT_TOKEN')),
            'timeout' => 30,
        ],

        // Example custom MCP server
        // 'custom_api' => [
        //     'command' => 'python',
        //     'args' => ['/path/to/your/mcp-server.py'],
        //     'enabled' => true,
        //     'timeout' => 60,
        // ],
    ],
];

๐Ÿค Agent Teamwork Settings

Let your agents work together! Control how deep the delegation rabbit hole goes:

# Maximum depth for nested sub-agent delegation
VIZRA_ADK_MAX_DELEGATION_DEPTH=5
๐Ÿšซ

Why This Matters

This clever safety net prevents your agents from playing endless "pass the task" โ€” avoiding infinite loops and keeping your app responsive!

๐Ÿ—œ๏ธ Database Architecture

Vizra ADK organizes your AI data in these neat tables:

๐Ÿ’ฌ agent_sessions

Keeps track of all your conversation sessions

โœ๏ธ agent_messages

Stores the complete message history

๐Ÿง  agent_memories

Your agents' long-term memories live here

๐Ÿ” agent_vector_memories

Vector embeddings for semantic search capabilities

๐Ÿ“Š agent_trace_spans

Debug traces for when you need to investigate

๐Ÿ’ก Tip: Got naming conflicts? No worries! You can customize these table names in your config file.

๐Ÿ” Debug Like a Detective

Turn on tracing to see exactly what your agents are thinking! ๐Ÿ•ต๏ธโ€โ™‚๏ธ

# Enable/disable tracing
VIZRA_ADK_TRACING_ENABLED=true

# Days to keep trace data before cleanup
VIZRA_ADK_TRACING_CLEANUP_DAYS=30

๐Ÿงน Spring Cleaning Command

Keep your database tidy by removing old traces:

php artisan vizra:trace:cleanup --days=7

๐ŸŒ Web Dashboard Settings

Toggle your beautiful web dashboard on or off:

# Enable/disable web interface
VIZRA_ADK_WEB_ENABLED=true

Your shiny dashboard lives at these URLs:

๐Ÿ  Main Dashboard

/vizra

๐Ÿ’ฌ Chat Interface

/vizra/chat

๐Ÿ† Evaluation Runner

/vizra/eval

๐Ÿ”Œ OpenAI API Compatibility

Make your Vizra agents work seamlessly with OpenAI-compatible clients! Map OpenAI model names to your custom agents:

'openai_model_mapping' => [
    'gpt-4' => env('VIZRA_ADK_OPENAI_GPT4_AGENT', 'chat_agent'),
    'gpt-4-turbo' => env('VIZRA_ADK_OPENAI_GPT4_TURBO_AGENT', 'chat_agent'),
    'gpt-3.5-turbo' => env('VIZRA_ADK_OPENAI_GPT35_AGENT', 'chat_agent'),
    'gpt-4o' => env('VIZRA_ADK_OPENAI_GPT4O_AGENT', 'chat_agent'),
    'gpt-4o-mini' => env('VIZRA_ADK_OPENAI_GPT4O_MINI_AGENT', 'chat_agent'),
],

// Default agent when no mapping matches
'default_chat_agent' => env('VIZRA_ADK_DEFAULT_CHAT_AGENT', 'chat_agent'),
๐ŸŽญ

Why This Is Awesome

This lets any OpenAI-compatible application use your Vizra agents! Just point them to your /api/vizra-adk/chat/completions endpoint.

๐Ÿš€ Model Context Protocol (MCP) Servers

Supercharge your agents with MCP servers! These give your agents access to external tools and services:

๐Ÿ“ Filesystem Server

# Enable filesystem access
MCP_FILESYSTEM_ENABLED=true
MCP_FILESYSTEM_PATH=/path/to/allowed/dir

Let agents read and write files safely!

๐Ÿ™ GitHub Server

# Connect to GitHub
MCP_GITHUB_ENABLED=true
GITHUB_TOKEN=your-github-token

Access repos, issues, and PRs!

๐Ÿ˜ PostgreSQL Server

# Database access
MCP_POSTGRES_ENABLED=true
MCP_POSTGRES_URL=postgresql://...

Query and manage databases!

๐Ÿ” Brave Search Server

# Web search capabilities
MCP_BRAVE_SEARCH_ENABLED=true
BRAVE_API_KEY=your-brave-api-key

Search the web for real-time info!

โš™๏ธ Custom MCP Servers

You can even add your own MCP servers! Here's an example:

'custom_api' => [
    'command' => 'python',
    'args' => ['/path/to/your/mcp-server.py'],
    'enabled' => true,
    'timeout' => 60,
],

๐Ÿ† The Configuration Priority Game

๐ŸŽฏ Who Wins? The Priority Order!

When multiple configs compete, here's who takes the crown (from highest to lowest priority):

1st

Runtime Methods

$agent->setTemperature(0.2)

The boss! Always wins.

2nd

Agent Class Properties

protected ?float $temperature = 0.7;

The deputy! Steps in when the boss is away.

3rd

Environment Variables

VIZRA_ADK_DEFAULT_TEMPERATURE=0.5

The default go-to for most situations.

4th

Config File Defaults

config/vizra-adk.php

The fallback! Always there when needed.

๐Ÿ“ฆ Organize Your Code

Keep your code neat and tidy with these default namespaces:

๐Ÿค– Agents

App\Agents

๐Ÿ”ง Tools

App\Tools

๐Ÿ“Š Evaluations

App\Evaluations

๐ŸŽจ Feeling creative? You can totally customize these namespaces in your config file to match your project's vibe!

๐ŸŒ Environment Magic

Different settings for different environments? We've got you covered! ๐ŸŽฉโœจ

๐Ÿ’ป Local Development

# .env.local
VIZRA_ADK_TRACING_ENABLED=true
VIZRA_ADK_DEFAULT_MODEL=gpt-3.5-turbo
VIZRA_ADK_WEB_ENABLED=true

Debug everything, use cheaper models!

๐Ÿš€ Production

# .env.production
VIZRA_ADK_TRACING_ENABLED=false
VIZRA_ADK_DEFAULT_MODEL=gpt-4-turbo
VIZRA_ADK_WEB_ENABLED=false

Optimized for performance & security!

๐ŸŽ‰ You're All Set!

Congratulations! Your Vizra ADK is now perfectly configured. Time to build some amazing AI agents! Remember, configuration is just the beginning of your journey. Let's explore what's next...

Ready for Professional AI Agent Evaluation? ๐Ÿš€

Evaluate and debug your Vizra ADK agents with professional cloud tools. Get early access to Vizra Cloud and be among the first to experience advanced evaluation and trace analysis at scale.

Cloud evaluation runs
Trace visualization
Team collaboration

Join other developers already on the waitlist. No spam, just launch updates.