Documentation
¶
Index ¶
- func BuildFeatures(cfg *AgentConfig) map[string]bool
- func GetAgentRefreshInterval(agentsConfig *AgentsConfig) string
- func GetEmbeddingModel(memoryConfig *MemoryConfig) string
- func GetEmbeddingProvider(memoryConfig *MemoryConfig) string
- func GetMemoryChunkOverlap(memoryConfig *MemoryConfig) int
- func GetMemoryChunkSize(memoryConfig *MemoryConfig) int
- func GetMemoryDocumentImportance(memoryConfig *MemoryConfig) float64
- func GetMemoryIngestTypes(memoryConfig *MemoryConfig) []string
- func GetOllamaURL(memoryConfig *MemoryConfig) string
- func GetParallelToolsPrompt() string
- func IsAgentInjectionEnabled(agentsConfig *AgentsConfig) bool
- func IsAutoExtractMemoriesEnabled(memoryConfig *MemoryConfig) bool
- func IsMemoryAutoIngestEnabled(memoryConfig *MemoryConfig) bool
- func IsParallelToolsEnabled(llmConfig LLMConfig) bool
- func IsTestMode(globalTestMode bool, subsystemTestMode *bool) bool
- type AgentCommSettings
- type AgentConfig
- type AgentInfo
- type AgentsConfig
- type BM25Config
- type BuiltinToolConfig
- type CircuitBreakerConfig
- type CitationsConfig
- type CompactionConfig
- type Config
- func (c *Config) Get() AgentConfig
- func (c *Config) GetLLMConfig() LLMConfig
- func (c *Config) IsSetupMode() bool
- func (c *Config) Load() error
- func (c *Config) Reset() error
- func (c *Config) Save() error
- func (c *Config) Set(newConfig AgentConfig)
- func (c *Config) SetSetupMode(enabled bool) error
- func (c *Config) Update(newConfig AgentConfig) error
- type ContextConfig
- type ExternalMCPServer
- type FileSystemConfig
- type KeywordConfig
- type KeywordRule
- type LLMConfig
- type MCPConfig
- type MCPCredential
- type MCPResourceConfig
- type MemoryConfig
- type OperatorConfig
- type PDFConfig
- type ParallelToolsConfig
- type RealtimeConfig
- type RegexConfig
- type RegexRule
- type SchedulerConfig
- type SkillsConfig
- type TasksConfig
- type TelemetryConfig
- type ToolLoadingConfig
- type UserLocationConfig
- type VisionConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildFeatures ¶
func BuildFeatures(cfg *AgentConfig) map[string]bool
BuildFeatures builds a features map from the agent configuration This is used to announce what features this agent has enabled
func GetAgentRefreshInterval ¶
func GetAgentRefreshInterval(agentsConfig *AgentsConfig) string
GetAgentRefreshInterval returns the discovery refresh interval Default: "10s"
func GetEmbeddingModel ¶
func GetEmbeddingModel(memoryConfig *MemoryConfig) string
GetEmbeddingModel returns the embedding model to use For OpenAI default: "text-embedding-3-small" For Ollama default: "nomic-embed-text"
func GetEmbeddingProvider ¶
func GetEmbeddingProvider(memoryConfig *MemoryConfig) string
GetEmbeddingProvider returns the embedding provider to use Default: "openai"
func GetMemoryChunkOverlap ¶
func GetMemoryChunkOverlap(memoryConfig *MemoryConfig) int
GetMemoryChunkOverlap returns the chunk overlap for document ingestion Default: 200
func GetMemoryChunkSize ¶
func GetMemoryChunkSize(memoryConfig *MemoryConfig) int
GetMemoryChunkSize returns the chunk size for document ingestion Default: 1000
func GetMemoryDocumentImportance ¶
func GetMemoryDocumentImportance(memoryConfig *MemoryConfig) float64
GetMemoryDocumentImportance returns the default importance for document chunks Default: 0.5
func GetMemoryIngestTypes ¶
func GetMemoryIngestTypes(memoryConfig *MemoryConfig) []string
GetMemoryIngestTypes returns the MIME types to auto-ingest Default: ["text/plain", "text/markdown", "application/json", "text/csv"]
func GetOllamaURL ¶
func GetOllamaURL(memoryConfig *MemoryConfig) string
GetOllamaURL returns the Ollama API URL Default: "http://localhost:11434"
func GetParallelToolsPrompt ¶
func GetParallelToolsPrompt() string
GetParallelToolsPrompt returns the system prompt for parallel tool execution
func IsAgentInjectionEnabled ¶
func IsAgentInjectionEnabled(agentsConfig *AgentsConfig) bool
IsAgentInjectionEnabled checks if agent injection into system prompt is enabled Default: true (inject agents into prompt for immediate visibility)
func IsAutoExtractMemoriesEnabled ¶
func IsAutoExtractMemoriesEnabled(memoryConfig *MemoryConfig) bool
IsAutoExtractMemoriesEnabled checks if auto memory extraction from conversations is enabled Default: true (when nil or not set)
func IsMemoryAutoIngestEnabled ¶
func IsMemoryAutoIngestEnabled(memoryConfig *MemoryConfig) bool
IsMemoryAutoIngestEnabled checks if auto file ingestion is enabled
func IsParallelToolsEnabled ¶
IsParallelToolsEnabled checks if parallel tools are enabled in the LLM config Defaults to true if not explicitly configured
func IsTestMode ¶
IsTestMode checks if test mode is enabled for a subsystem Priority: subsystem.test_mode > global.test_mode > false
Types ¶
type AgentCommSettings ¶
type AgentCommSettings struct {
DefaultTimeout string `json:"default_timeout"`
RetryCount int `json:"retry_count"`
RetryDelay string `json:"retry_delay"`
MaxContextMessages int `json:"max_context_messages"`
AllowRecursiveCalls bool `json:"allow_recursive_calls"`
MaxCallDepth int `json:"max_call_depth"`
TrackCallChain bool `json:"track_call_chain"`
CallTTL string `json:"call_ttl,omitempty"` // Max time for entire call chain (e.g., "120s")
CircuitBreaker *CircuitBreakerConfig `json:"circuit_breaker,omitempty"` // Circuit breaker settings
}
type AgentConfig ¶
type AgentConfig struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
TestMode bool `json:"test_mode"` // Global test mode - enables mocks for all subsystems
SetupMode bool `json:"setup_mode"` // Setup mode - agent can modify its own config
PublicURL string `json:"public_url,omitempty"` // Public URL for this agent (e.g., https://agent.example.com)
LLM LLMConfig `json:"llm"`
MCP *MCPConfig `json:"mcp,omitempty"`
Skills *SkillsConfig `json:"skills,omitempty"`
Scheduler *SchedulerConfig `json:"scheduler,omitempty"`
Tasks *TasksConfig `json:"tasks,omitempty"`
Memory *MemoryConfig `json:"memory,omitempty"`
Operator *OperatorConfig `json:"operator,omitempty"`
Context *ContextConfig `json:"context,omitempty"`
Agents *AgentsConfig `json:"agents,omitempty"`
FileSystem *FileSystemConfig `json:"filesystem,omitempty"`
Realtime *RealtimeConfig `json:"realtime,omitempty"`
Telemetry *TelemetryConfig `json:"telemetry,omitempty"`
Version string `json:"version"`
}
type AgentInfo ¶
type AgentInfo struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
URL string `json:"url"`
APIKey string `json:"api_key,omitempty"`
Capabilities []string `json:"capabilities"`
Tags []string `json:"tags"`
Enabled bool `json:"enabled"`
Timeout string `json:"timeout"`
Features map[string]bool `json:"features,omitempty"` // Enabled features: tasks, memory, filesystem, mcp, operator, scheduler, voice, agents
}
type AgentsConfig ¶
type AgentsConfig struct {
Enabled bool `json:"enabled"`
Mode string `json:"mode,omitempty"` // "coordinator" | "worker" (default: "coordinator")
Group string `json:"group,omitempty"` // Discovery group name (e.g., "production", "staging")
GossipSeed string `json:"gossip_seed,omitempty"` // Gossip seed address (triggers gossip mode)
GossipPort int `json:"gossip_port,omitempty"` // Gossip port (default: 7946)
AvailableAgents []AgentInfo `json:"available_agents,omitempty"` // Manual mode (legacy/fallback)
Settings AgentCommSettings `json:"settings"`
InjectIntoPrompt *bool `json:"inject_into_prompt,omitempty"` // Inject discovered agents into system prompt (default: true)
RefreshInterval string `json:"refresh_interval,omitempty"` // Discovery refresh interval (default: "10s")
}
func (*AgentsConfig) IsCoordinatorMode ¶
func (c *AgentsConfig) IsCoordinatorMode() bool
IsCoordinatorMode returns true if this agent can call other agents
func (*AgentsConfig) IsWorkerMode ¶
func (c *AgentsConfig) IsWorkerMode() bool
IsWorkerMode returns true if this agent is in worker mode (receive-only)
type BM25Config ¶
type BM25Config struct {
TopK int `json:"top_k"` // Number of top tools to load (default: 10)
Threshold float64 `json:"threshold"` // Min score to include (default: 0.2)
}
BM25Config for BM25-based automatic tool loading
type BuiltinToolConfig ¶
type BuiltinToolConfig struct {
Type string `json:"type"` // "web_search_20250305", "web_fetch_20250910", "computer_20250124"
Name string `json:"name"` // "web_search", "web_fetch", "computer"
MaxUses *int `json:"max_uses,omitempty"`
AllowedDomains []string `json:"allowed_domains,omitempty"`
BlockedDomains []string `json:"blocked_domains,omitempty"`
UserLocation *UserLocationConfig `json:"user_location,omitempty"`
Citations *CitationsConfig `json:"citations,omitempty"` // For web_fetch
MaxContentTokens *int `json:"max_content_tokens,omitempty"` // For web_fetch
DisplayWidthPx *int `json:"display_width_px,omitempty"` // For computer tool
DisplayHeightPx *int `json:"display_height_px,omitempty"` // For computer tool
DisplayNumber *int `json:"display_number,omitempty"` // For computer tool
}
type CircuitBreakerConfig ¶
type CircuitBreakerConfig struct {
Enabled bool `json:"enabled"` // Enable circuit breaker
FailureThreshold int `json:"failure_threshold"` // Failures before opening (default: 3)
ResetAfter string `json:"reset_after"` // Time before resetting failure count (default: "2m")
OpenDuration string `json:"open_duration"` // How long circuit stays open (default: "30s")
}
CircuitBreakerConfig configures the circuit breaker for agent calls
type CitationsConfig ¶
type CitationsConfig struct {
Enabled bool `json:"enabled"`
}
type CompactionConfig ¶
type CompactionConfig struct {
Enabled bool `json:"enabled"` // Enable auto-compaction (default: true)
TriggerRatio float64 `json:"trigger_ratio"` // Compact when context reaches X% of max_tokens (default: 0.7)
KeepRecent int `json:"keep_recent"` // Never compact last N messages (default: 20)
SummaryMaxTokens int `json:"summary_max_tokens"` // Max tokens for summary block (default: 1500)
Model string `json:"model"` // Model for summarization (default: "claude-haiku-4")
}
type Config ¶
type Config struct {
Agent AgentConfig `json:"agent"`
// contains filtered or unexported fields
}
func (*Config) Get ¶
func (c *Config) Get() AgentConfig
func (*Config) GetLLMConfig ¶
func (*Config) IsSetupMode ¶
IsSetupMode returns true if the agent is in setup mode
func (*Config) Set ¶
func (c *Config) Set(newConfig AgentConfig)
Set updates the agent config in memory without saving
func (*Config) SetSetupMode ¶
SetSetupMode enables or disables setup mode
func (*Config) Update ¶
func (c *Config) Update(newConfig AgentConfig) error
type ContextConfig ¶
type ContextConfig struct {
MaxMessages int `json:"max_messages"` // Keep last N messages (0 = unlimited) - fallback if max_tokens not set
MaxTokens int `json:"max_tokens"` // Max estimated tokens to keep (0 = use max_messages instead)
KeepImages int `json:"keep_images"` // Keep images only in last N messages (0 = keep all)
Compaction *CompactionConfig `json:"compaction,omitempty"`
}
type ExternalMCPServer ¶
type ExternalMCPServer struct {
Name string `json:"name"` // Unique name for this server (e.g., "time", "fetch")
URL string `json:"url"` // Server endpoint URL (e.g., "https://mcp-time.example.com")
Headers map[string]string `json:"headers,omitempty"` // Optional headers for auth
Enabled bool `json:"enabled"` // Whether to connect to this server
}
ExternalMCPServer configures a connection to an external standard MCP server
type FileSystemConfig ¶
type FileSystemConfig struct {
Enabled bool `json:"enabled"` // Master toggle (default: false)
MaxFileSize int64 `json:"max_file_size"` // Max single file size in bytes (default: 10MB)
MaxTotalSize int64 `json:"max_total_size"` // Max total storage in bytes (default: 100MB)
AutoExtract bool `json:"auto_extract"` // Auto-extract base64 from messages (default: true)
MinExtractSize int `json:"min_extract_size"` // Only extract if base64 > N bytes (default: 10KB)
Deduplication bool `json:"deduplication"` // Use checksums to dedupe (default: true)
AutoCleanup bool `json:"auto_cleanup"` // Enable automatic cleanup (default: true)
RetentionDays int `json:"retention_days"` // Keep files for N days, 0 = forever (default: 7)
CleanupOrphans bool `json:"cleanup_orphans"` // Remove files with no message reference (default: true)
AllowedTypes []string `json:"allowed_types"` // File types to store (default: ["image", "document"])
}
type KeywordConfig ¶
type KeywordConfig struct {
Rules []KeywordRule `json:"rules"`
}
KeywordConfig for keyword-based tool loading
type KeywordRule ¶
type KeywordRule struct {
Keywords []string `json:"keywords"` // Words to match (case-insensitive)
Tools []string `json:"tools"` // Tools to load
}
KeywordRule maps keywords to tools to load
type LLMConfig ¶
type LLMConfig struct {
Provider string `json:"provider"`
Model string `json:"model"`
MaxTokens int `json:"max_tokens"`
Temperature *float64 `json:"temperature,omitempty"`
SystemPrompt string `json:"system_prompt,omitempty"`
Tools []string `json:"tools,omitempty"`
BuiltinTools []BuiltinToolConfig `json:"builtin_tools,omitempty"`
Vision *VisionConfig `json:"vision,omitempty"`
ParallelTools *ParallelToolsConfig `json:"parallel_tools,omitempty"`
ToolLoading *ToolLoadingConfig `json:"tool_loading,omitempty"`
}
type MCPConfig ¶
type MCPConfig struct {
Enabled bool `json:"enabled"`
BaseURL string `json:"base_url"`
APIKey string `json:"api_key"`
Timeout string `json:"timeout"`
RetryCount int `json:"retry_count"`
CacheTTL string `json:"cache_ttl"`
TestMode *bool `json:"test_mode,omitempty"` // When true, MCP calls use mock responses. nil = use global test_mode
Tools []string `json:"tools,omitempty"` // MCP tools to enable (e.g., ["geocode", "list-customers"])
Resources []string `json:"resources,omitempty"` // MCP servers to sync resources from (e.g., ["notion", "github"])
Credentials map[string]MCPCredential `json:"credentials,omitempty"` // MCP tool credentials
ResourceConfig *MCPResourceConfig `json:"resource_config,omitempty"` // Resource sync settings (auto_sync, interval, filters)
Webhooks []string `json:"webhooks,omitempty"` // MCP servers to enable webhooks from (e.g., ["stripe", "github"])
Servers []ExternalMCPServer `json:"servers,omitempty"` // External standard MCP servers
}
type MCPCredential ¶
type MCPResourceConfig ¶
type MCPResourceConfig struct {
Enabled bool `json:"enabled"` // Enable resource syncing
AutoSync bool `json:"auto_sync"` // Sync on startup
SyncInterval string `json:"sync_interval,omitempty"` // Periodic sync: "1h", "6h", "24h", "" = disabled
Subscribe bool `json:"subscribe"` // Subscribe to resource change notifications
Filters []string `json:"filters,omitempty"` // URI patterns to include: ["notion://*", "github://*/docs/*"]
MaxSize int `json:"max_size,omitempty"` // Skip resources > N bytes (default: 10MB)
}
MCPResourceConfig configures MCP resource syncing to memory
type MemoryConfig ¶
type MemoryConfig struct {
Enabled bool `json:"enabled"`
EmbeddingModel string `json:"embedding_model"` // "text-embedding-3-small" or "nomic-embed-text" for Ollama
DecisionModel string `json:"decision_model"` // "gpt-5-mini" for memory decisions
MaxMemoriesPerQuery int `json:"max_memories_per_query"` // 20
MinImportance float64 `json:"min_importance"` // 0.3
MinSimilarity float64 `json:"min_similarity"` // 0.3 - minimum cosine similarity for RAG retrieval
AutoPrune bool `json:"auto_prune"`
MaxMemories int `json:"max_memories"` // 10000
// Embedding provider configuration
EmbeddingProvider string `json:"embedding_provider"` // "openai" (default) or "ollama"
OllamaURL string `json:"ollama_url"` // Ollama API URL (default: http://localhost:11434)
// Memory extraction from conversations
AutoExtractMemories *bool `json:"auto_extract_memories"` // Auto-extract memories from conversations (default: true when nil)
// File ingestion for RAG
AutoIngestFiles bool `json:"auto_ingest_files"` // Auto-chunk uploaded files into memories
IngestTypes []string `json:"ingest_types"` // MIME types to ingest ["text/plain", "text/markdown"]
ChunkSize int `json:"chunk_size"` // Max characters per chunk (default: 1000)
ChunkOverlap int `json:"chunk_overlap"` // Overlap between chunks (default: 200)
DocumentImportance float64 `json:"document_importance"` // Default importance for doc chunks (default: 0.5)
}
type OperatorConfig ¶
type OperatorConfig struct {
Enabled bool `json:"enabled"`
VirtualBrowser string `json:"virtual_browser"` // Virtual browser service URL (e.g., http://localhost:8098)
TestMode *bool `json:"test_mode,omitempty"` // Use test mode (nil = use global test_mode)
DisplayWidth int `json:"display_width"` // 1024
DisplayHeight int `json:"display_height"` // 768
AllowedDomains []string `json:"allowed_domains,omitempty"`
BlockedDomains []string `json:"blocked_domains,omitempty"`
MaxActionsPerTurn int `json:"max_actions_per_turn"` // 5
}
type ParallelToolsConfig ¶
type RealtimeConfig ¶
type RealtimeConfig struct {
Enabled bool `json:"enabled"`
Provider string `json:"provider"` // "openai" or "gemini" (default: openai)
Model string `json:"model"` // OpenAI: "gpt-4o-realtime-preview", "gpt-4o-realtime-preview-2024-12-17"
GeminiModel string `json:"gemini_model"` // Gemini: "gemini-2.0-flash-exp"
Voice string `json:"voice"` // OpenAI: "alloy", "ash", "ballad", "coral", "sage", "verse"
GeminiVoice string `json:"gemini_voice"` // Gemini: "Aoede", "Charon", "Fenrir", "Kore", "Puck"
VADType string `json:"vad_type"` // "semantic_vad" or "server_vad"
GoogleSearch bool `json:"google_search"` // Gemini: enable Google Search grounding
}
type RegexConfig ¶
type RegexConfig struct {
Rules []RegexRule `json:"rules"`
}
RegexConfig for regex-based tool loading
type RegexRule ¶
type RegexRule struct {
Pattern string `json:"pattern"` // Regex pattern to match against user message
Tools []string `json:"tools"` // Tools to load (supports glob: "stripe:*")
}
RegexRule maps a regex pattern to tools to load
type SchedulerConfig ¶
type SkillsConfig ¶
type SkillsConfig struct {
Enabled bool `json:"enabled"`
Names []string `json:"names,omitempty"` // Skills to enable: ["slack-workflows", "jira-management"]
}
SkillsConfig configures skill-based instructions that reference MCP tools
type TasksConfig ¶
type TasksConfig struct {
Enabled bool `json:"enabled"`
AllowScheduling bool `json:"allow_scheduling"` // Can create future tasks
AllowRecurring bool `json:"allow_recurring"` // Can create recurring tasks
MaxTasks int `json:"max_tasks"` // Maximum total tasks
AutoExecute bool `json:"auto_execute"` // Auto-run immediate tasks
}
type TelemetryConfig ¶
type TelemetryConfig struct {
Enabled bool `json:"enabled"`
Endpoint string `json:"endpoint"` // Remote endpoint URL
APIKey string `json:"api_key,omitempty"` // Optional auth key
BatchSize int `json:"batch_size,omitempty"` // Events per batch (default: 10)
FlushInterval int `json:"flush_interval,omitempty"` // Seconds between flushes (default: 30)
Categories []string `json:"categories,omitempty"` // Filter categories (empty = all)
}
type ToolLoadingConfig ¶
type ToolLoadingConfig struct {
Mode string `json:"mode"` // "full" (default), "on_demand"
Strategy string `json:"strategy"` // "regex", "bm25", "keyword" (only used when mode="on_demand")
AlwaysLoad []string `json:"always_load"` // Tools always included regardless of strategy
MaxTools int `json:"max_tools"` // Cap on loaded tools (default: 15)
Regex *RegexConfig `json:"regex,omitempty"`
BM25 *BM25Config `json:"bm25,omitempty"`
Keyword *KeywordConfig `json:"keyword,omitempty"`
}
ToolLoadingConfig configures on-demand tool loading to reduce token usage
type UserLocationConfig ¶
type VisionConfig ¶
type VisionConfig struct {
Enabled bool `json:"enabled"`
MaxImages int `json:"max_images"` // Per request
MaxImageSize int64 `json:"max_image_size"` // In bytes
AllowedTypes []string `json:"allowed_types"` // ["jpeg", "png", "gif", "webp"]
ResizeImages bool `json:"resize_images"`
MaxDimension int `json:"max_dimension"` // Max width/height in pixels
PDFConfig *PDFConfig `json:"pdf,omitempty"` // PDF-specific settings
}