Skip to content

Latest commit

 

History

History
192 lines (152 loc) · 8.44 KB

File metadata and controls

192 lines (152 loc) · 8.44 KB

Agent-as-Code Documentation

Welcome to Agent-as-Code (AaC) - the "Docker for AI agents" that makes it easy to build, deploy, and manage AI agents using declarative configuration.

························································································································ : █████████ █████ █████████ █████ : : ███░░░░░███ ░░███ ███░░░░░███ ░░███ : : ░███ ░███ ███████ ██████ ████████ ███████ ██████ █████ ███ ░░░ ██████ ███████ ██████ : : ░███████████ ███░░███ ███░░███░░███░░███ ░░░███░ ░░░░░███ ███░░ ░███ ███░░███ ███░░███ ███░░███: : ░███░░░░░███ ░███ ░███░███████ ░███ ░███ ░███ ███████ ░░█████ ░███ ░███ ░███░███ ░███ ░███████ : : ░███ ░███ ░███ ░███░███░░░ ░███ ░███ ░███ ███ ███░░███ ░░░░███ ░░███ ███░███ ░███░███ ░███ ░███░░░ : : █████ █████░░███████░░██████ ████ █████ ░░█████ ░░████████ ██████ ░░█████████ ░░██████ ░░████████░░██████ : :░░░░░ ░░░░░ ░░░░░███ ░░░░░░ ░░░░ ░░░░░ ░░░░░ ░░░░░░░░ ░░░░░░ ░░░░░░░░░ ░░░░░░ ░░░░░░░░ ░░░░░░ : : ███ ░███ : : ░░██████ : : ░░░░░░ : ························································································································

Core Features

  • 🚀 Go-Powered Performance: High-performance core written in Go
  • 📝 Declarative Configuration: Simple agent.yaml for defining agents
  • 🐳 Docker-like Experience: Familiar commands and workflows
  • 🔌 Multi-Runtime Support: Python, Node.js, Go, and more
  • 🤖 Local LLM Integration: Built-in support for Ollama and local models
  • 📦 Template System: Pre-built templates for common use cases

Documentation Structure

📚 Getting Started

  1. Quick Start Guide - Get up and running in 5 minutes
  2. Installation - Multiple installation methods for all platforms
  3. Uninstallation - Complete removal and cleanup guide
  4. Development Workflow - Step-by-step development process

🏗️ Core Concepts

  1. Architecture Overview - Understanding AaC's design
  2. Agent Configuration - Complete agent.yaml reference
  3. Templates - Using and creating templates
  4. Parser - Configuration parsing and validation
  5. Builder - Building agent packages
  6. Runtime System - Agent execution environment
  7. Registry - Agent storage and distribution
  8. LLM Integration - Working with language models
  9. Local LLM Configuration - Ollama setup and local model usage
  10. LLM Fine-tuning - Model fine-tuning guide (Beta)

🛠️ CLI Reference

  1. CLI Overview - All available commands and usage

📖 Guides

  1. Example Agents - Real-world agent examples
  2. Integration Patterns - Common integration scenarios
  3. Deployment Strategies - Deployment options and best practices
  4. Production Best Practices - Running in production
  5. Migration Guide - Migrating existing projects

🔧 Advanced Topics

  1. API Reference - API endpoints and usage
  2. Personal Access Tokens (PAT) - System overview

📄 Reference

  1. Changelog - Release history
  2. Binary API - Binary distribution API

Quick Start

Installation

# Method 1: Direct binary download (recommended)
curl -L -o agent https://github.com/pxkundu/agent-as-code/releases/latest/download/agent-darwin-arm64
chmod +x agent
sudo mv agent /usr/local/bin/agent

# Method 2: Using pip
pip install agent-as-code

# Method 3: Using Homebrew
brew install agent-as-code

# See [Installation Guide](./INSTALL.md) for all platforms and methods

## 🚀 **Binary Distribution System**

Agent-as-Code uses a Terraform-style binary distribution API for installing the CLI itself:

### **Installation Methods**
```bash
# Method 1: Direct installation (recommended)
curl -L https://api.myagentregistry.com/install.sh | sh

# Method 2: Python package 
pip install agent-as-code

# Method 3: Manual download
curl -L https://api.myagentregistry.com/binary/releases/agent-as-code/1/2/agent_as_code_1.2.3_linux_amd64.zip

Create Your First Agent

# Initialize a new chatbot agent
agent init my-chatbot --template chatbot

# Build the agent
agent build -t my-chatbot:latest .

# Run locally
agent run my-bot:latest

Using Local LLMs

# Setup local LLM environment
agent llm setup

# Pull a model
agent llm pull llama2

# Use local model in agent.yaml
spec:
  model:
    provider: local
    name: llama2

CLI Commands

Command Description Example
init Create new agent agent init my-bot --template chatbot
build Build agent agent build -t my-bot:latest .
run Run locally agent run my-bot:latest
push Push to registry agent push my-bot:latest
pull Pull from registry agent pull my-bot:latest
llm Manage local models agent llm pull llama2
images List local agents agent images
inspect Inspect agent agent inspect my-bot:latest

Configuration Example

# agent.yaml
apiVersion: agent.dev/v1
kind: Agent
metadata:
  name: my-chatbot
  version: 1.0.0
spec:
  runtime: python:3.11
  model:
    provider: openai
    name: gpt-4
    config:
      temperature: 0.7
  capabilities:
    - text-generation
    - chat
  dependencies:
    - openai==1.0.0
    - fastapi==0.104.0
  environment:
    - name: OPENAI_API_KEY
      from: secret
  ports:
    - container: 8080
  healthCheck:
    command: ["curl", "http://localhost:8080/health"]
    interval: 30s

Community & Support

Contributing

We welcome contributions! Please see our Contributing Guide for details. (Note: Add this file if needed)

License

Agent-as-Code is open source software licensed under the MIT License.