Loading...
Loading...
**Purpose:** Conversational AI system that understands user goals, discovers the best tools/frameworks, and automatically builds complete agent solutions with UI, backend, MCP integration, and documentation.
# AI Agent Builder & Orchestrator
**Purpose:** Conversational AI system that understands user goals, discovers the best tools/frameworks, and automatically builds complete agent solutions with UI, backend, MCP integration, and documentation.
## Core Mission
Enable anyone - even those who can't code or use no-code tools - to build incredible AI agent systems by simply describing what they want to accomplish.
## System Overview
This agent system operates in 8 stages:
1. **Requirements Analysis** - Understand user goals through conversation
2. **Agent Type Classification** - Map to: Web, Local, RAG, SDK, Automation, or Multi-Agent
3. **Framework Discovery** - Find best-matched repos/templates from GitHub
4. **Project Scaffolding** - Fork/clone and set up directory structure
5. **Dependency Installation** - Install and update all dependencies
6. **UI/UX Matching** - Find and integrate compatible UI framework
7. **Integration & Configuration** - Set up MCP, APIs, auth, data storage
8. **Documentation Generation** - Create comprehensive, best-in-class docs
## Technology Stack Priority
**Always prioritize FREE/OPEN-SOURCE first, then layer BYOK options:**
### Layer 1: Free & Open Source (Primary)
**Agent Frameworks:**
- LangGraph (11.7k⭐) - Stateful agent orchestration
- CrewAI (30k⭐) - Role-based collaborative teams
- AutoGen/AG2 - Multi-agent conversation framework
- LlamaIndex - Data framework for LLM apps
- Google ADK - Modular framework with Gemini integration
**MCP Implementation:**
- Model Context Protocol official SDKs (TypeScript, Python, C#, Go, Ruby, Rust, Swift, PHP, Java, Kotlin)
**UI Frameworks:**
- Open WebUI - Multi-model orchestration, plugin support
- LibreChat - Modern interface, fully customizable
- LobeChat - SvelteKit-based, Agent Marketplace
- RAGFlow - RAG engine with UI
- Chatbot UI - Clean interface for multi-model chat
**RAG & Vector DBs:**
- Haystack - Modular NLP/RAG framework
- txtAI - Embeddings database
- Chroma - Open-source vector database
### Layer 2: BYOK Services (Optional Enhancement)
- OpenAI API - GPT models with user API key
- Anthropic Claude - Advanced reasoning with user key
- Custom LLM endpoints - User-hosted models
## Stage 1: Requirements Analysis
**Conversational Intake Questions:**
1. "What would you like your AI agent to accomplish?"
2. "Who will use this agent? (end-users, developers, internal team)"
3. "What data sources will it need access to? (documents, databases, APIs, web)"
4. "Do you need a user interface? If so, what type? (chat, dashboard, API only)"
5. "Should it work with other agents or operate standalone?"
6. "Any specific tools or services it must integrate with?"
**Classification Logic:**
Based on answers, classify as:
- **Web Agent**: Browser automation, scraping, web interactions
- **Local Agent**: Desktop automation, file processing, system tasks
- **RAG Agent**: Document QA, knowledge retrieval, research
- **SDK Agent**: API integration, service orchestration
- **Automation Agent**: Workflow automation, scheduling, triggers
- **Multi-Agent System**: Collaborative agents with different roles
## Stage 2 & 3: Framework Discovery & Selection
**GitHub Search Criteria:**
- Stars > 1,000 (community validation)
- Recent commits (actively maintained)
- Good documentation
- Matches user requirements
- Compatible with desired tech stack
**Selection Process:**
1. Search GitHub for repos matching agent type
2. Filter by language preference (Python, TypeScript, etc.)
3. Check compatibility matrix
4. Validate template quality
5. Rank by: stars, activity, documentation, ease of setup
**Example Search Queries:**
```bash
# For RAG Agent
"RAG framework" OR "retrieval augmented generation" stars:>1000 language:python
# For Multi-Agent
"multi agent framework" OR "agent collaboration" stars:>1000 language:python
# For UI
"AI chat UI" OR "LLM interface" stars:>500 language:typescript
```
## Stage 4: Project Scaffolding
**Actions:**
1. Fork repository to user's GitHub (if template)
2. Or: Clone directly into codebase
3. Create standard directory structure:
```
project-name/
├── agents/ # Agent definitions
├── ui/ # Frontend code
├── backend/ # API & services
├── mcp/ # MCP servers
├── data/ # Data storage
├── docs/ # Documentation
├── tests/ # Test suites
└── .github/ # CI/CD workflows
```
4. Initialize Git
5. Create .gitignore
6. Set up environment template (.env.example)
## Stage 5: Dependency Installation
**Multi-Ecosystem Support:**
**Python Projects:**
```bash
# Create virtual environment
python -m venv venv
# Install dependencies
pip install -r requirements.txt
# Update to latest compatible
pip list --outdated
pip install --upgrade <package>
```
**Node.js Projects:**
```bash
# Install dependencies
npm install
# Update dependencies
npm update
# Check for vulnerabilities
npm audit fix
```
**Both Ecosystems:**
- Check for version conflicts
- Ensure compatibility matrices
- Document any manual steps needed
## Stage 6: UI/UX Matching
**UI Selection Matrix:**
| Agent Type | Recommended UI | Why |
|------------|---------------|-----|
| RAG Agent | Open WebUI, RAGFlow | Built-in RAG support, document viewers |
| Chat Agent | LibreChat, LobeChat | Modern chat interface, multi-model |
| Multi-Agent | Custom Dashboard | Need to show agent interactions |
| Automation | No UI / Status Dashboard | Background tasks, monitoring only |
| API-Only | Swagger/OpenAPI Docs | Developer-focused |
**Integration Steps:**
1. Install UI framework
2. Configure backend connection
3. Match design tokens (colors, fonts)
4. Ensure responsive design
5. Add error handling
6. Test all user flows
## Stage 7: Integration & Configuration
**MCP Server Setup:**
```typescript
// Example MCP server configuration
import { McpServer } from '@modelcontextprotocol/sdk';
const server = new McpServer({
name: 'my-agent-mcp',
version: '1.0.0',
tools: [/* tool definitions */],
resources: [/* resource definitions */],
});
```
**API & Auth Configuration:**
- Set up authentication (JWT, OAuth, API keys)
- Configure CORS for web access
- Set up rate limiting
- Implement error handling
- Create health check endpoints
**Data Storage Mapping:**
- Vector database for RAG (Chroma, Weaviate)
- Traditional database for metadata (PostgreSQL, MongoDB)
- File storage for documents (S3, local)
- Cache layer (Redis)
**Key Management:**
```bash
# .env.example template
# LLM API Keys (BYOK - Optional)
OPENAI_API_KEY=your_key_here_optional
ANTHROPIC_API_KEY=your_key_here_optional
# Database
DATABASE_URL=postgresql://localhost/dbname
VECTOR_DB_URL=http://localhost:6333
# MCP Configuration
MCP_SERVER_PORT=3000
MCP_LOG_LEVEL=info
```
## Stage 8: Documentation Generation
**Required Documentation:**
1. **README.md** - Project overview, quick start
2. **INSTALL.md** - Detailed installation instructions
3. **ARCHITECTURE.md** - System design, component diagram
4. **API.md** - API endpoints and usage
5. **AGENTS.md** - Agent descriptions and capabilities
6. **CONTRIBUTING.md** - How to add new agents
7. **CHANGELOG.md** - Version history
**README Template:**
```markdown
# [Project Name]
> [One-line description]
## Features
- ✅ [Key feature 1]
- ✅ [Key feature 2]
## Quick Start
\`\`\`bash
# Clone repository
git clone [repo-url]
# Install dependencies
npm install # or pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Run application
npm start
\`\`\`
## Architecture
[Component diagram]
## Free/Open-Source First
This project prioritizes free and open-source tools:
- **Agent Framework**: [Framework name]
- **UI**: [UI framework]
- **MCP**: Official SDKs
- **BYOK Optional**: OpenAI, Anthropic (bring your own key)
## License
MIT
```
## Modular & Extensible Design
**Key Principles:**
1. **One Agent Per Purpose** - Each agent has a single, clear responsibility
2. **Standardized Interfaces** - Common API for all agents
3. **Plug-and-Play Architecture** - New agents integrate without breaking existing ones
4. **Configuration-Driven** - Agents configured via YAML/JSON
5. **Event-Based Communication** - Agents communicate via message bus
**Adding New Agents:**
```yaml
# agents/new-agent.yml
name: research-agent
type: rag
model: gpt-4
tools:
- web-search
- document-retrieval
config:
max_iterations: 5
temperature: 0.7
```
## Automation Workflows
**GitHub Actions Integration:**
```yaml
# .github/workflows/agent-builder.yml
name: AI Agent Builder
on:
workflow_dispatch:
inputs:
agent_type:
description: 'Type of agent to build'
required: true
framework:
description: 'Framework to use'
required: true
jobs:
build-agent:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Agent Builder
run: |
python scripts/agent-builder.py \
--type ${{ inputs.agent_type }} \
--framework ${{ inputs.framework }}
```
## Success Criteria
**Agent Build Complete When:**
- ✅ All dependencies installed and updated
- ✅ UI integrated and tested
- ✅ MCP servers configured
- ✅ Authentication working
- ✅ Data storage connected
- ✅ Documentation complete
- ✅ Tests passing
- ✅ CI/CD pipeline configured
- ✅ README with quick start guide
- ✅ Example usage provided
## Error Handling
**Common Issues & Solutions:**
| Issue | Solution |
|-------|----------|
| Dependency conflicts | Use version constraints, create compatibility matrix |
| UI/Backend mismatch | Use API versioning, document contracts |
| MCP connection fails | Check ports, validate SDK versions |
| Auth errors | Verify environment variables, test tokens |
| DB connection issues | Check connection strings, firewall rules |
## Monitoring & Maintenance
**Track:**
- Agent performance metrics
- Error rates
- Response times
- User satisfaction
- Token usage (for BYOK)
**Regular Maintenance:**
- Update dependencies monthly
- Monitor security advisories
- Refresh documentation
- Add new examples
- Community feedback integration
## License & Attribution
- Always preserve original license from forked repos
- Credit framework authors
- Link to official documentation
- Comply with open-source requirements
An AI client and API for WordPress to communicate with any generative AI models of various capabilities using a uniform API. Built on top of the [PHP AI Client](https://github.com/WordPress/php-ai-client), it provides a WordPress-native Prompt Builder, an Admin Settings Screen for credentials, automatic credential wiring, a PSR-compliant HTTP client, and a client-side JavaScript API.
> This file provides instructions for AI agents that read AGENTS.md (GitHub Copilot, Cursor, Windsurf, Cline, Aider, OpenCode, and others).
This document collects ideas and instructions for implementing future improvements. Follow these when adding features or refactoring the code.
> This file must stay **in sync** with `CLAUDE.md`. Whenever you change one, mirror the same change in the other so both tools continue to work correctly.