Documentation
¶
Index ¶
- type AgentLoop
- func (al *AgentLoop) GetStartupInfo() map[string]interface{}
- func (al *AgentLoop) ProcessDirect(ctx context.Context, content, sessionKey string) (string, error)
- func (al *AgentLoop) ProcessDirectWithChannel(ctx context.Context, content, sessionKey, channel, chatID string) (string, error)
- func (al *AgentLoop) RegisterTool(tool tools.Tool)
- func (al *AgentLoop) Run(ctx context.Context) error
- func (al *AgentLoop) Stop()
- type ContextBuilder
- func (cb *ContextBuilder) AddAssistantMessage(messages []providers.Message, content string, ...) []providers.Message
- func (cb *ContextBuilder) AddToolResult(messages []providers.Message, toolCallID, toolName, result string) []providers.Message
- func (cb *ContextBuilder) BuildMessages(history []providers.Message, summary string, currentMessage string, ...) []providers.Message
- func (cb *ContextBuilder) BuildSystemPrompt() string
- func (cb *ContextBuilder) GetSkillsInfo() map[string]interface{}
- func (cb *ContextBuilder) LoadBootstrapFiles() string
- func (cb *ContextBuilder) SetToolsRegistry(registry *tools.ToolRegistry)
- type MemoryStore
- func (ms *MemoryStore) AppendToday(content string) error
- func (ms *MemoryStore) GetMemoryContext() string
- func (ms *MemoryStore) GetRecentDailyNotes(days int) string
- func (ms *MemoryStore) ReadLongTerm() string
- func (ms *MemoryStore) ReadToday() string
- func (ms *MemoryStore) WriteLongTerm(content string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentLoop ¶
type AgentLoop struct {
// contains filtered or unexported fields
}
func NewAgentLoop ¶
func NewAgentLoop(cfg *config.Config, msgBus *bus.MessageBus, provider providers.LLMProvider) *AgentLoop
func (*AgentLoop) GetStartupInfo ¶ added in v0.1.1
GetStartupInfo returns information about loaded tools and skills for logging.
func (*AgentLoop) ProcessDirect ¶
func (*AgentLoop) ProcessDirectWithChannel ¶ added in v0.1.1
func (*AgentLoop) RegisterTool ¶ added in v0.1.1
type ContextBuilder ¶
type ContextBuilder struct {
// contains filtered or unexported fields
}
func NewContextBuilder ¶
func NewContextBuilder(workspace string) *ContextBuilder
func (*ContextBuilder) AddAssistantMessage ¶
func (*ContextBuilder) AddToolResult ¶
func (*ContextBuilder) BuildMessages ¶
func (*ContextBuilder) BuildSystemPrompt ¶
func (cb *ContextBuilder) BuildSystemPrompt() string
func (*ContextBuilder) GetSkillsInfo ¶ added in v0.1.1
func (cb *ContextBuilder) GetSkillsInfo() map[string]interface{}
GetSkillsInfo returns information about loaded skills.
func (*ContextBuilder) LoadBootstrapFiles ¶
func (cb *ContextBuilder) LoadBootstrapFiles() string
func (*ContextBuilder) SetToolsRegistry ¶ added in v0.1.1
func (cb *ContextBuilder) SetToolsRegistry(registry *tools.ToolRegistry)
SetToolsRegistry sets the tools registry for dynamic tool summary generation.
type MemoryStore ¶ added in v0.1.1
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore manages persistent memory for the agent. - Long-term memory: memory/MEMORY.md - Daily notes: memory/YYYYMM/YYYYMMDD.md
func NewMemoryStore ¶ added in v0.1.1
func NewMemoryStore(workspace string) *MemoryStore
NewMemoryStore creates a new MemoryStore with the given workspace path. It ensures the memory directory exists.
func (*MemoryStore) AppendToday ¶ added in v0.1.1
func (ms *MemoryStore) AppendToday(content string) error
AppendToday appends content to today's daily note. If the file doesn't exist, it creates a new file with a date header.
func (*MemoryStore) GetMemoryContext ¶ added in v0.1.1
func (ms *MemoryStore) GetMemoryContext() string
GetMemoryContext returns formatted memory context for the agent prompt. Includes long-term memory and recent daily notes.
func (*MemoryStore) GetRecentDailyNotes ¶ added in v0.1.1
func (ms *MemoryStore) GetRecentDailyNotes(days int) string
GetRecentDailyNotes returns daily notes from the last N days. Contents are joined with "---" separator.
func (*MemoryStore) ReadLongTerm ¶ added in v0.1.1
func (ms *MemoryStore) ReadLongTerm() string
ReadLongTerm reads the long-term memory (MEMORY.md). Returns empty string if the file doesn't exist.
func (*MemoryStore) ReadToday ¶ added in v0.1.1
func (ms *MemoryStore) ReadToday() string
ReadToday reads today's daily note. Returns empty string if the file doesn't exist.
func (*MemoryStore) WriteLongTerm ¶ added in v0.1.1
func (ms *MemoryStore) WriteLongTerm(content string) error
WriteLongTerm writes content to the long-term memory file (MEMORY.md).