Package Structure
Core Components
Agent Hierarchy
name, description, and implement execute().
BaseLlmAgent extends this with LLM-specific features: system prompts, tool registration, model selection, and conversation handling.
BaseWorkflowAgent provides orchestration capabilities without LLM overhead - pure PHP logic for complex multi-agent coordination.
Service Container Bindings
Vizra ADK registers these singletons in Laravel’s service container:| Service | Purpose |
|---|---|
AgentRegistry | Stores and retrieves agent class mappings |
AgentBuilder | Fluent builder for configuring agents |
AgentManager | Central facade for running agents |
StateManager | Loads and persists agent context |
MemoryManager | Manages conversation history |
Tracer | Records execution spans for debugging |
Agent facade:
Request Lifecycle
When you run an agent, here’s what happens:AgentContext
AgentContext is the carrier object that flows through the entire execution:
- Session tracking - Links conversations across requests
- State storage - Key-value store for execution data
- Conversation history - Full message history for context
Tool Execution Flow
When an LLM decides to call a tool:Event System
Vizra ADK fires Laravel events at key points:| Event | When Fired |
|---|---|
AgentExecutionStarting | Before agent execution begins |
AgentExecutionFinished | After execution completes |
AgentResponseGenerated | When final response is ready |
LlmCallInitiating | Before each LLM API call |
LlmResponseReceived | After LLM responds |
ToolCallInitiating | Before tool execution |
ToolCallCompleted | After tool returns |
ToolCallFailed | When tool throws exception |
MemoryUpdated | When memory is modified |
StateUpdated | When context state changes |
Database Schema
Vizra ADK creates these tables:| Table | Purpose |
|---|---|
agent_sessions | Tracks conversation sessions |
agent_messages | Stores message history |
agent_memories | Persistent memory storage |
agent_trace_spans | Execution traces for debugging |
agent_vector_memories | Vector embeddings for RAG |
agent_prompt_versions | Prompt versioning |
agent_prompt_usage | Tracks which prompt versions are used |
LLM Integration
Vizra ADK uses Prism PHP for LLM communication:config/vizra-adk.php:
Extending the Architecture
Custom Service Providers
Register custom services that integrate with Vizra ADK:Custom Base Agents
Create your own base agent with shared behavior:Next Steps
- Agents - Learn how to build agents
- Tools - Give agents capabilities
- Sessions & Memory - Understand persistence