vizra-adk
CLAUDE.md295 starsChanged 7 months agoMITView on GitHub
Package Name: vizra/vizra-adk Version: 0.0.17 PHP: ^8.2 Laravel: ^11.0 | ^12.0 | ^13.0 License: MIT
- Reads credentials
The file
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 207
Document chunking and embedding
- Very specific: line 269
Add tools to the $tools array
- Very specific: line 276
Add tool to agent's $tools array
- Distinctive: line 281
Add assertions for validation
- Distinctive: line 287
Use VectorMemoryTool in agents for RAG
- Very specific: line 342
Check agent_memories table for persistence issues
- Very specific: line 343
Verify session continuity in agent_sessions
- Distinctive: line 348
Use streaming for long responses
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Vizra ADK - Laravel AI Agent Development Kit
Project Overview
Vizra ADK is a comprehensive Laravel package for building intelligent AI agents with tool usage, memory persistence, and workflow capabilities. This package integrates with multiple LLM providers (OpenAI, Anthropic, Google Gemini) through Prism PHP.
Package Name: vizra/vizra-adk
Version: 0.0.17
PHP: ^8.2
Laravel: ^11.0 | ^12.0 | ^13.0
License: MIT
Key Concepts
Agents
- BaseLlmAgent: Core agent class that interfaces with LLMs
- BaseWorkflowAgent: Agent for orchestrating complex workflows
- Auto-discovery: Agents are automatically discovered without manual registration
- Support for sub-agent delegation and task distribution
Tools
- Implement
ToolInterfaceto create custom tools - Tools extend agent capabilities (database, API, external services)
- MCP (Model Context Protocol) support for external tool servers
- Built-in tools: MemoryTool, VectorMemoryTool, DelegateToSubAgentTool
Memory System
- Persistent conversation memory across sessions
- Vector memory for RAG (Retrieval Augmented Generation)
- Multiple embedding providers: OpenAI, Cohere, Gemini, Ollama
- Meilisearch integration for vector storage
Workflows
- SequentialWorkflow: Execute agents in order
- ParallelWorkflow: Run multiple agents simultaneously
- ConditionalWorkflow: Branch based on conditions
- LoopWorkflow: Iterate over data or conditions
Directory Structure
vizra-adk/
├── src/
│ ├── Agents/ # Core agent implementations
│ ├── Tools/ # Tool implementations and MCP wrapper
│ ├── Memory/ # Memory management
│ ├── Services/ # Core services (Manager, Registry, Tracer)
│ ├── Models/ # Eloquent models
│ ├── Console/Commands/ # Artisan commands
│ ├── Evaluations/ # Testing and evaluation framework
│ ├── Events/ # Laravel events
│ ├── Http/ # Controllers and API endpoints
│ ├── Livewire/ # Dashboard components
│ └── Providers/ # Service providers and embeddings
├── tests/
│ ├── Unit/ # Unit tests
│ ├── Feature/ # Feature tests
│ └── Integration/ # Integration tests
├── config/ # Package configuration
├── database/migrations/ # Database migrations
├── resources/views/ # Blade templates and Livewire views
└── examples/ # Example agents and toolsTesting
Test Framework
- Pest PHP: Modern testing framework
- Orchestra Testbench: Laravel package testing
Running Tests
# Run all tests
./vendor/bin/pest
# Run with coverage
./vendor/bin/pest --coverage
# Run specific test file
./vendor/bin/pest tests/Unit/Agents/BaseLlmAgentTest.php
# Run tests in parallel
./vendor/bin/pest --parallelTest Structure
- Unit tests: Isolated component testing
- Feature tests: End-to-end functionality
- Integration tests: Cross-component interactions
Development Commands
Artisan Commands
# Install package (migrations, config)
php artisan vizra:install
# Create new agent
php artisan vizra:make:agent MyAgent
# Create new tool
php artisan vizra:make:tool MyTool
# Create evaluation
php artisan vizra:make:eval MyEvaluation
# Create assertion
php artisan vizra:make:assertion MyAssertion
# Interactive chat with agent
php artisan vizra:chat agent_name
# List discovered agents
php artisan vizra:agents
# Run evaluations
php artisan vizra:eval:run
# Start web dashboard
php artisan vizra:dashboard
# View agent trace
php artisan vizra:trace {traceId}
# Clean old traces
php artisan vizra:trace:cleanup
# Manage prompt versions
php artisan vizra:prompts
# MCP server management
php artisan vizra:mcp:list
# Vector memory operations
php artisan vizra:vector:store --file={file}
php artisan vizra:vector:search {query}
php artisan vizra:vector:statsCode Conventions
Naming Conventions
- Agents:
{Purpose}AgentextendsBaseLlmAgent - Tools:
{Action}ToolimplementsToolInterface - Evaluations:
{Scenario}EvaluationextendsBaseEvaluation - Assertions:
{Check}AssertionextendsBaseAssertion
Namespace Structure
Vizra\VizraADK\Agents\ # Agent classes
Vizra\VizraADK\Tools\ # Tool implementations
Vizra\VizraADK\Services\ # Core services
Vizra\VizraADK\Models\ # Eloquent models
Vizra\VizraADK\Evaluations\ # Evaluation frameworkAgent Definition Pattern
class MyAgent extends BaseLlmAgent
{
protected string $name = 'my_agent';
protected string $description = 'Agent purpose';
protected string $instructions = 'Detailed instructions';
protected string $model = 'gpt-4o';
protected array $tools = [
MyTool::class,
];
}Tool Implementation Pattern
class MyTool implements ToolInterface
{
public function definition(): array
{
return [
'name' => 'tool_name',
'description' => 'What this tool does',
'parameters' => [
'type' => 'object',
'properties' => [...],
'required' => [...]
]
];
}
public function execute(array $arguments, AgentContext $context): string
{
// Tool logic here
return json_encode($result);
}
}Key Features
LLM Integration
- Uses Prism PHP for multi-provider support
- Providers: OpenAI, Anthropic, Google Gemini, Ollama
- Streaming response support
- Token usage tracking
Memory & Context
- Session-based conversation history
- User-specific memory persistence
- Vector memory for semantic search
- Document chunking and embedding
Tracing & Debugging
- Detailed execution traces with TraceSpan model
- Parent-child span relationships
- Performance metrics and timing
- Web dashboard for visualization
Evaluation Framework
- Automated agent testing at scale
- LLM-as-a-Judge evaluation
- Custom assertions
- Test case management
MCP Integration
- Model Context Protocol support
- External tool server connectivity
- Dynamic tool discovery
- Process management for MCP servers
Database Schema
Tables
agent_sessions: Conversation sessionsagent_messages: Message historyagent_memories: Persistent memoryagent_prompt_versions: Prompt versioningagent_prompt_usage: Prompt usage trackingagent_trace_spans: Execution tracesagent_vector_memories: Vector embeddings
Configuration
Environment Variables
# LLM Providers
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
GEMINI_API_KEY=
# Vector Memory
MEILISEARCH_HOST=
MEILISEARCH_KEY=
# Embedding Provider
VIZRA_EMBEDDING_PROVIDER=openai
VIZRA_EMBEDDING_MODEL=text-embedding-3-smallConfig File
config/vizra-adk.php contains:
- Provider settings
- Model configurations
- Memory settings
- Tracing options
- Dashboard configuration
Common Workflows
Creating an Agent
- Generate agent class:
php artisan vizra:make:agent - Define properties (name, description, instructions, model)
- Add tools to the
$toolsarray - Agent is auto-discovered and ready to use
Building a Tool
- Generate tool class:
php artisan vizra:make:tool - Define the tool schema in
definition() - Implement logic in
execute() - Add tool to agent's
$toolsarray
Running Evaluations
- Create evaluation:
php artisan vizra:make:eval - Define test cases and expected outcomes
- Add assertions for validation
- Run:
php artisan vizra:eval:run
Using Vector Memory
- Store documents:
php artisan vizra:vector:store --file=file.txt - Search:
php artisan vizra:vector:search "query" - Use VectorMemoryTool in agents for RAG
API Endpoints
Web Routes
/vizra/dashboard- Main dashboard/vizra/chat/{agent}- Chat interface/vizra/eval- Evaluation runner
API Routes
POST /api/agent/{name}/chat- Chat with agentPOST /api/agent/{name}/execute- Execute agentGET /api/agent/{name}/sessions- Get sessionsPOST /v1/chat/completions- OpenAI-compatible endpoint
Important Patterns
Agent Execution Flow
- AgentBuilder constructs context
- AgentExecutor manages execution
- Tracer records spans
- Tools are executed as needed
- Memory is persisted
- Response returned (streaming or complete)
Context Management
- AgentContext carries state through execution
- Includes user, session, parameters, memory
- Passed to all tools and sub-agents
Event System
- Events fired at key points (execution start/end, tool calls, LLM calls)
- Used for logging, monitoring, and extensions
- Key events: AgentExecutionStarting, ToolCallInitiating, LlmResponseReceived
Debugging Tips
View Traces
# Get trace ID from execution
php artisan vizra:trace {traceId}
# Or use web dashboard
php artisan vizra:dashboardCheck Agent Discovery
php artisan vizra:agentsTest Individual Tools
Tools can be tested in isolation by instantiating and calling execute() directly with mock context.
Memory Debugging
- Check
agent_memoriestable for persistence issues - Verify session continuity in
agent_sessions - Review vector embeddings in
agent_vector_memories
Performance Considerations
- Use streaming for long responses
- Implement caching for expensive operations
- Batch vector operations when possible
- Clean old traces regularly:
php artisan vizra:trace:cleanup - Monitor token usage in dashboard
Security Notes
- API keys stored in .env file
- Session-based isolation for multi-user systems
- Tool execution sandboxing recommended
- Input validation in tool parameters
- Rate limiting for API endpoints
Quick Reference
Essential Classes
BaseLlmAgent- Main agent base classToolInterface- Tool contractAgentContext- Execution contextAgentMemory- Memory managementTracer- Execution tracingAgentRegistry- Agent discovery
Key Services
AgentManager- Central managementMemoryManager- Memory operationsVectorMemoryManager- Vector operationsMCPClientManager- MCP integrationWorkflowManager- Workflow orchestration
Facades
Agent::discover()- Find agentsAgent::get($name)- Get specific agentWorkflow::sequential()- Create workflow
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

