A comprehensive multi-agent system with Large Language Model integration, built in Go
Features β’ Quick Start β’ Documentation β’ Examples β’ API Reference
GoLEM is a production-ready, scalable multi-agent system designed for modern AI applications. It provides a clean, extensible architecture for building intelligent agents that can collaborate, execute tasks, and integrate with various LLM providers.
- π€ Multi-Agent Architecture: Create and orchestrate multiple specialized AI agents
- π§ LLM Integration: Support for OpenAI, Anthropic, and Ollama providers
- π§ Built-in Tools: 8+ ready-to-use tools (Calculator, Search, Wikipedia, File System, etc.)
- πΎ Memory Management: Multiple backends (In-Memory, Redis, PostgreSQL, SQLite)
- π Workflow Orchestration: DAG-based task execution with dependency management
- π API Interfaces: Both REST and gRPC APIs with comprehensive endpoints
- π Monitoring: Prometheus metrics, health checks, and observability
- π³ Container Ready: Full Docker and Kubernetes support
- βοΈ Highly Configurable: Extensive configuration options with environment variable support
- Dynamic Agent Creation: Create specialized agents with custom LLM providers and tools
- Tool Integration: Extensible tool system with built-in safety mechanisms
- Conversation Memory: Persistent conversation history across sessions
- Multi-Provider Support: Switch between different LLM providers seamlessly
- Task Builder Pattern: Fluent API for creating complex tasks
- DAG Orchestration: Directed Acyclic Graph workflow execution
- Priority Queue: Task prioritization and scheduling
- Retry Mechanism: Automatic retry with exponential backoff
- Status Tracking: Real-time task and workflow status monitoring
- OpenAI: GPT-4, GPT-3.5-turbo with streaming support
- Anthropic: Claude 3 (Opus, Sonnet, Haiku) models
- Ollama: Local model execution support
- Streaming Responses: Real-time response streaming for all providers
- Tool Calling: Function calling capabilities where supported
| Tool | Description | Capabilities |
|---|---|---|
| Calculator | Mathematical computations | Expressions, statistics, conversions |
| Search | Web search capabilities | DuckDuckGo integration, result ranking |
| Wikipedia | Wikipedia integration | Article search, content extraction |
| File System | File operations | Read, write, list files with safety controls |
| HTTP | HTTP requests | GET, POST requests with domain restrictions |
| DateTime | Date/time operations | Current time, formatting, timezone handling |
| Text | Text processing | Analysis, transformation, validation |
| System | System information | Hardware info, process monitoring |
- In-Memory: Fast, ephemeral storage for development
- Redis: Distributed caching with TTL support
- PostgreSQL: Full-featured relational database backend
- SQLite: Lightweight persistent storage
- Search Capabilities: Full-text search across all backends
- Comprehensive Endpoints: Agents, tasks, workflows, tools, memory management
- OpenAPI/Swagger: Auto-generated documentation
- Authentication: JWT, API key, and OAuth2 support
- Rate Limiting: Configurable request throttling
- CORS Support: Cross-origin request handling
- High Performance: Binary protocol for efficient communication
- Streaming Support: Real-time bidirectional streaming
- Type Safety: Strongly typed protobuf definitions
- Load Balancing: Native gRPC load balancing support
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GoLEM Architecture β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β API Layer β REST API β gRPC API β Metrics β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Core Engine β Task Queue β Workers β Event Bus β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Agent System β Agents β Tools β Memory β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β LLM Providers β OpenAI β Anthropic β Ollama β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Storage Layer β Redis β PostgreSQLβ SQLite β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ- Task execution tracing
- Agent performance monitoring
package main
import (
"context"
"fmt"
"log"
"github.com/astrica1/GoLEM/pkg/golem"
"github.com/astrica1/GoLEM/pkg/agent"
"github.com/astrica1/GoLEM/pkg/task"
"github.com/astrica1/GoLEM/pkg/llm/openai"
)
func main() {
// Initialize GoLEM
engine := golem.NewEngine()
// Create LLM provider
llmProvider := openai.NewProvider("your-api-key")
// Create quantum scientist agent
quantumScientist := agent.NewAgent("quantum-scientist", agent.Config{
Role: "You are a quantum physics researcher",
LLMProvider: llmProvider,
Model: "gpt-4",
})
// Create speaker agent
speaker := agent.NewAgent("speaker", agent.Config{
Role: "You are a professional speaker who creates engaging presentations",
LLMProvider: llmProvider,
Model: "gpt-4",
})
// Register agents
engine.RegisterAgent(quantumScientist)
engine.RegisterAgent(speaker)
// Create research task
researchTask := task.NewTask("research-quantum", task.Config{
Description: "Research recent quantum computing breakthroughs",
AssignedAgent: "quantum-scientist",
})
// Create presentation task
presentationTask := task.NewTask("create-presentation", task.Config{
Description: "Create a 2000-word presentation about quantum computing",
AssignedAgent: "speaker",
Dependencies: []string{"research-quantum"},
})
// Execute workflow
workflow := engine.NewWorkflow()
workflow.AddTask(researchTask)
workflow.AddTask(presentationTask)
result, err := workflow.Execute(context.Background())
if err != nil {
log.Fatal(err)
}
fmt.Println("Workflow completed:", result)
}GoLEM follows clean architecture principles with clear separation of concerns:
pkg/
βββ golem/ # Core engine and orchestration
βββ agent/ # Agent management and execution
βββ task/ # Task definition and management
βββ llm/ # LLM provider integrations
βββ memory/ # Memory and storage backends
βββ tools/ # Built-in and custom tools
βββ api/ # REST and gRPC interfaces
βββ workflow/ # Workflow orchestration
βββ utils/ # Utility functions# config.yaml
golem:
engine:
max_concurrent_tasks: 10
default_timeout: "30m"
llm:
openai:
api_key: "${OPENAI_API_KEY}"
base_url: "https://api.openai.com/v1"
anthropic:
api_key: "${ANTHROPIC_API_KEY}"
ollama:
base_url: "http://localhost:11434"
memory:
backend: "redis"
redis:
addr: "localhost:6379"
password: ""
db: 0
api:
rest:
port: 8080
enable_swagger: true
grpc:
port: 9090
monitoring:
prometheus:
enabled: true
port: 2112
logging:
level: "info"
format: "json"We welcome contributions! Please see CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.