A community-driven registry for Claude, Cursor, Windsurf, Cline & more. Not affiliated with Anthropic.
Are you the author? Sign in to claim
A Golang autonomous AI agent framework for assisting real work
Anyi is a powerful autonomous AI agent framework that helps you build AI solutions that seamlessly integrate with real-world workflows through unified LLM interfaces, robust validation mechanisms, and flexible workflow systems.
Anyi is ideal for:
go get -u github.com/jieliu2000/anyi
Requires Go 1.20 or higher
package main
import (
"log"
"os"
"github.com/jieliu2000/anyi"
"github.com/jieliu2000/anyi/llm/openai" // Import your preferred provider
"github.com/jieliu2000/anyi/llm/chat"
)
func main() {
// Create client - just change imports and config to use different providers
config := openai.DefaultConfig("gpt-4")
config.APIKey = os.Getenv("OPENAI_API_KEY")
client, err := anyi.NewClient("gpt4", config)
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// Send chat request
messages := []chat.Message{
{Role: "user", Content: "How many countries are in Africa?"},
}
response, _, err := client.Chat(messages, nil)
if err != nil {
log.Fatalf("Chat failed: %v", err)
}
log.Printf("Response: %s", response.Content)
}
package main
import (
"log"
"os"
"github.com/jieliu2000/anyi"
"github.com/jieliu2000/anyi/llm/openai"
)
func main() {
// Create client
config := openai.DefaultConfig("gpt-4")
config.APIKey = os.Getenv("OPENAI_API_KEY")
client, err := anyi.NewClient("gpt4", config)
if err != nil {
log.Fatalf("Failed to create client: %v", err)
}
// Create a two-step workflow
step1, _ := anyi.NewLLMStepWithTemplate(
"Generate a short story about {{.Text}}",
"You are a creative fiction writer.",
client,
)
step1.Name = "story_generation"
step2, _ := anyi.NewLLMStepWithTemplate(
"Create an engaging title for the following story:\n\n{{.Text}}",
"You are an editor skilled at creating titles.",
client,
)
step2.Name = "title_creation"
// Create and register the flow
myFlow, _ := anyi.NewFlow("story_flow", client, *step1, *step2)
anyi.RegisterFlow("story_flow", myFlow)
// Run the workflow
result, _ := myFlow.RunWithInput("a detective in future London")
log.Printf("Title: %s", result.Text)
}
Anyi supports configuration-driven development, allowing you to define LLM clients and workflows in external files:
# config.yaml
clients:
- name: "gpt4"
type: "openai"
config:
model: "gpt-4"
apiKey: "$OPENAI_API_KEY" # References environment variable
- name: "ollama"
type: "ollama"
config:
model: "llama3"
baseURL: "http://localhost:11434" # Default Ollama server address
flows:
- name: "story_flow"
clientName: "gpt4" # Default client for the flow
steps:
- name: "story_generation"
executor:
type: "llm"
withconfig:
template: "Generate a short story about {{.Text}}"
systemMessage: "You are a creative fiction writer."
maxRetryTimes: 2
- name: "title_creation"
executor:
type: "llm"
withconfig:
template: "Create an engaging title for the following story:\n\n{{.Text}}"
systemMessage: "You are an editor skilled at creating titles."
clientName: "ollama" # Override client for this step
Load and use this configuration:
package main
import (
"log"
"github.com/jieliu2000/anyi"
)
func main() {
// Load configuration from file
err := anyi.ConfigFromFile("./config.yaml")
if err != nil {
log.Fatalf("Failed to load config: %v", err)
}
// Get and run the configured flow
flow, err := anyi.GetFlow("story_flow")
if err != nil {
log.Fatalf("Failed to get flow: %v", err)
}
result, err := flow.RunWithInput("a detective in future London")
if err != nil {
log.Fatalf("Flow execution failed: %v", err)
}
log.Printf("Result: %s", result.Text)
}
Contributions welcome! Anyi is under active development, and your feedback helps make it better for everyone.
Anyi is licensed under the Apache License 2.0.
Pocket Flow: Codebase to Tutorial
A Comprehensive Benchmark to Evaluate LLMs as Agents (ICLR'24)
干净、强大、属于你的 AI Agent 平台 --AI agents, without the clutter.
💻 A curated list of papers and resources for multi-modal Graphical User Interface (GUI) agents.