agent-sdk-go

module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2025 License: MIT

README ยถ

Ingenimax Ingenimax

Agent Go SDK

A Go-based SDK for building AI agents with various capabilities like memory, tools, LLM integration, and more.

Features

  • ๐Ÿง  Multiple LLM Providers: Integration with OpenAI, Anthropic, and more
  • ๐Ÿ”ง Extensible Tools System: Easily add capabilities to your agents
  • ๐Ÿ“ Memory Management: Store and retrieve conversation history
  • ๐Ÿ” Vector Store Integration: Semantic search capabilities
  • ๐Ÿ› ๏ธ Task Execution: Plan and execute complex tasks
  • ๐Ÿšฆ Guardrails: Safety mechanisms for responsible AI
  • ๐Ÿ“ˆ Observability: Tracing and logging for debugging
  • ๐Ÿข Multi-tenancy: Support for multiple organizations

Getting Started

Prerequisites
  • Go 1.21+
  • Redis (optional, for distributed memory)
Installation

Add the SDK to your Go project:

go get github.com/Ingenimax/agent-sdk-go
Configuration

The SDK uses environment variables for configuration. Key variables include:

  • OPENAI_API_KEY: Your OpenAI API key
  • OPENAI_MODEL: The model to use (e.g., gpt-4-turbo)
  • LOG_LEVEL: Logging level (debug, info, warn, error)
  • REDIS_ADDRESS: Redis server address (if using Redis for memory)

See .env.example for a complete list of configuration options.

Usage Examples

Creating a Simple Agent
package main

import (
	"context"
	"fmt"

	"github.com/Ingenimax/agent-sdk-go/pkg/agent"
	"github.com/Ingenimax/agent-sdk-go/pkg/llm/openai"
	"github.com/Ingenimax/agent-sdk-go/pkg/memory"
)

func main() {
	// Create OpenAI client
	openaiClient := openai.NewClient("your-api-key")

	// Create a memory store
	memoryStore := memory.NewConversationBuffer()

	// Create a new agent
	agentInstance, err := agent.NewAgent(
		agent.WithLLM(openaiClient),
		agent.WithMemory(memoryStore),
		agent.WithSystemPrompt("You are a helpful AI assistant."),
	)
	if err != nil {
		panic(err)
	}

	// Run the agent
	response, err := agentInstance.Run(context.Background(), "What is the capital of France?")
	if err != nil {
		panic(err)
	}

	fmt.Println(response)
}
Adding Tools to an Agent
import (
	"github.com/Ingenimax/agent-sdk-go/pkg/tools"
	"github.com/Ingenimax/agent-sdk-go/pkg/tools/websearch"
)

// Create a tools registry
toolRegistry := tools.NewRegistry()

// Add the web search tool
searchTool := websearch.New(
	"your-google-api-key",
	"your-search-engine-id",
)
toolRegistry.Register(searchTool)

// Create agent with tools
agent, err := agent.NewAgent(
	agent.WithLLM(openaiClient),
	agent.WithMemory(memoryStore),
	agent.WithTools(toolRegistry.List()...),
	agent.WithSystemPrompt("You are a helpful AI assistant with web search abilities."),
)
Using Execution Plans with Approval
// Create an agent that requires plan approval
agent, err := agent.NewAgent(
	agent.WithLLM(openaiClient),
	agent.WithMemory(memoryStore),
	agent.WithTools(toolRegistry.List()...),
	agent.WithSystemPrompt("You can help with complex tasks that require planning."),
	agent.WithRequirePlanApproval(true), // Enable execution plan workflow
)

// When the agent generates a plan, you can get it using ListTasks
plans := agent.ListTasks()

// Approve a plan by task ID
response, err := agent.Run(ctx, fmt.Sprintf("I approve the execution plan for task %s", taskID))

Architecture

The SDK follows a modular architecture with these key components:

  • Agent: Coordinates the LLM, memory, and tools
  • LLM: Interface to language model providers
  • Memory: Stores conversation history and context
  • Tools: Extend the agent's capabilities
  • Vector Store: For semantic search and retrieval
  • Guardrails: Ensures safe and responsible AI usage

License

This project is licensed under the MIT License - see the LICENSE file for details.

StarOps Agent

A PlatformOps assistant that helps with deployment and management tasks.

Features

  • Interactive command-line interface
  • Natural language understanding for deployment requests
  • Multi-agent architecture with specialist agents
  • Detailed deployment planning
  • Task management system with approval workflow

Task Management

The StarOps Agent includes a task management system that provides tracking and approval for deployment tasks:

Task Commands
  • task list - List all your tasks
  • task get <task-id> - View details of a specific task
  • task approve <task-id> - Approve a task's execution plan
  • task reject <task-id> <feedback> - Reject a task's plan with feedback for improvement
Task Workflow
  1. Create a task by asking the agent to deploy something (e.g., "deploy llama 3.3 on kserve")
  2. The agent will create a task and provide you with the task ID
  3. Check the status with task get <task-id>
  4. Once planning is complete, review the plan and either:
    • Approve it with task approve <task-id>
    • Reject it with task reject <task-id> The plan needs more security measures
  5. If approved, the task will be executed
  6. If rejected, the task will be replanned with your feedback
Task Statuses
  • pending - Task has been created but planning hasn't started
  • planning - Task plan is being created
  • awaiting_approval - Plan is ready for your review
  • executing - Plan is being executed
  • completed - Task has been completed successfully
  • failed - Task has failed

Usage

  1. Run the application:

    go run main.go
    
  2. Ask the agent to deploy something:

    Enter your query: deploy llama 3.3 on kserve
    
  3. Follow the task workflow described above to manage your deployment.

Development

The StarOps Agent is built with a modular architecture:

  • internal/agent - Agent implementation and factory
  • internal/planning - Deployment planning and project management
  • internal/services - Task management and other services
  • internal/models - Data models for tasks and plans
  • internal/conversation - Session handling and user interaction
  • internal/prompts - System prompts for different agents

License

Copyright ยฉ 2025 Ingenimax Inc.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL