Categorygithub.com/Dieg0Code/syndicate-go
modulepackage
0.2.1
Repository: https://github.com/dieg0code/syndicate-go.git
Documentation: pkg.go.dev

# README

Syndicate SDK Logo

Go Report Card GitHub Workflow Status codecov GoDoc License: Apache 2.0 Release

Syndicate

A Go SDK for building and orchestrating intelligent AI agents that seamlessly connect to LLMs, tools, and workflows without the complexity of direct API management.

🚀 Project Status

Current status: Beta - Stable API but under active development
Version: v0.2.0
Go Version: 1.24+

🤔 Why Syndicate?

ComparisonSyndicateDirect API CallsOther Solutions
Modularity✅ Fully modular architecture❌ Code coupled to a provider⚠️ Varies by implementation
Multi-agent✅ Native support for orchestrating multiple agents❌ Requires manual implementation⚠️ Limited or complex
Memory Management✅ Customizable and thread-safe❌ Not included⚠️ Generally basic
Tool Integration✅ Automatic with schema validation❌ Manual⚠️ Often limited
Overhead✅ Minimal, built for performance✅ None❌ Often significant

📊 LLM Compatibility

ProviderStatusSupported Models
OpenAI✅ CompleteGPT-4o, GPT-4, o3, etc.
Azure OpenAI✅ CompleteAll Azure OpenAI models
Deepseek✅ BasicDeepseekR1
Claude🔄 In development-

📚 Documentation

For a complete overview of the SDK features, see our Quick Guide.

📦 Installation

go get github.com/Dieg0Code/syndicate-go

🔑 Key Features

🤖 Agent Management

Create AI entities with distinct personalities, knowledge bases, and toolsets. Agents can work independently or together in pipelines to handle complex workflows.

🧠 Prompt Engineering

Create structured, detailed prompts that guide agent behavior with consistent responses. The SDK includes utilities for building and managing sophisticated prompts.

🛠️ Tool Integration

Connect agents with external tools and services using automatically generated JSON schemas from Go structures, complete with validation.

💾 Memory Management

Implement customizable memory systems to maintain context across conversations, with support for various storage backends from in-memory to databases.

🔄 Workflow Orchestration

Build multi-agent pipelines that process information sequentially, enabling complex conversational workflows that mirror real-world processes.

🔍 Quick Example

package main

import (
    "context"
    "fmt"

    syndicate "github.com/Dieg0Code/syndicate-go"
    openai "github.com/sashabaranov/go-openai"
)

func main() {
    // Initialize OpenAI client
    client := syndicate.NewOpenAIClient("YOUR_API_KEY")

    // Create an order processing agent
    orderAgent, _ := syndicate.NewAgent().
        SetClient(client).
        SetName("OrderAgent").
        SetConfigPrompt("You process customer orders.").
        SetModel(openai.GPT4).
        Build()

    // Create a summary agent
    summaryAgent, _ := syndicate.NewAgent().
        SetClient(client).
        SetName("SummaryAgent").
        SetConfigPrompt("You summarize order details.").
        SetModel(openai.GPT4).
        Build()

    // Create a pipeline with both agents
    system := syndicate.NewSyndicate().
        RecruitAgent(orderAgent).
        RecruitAgent(summaryAgent).
        DefinePipeline([]string{"OrderAgent", "SummaryAgent"}).
        Build()

    // Process user input
    response, _ := system.ExecutePipeline(
        context.Background(),
        "User",
        "I'd like to order two pizzas for delivery to 123 Main St."
    )

    fmt.Println(response)
}

For a complete step-by-step guide with tool integration and custom memory implementation, see our detailed examples.

🛠️ Advanced Features

Config Prompt Builder

The Config Prompt Builder helps create structured agent configuration prompts using a fluent API:

configPrompt := syndicate.NewPromptBuilder().
  CreateSection("Introduction").
  AddText("Introduction", "You are a customer service agent.").
  CreateSection("Capabilities").
  AddListItem("Capabilities", "Answer product questions.").
  AddListItem("Capabilities", "Handle order inquiries.").
  Build()

📦 Dependencies

🤝 Contributing

Contributions are welcome! Feel free to open issues or submit pull requests on GitHub.

📜 License

This project is licensed under Apache License 2.0 - See the LICENSE file for details.

# Packages

No description provided by the author

# Functions

GenerateRawSchema wraps GenerateSchema and returns the JSON marshalled schema.
NewAgentBuilder initializes and returns a new instance of AgentBuilder.
NewDeepseekR1Client crea un nuevo cliente para DeepseekR1.
NewEmbedderBuilder initializes a new EmbedderBuilder with default settings.
NewOpenAIAzureClient creates an LLMClient for Azure using Azure provider-specific settings.
NewOpenAIClient creates a new LLMClient using the provided API key with the standard OpenAI endpoint.
NewPromptBuilder creates and initializes a new PromptBuilder instance.
NewSimpleMemory creates and returns a new instance of SimpleMemory.
NewSyndicateBuilder initializes a new SyndicateBuilder with default values and a simple in-memory history.
ValidateDefinition recursively validates the generated JSON Schema definition.

# Constants

Supported JSON data types.
Supported JSON data types.
FinishReason constants define standard reasons for completion.
FinishReason constants define standard reasons for completion.
FinishReason constants define standard reasons for completion.
Supported JSON data types.
Supported JSON data types.
Supported JSON data types.
Supported JSON data types.
Role constants define standard message roles across different providers.
Role constants define standard message roles across different providers.
Role constants define standard message roles across different providers.
Role constants define standard message roles across different providers.
Role constants define standard message roles across different providers.
Supported JSON data types.

# Structs

AgentBuilder provides a fluent, modular way to configure and construct an Agent.
BaseAgent holds the common implementation of the Agent interface, including the OpenAI client, system prompt, tools, memory, model configuration, and concurrency control.
ChatCompletionRequest represents a unified chat completion request.
ChatCompletionResponse represents a unified response structure from the LLM.
Choice represents a single completion option.
DeepseekR1Client implementa LLMClient usando el SDK de DeepseekR1.
Definition is a struct for describing a JSON Schema.
Embedder is responsible for generating embeddings using the OpenAI API.
EmbedderBuilder provides a fluent API to configure and build an Embedder instance.
JSONSchema defines the structure for responses in JSON.
Message represents a chat message with standardized fields.
OpenAIClient implements the LLMClient interface using the OpenAI SDK.
PromptBuilder facilitates the construction of a prompt by organizing content into sections and subsections.
ResponseFormat specifies how the LLM should format its response.
Section represents a block of content that may include text lines and nested subsections.
SimpleMemory implements a basic in-memory storage for chat messages.
Syndicate manages multiple agents, maintains a global conversation history, and optionally defines an execution pipeline for agents.
SyndicateBuilder provides a fluent interface for constructing a Syndicate.
ToolCall represents a tool invocation request.
ToolDefinition describes a tool's capabilities.
Usage provides token usage statistics.

# Interfaces

Agent defines the interface for processing inputs and managing tools.
LLMClient defines the interface for interacting with LLM providers.
Memory defines the interface for managing a history of chat messages.
Tool defines the interface for executable tools.

# Type aliases

DataType represents a JSON data type in the generated schema.