Documentation
¶
Index ¶
- Constants
- func AugmentPrompt(ctx context.Context, scope iruntime.PromptScope, ...) []openai.ChatCompletionMessageParamUnion
- func ExecuteCommand(ctx context.Context, call iruntime.CommandCall, deps CommandExecDeps) (handled bool, err error)
- func ExecuteTool(ctx context.Context, call iruntime.ToolCall, deps ToolExecDeps) (handled bool, result string, err error)
- func HandleOverflow(ctx context.Context, call any, prompt []openai.ChatCompletionMessageParamUnion, ...)
- func New(host iruntime.Host) iruntime.ModuleHooks
- func PurgeTablesBestEffort(ctx context.Context, db *dbutil.Database, bridgeID, loginID string)
- func RunFlushToolLoop(ctx context.Context, model string, ...) error
- func StopManagersForLogin(bridgeID, loginID string)
- type CacheConfig
- type ChunkingConfig
- type CommandExecDeps
- type ExperimentalConfig
- type FallbackStatus
- type FlushSettings
- type FlushToolLoopDeps
- type HybridConfig
- type Integration
- func (i *Integration) AdditionalSystemMessages(_ context.Context, _ iruntime.PromptScope) []openai.ChatCompletionMessageParamUnion
- func (i *Integration) AugmentPrompt(ctx context.Context, scope iruntime.PromptScope, ...) []openai.ChatCompletionMessageParamUnion
- func (i *Integration) CommandDefinitions(_ context.Context, _ iruntime.CommandScope) []iruntime.CommandDefinition
- func (i *Integration) ExecuteCommand(ctx context.Context, call iruntime.CommandCall) (bool, error)
- func (i *Integration) ExecuteTool(ctx context.Context, call iruntime.ToolCall) (bool, string, error)
- func (i *Integration) Name() string
- func (i *Integration) OnCompactionLifecycle(ctx context.Context, evt iruntime.CompactionLifecycleEvent)
- func (i *Integration) OnContextOverflow(ctx context.Context, call iruntime.ContextOverflowCall)
- func (i *Integration) OnFileChanged(_ context.Context, evt iruntime.FileChangedEvent)
- func (i *Integration) OnSessionMutation(ctx context.Context, evt iruntime.SessionMutationEvent)
- func (i *Integration) PurgeForLogin(ctx context.Context, scope iruntime.LoginScope) error
- func (i *Integration) StopForLogin(bridgeID, loginID string)
- func (i *Integration) ToolApprovalRequirement(toolName string, args map[string]any) (handled bool, required bool, action string)
- func (i *Integration) ToolAvailability(_ context.Context, scope iruntime.ToolScope, toolName string) (bool, bool, iruntime.SettingSource, string)
- func (i *Integration) ToolDefinitions(_ context.Context, _ iruntime.ToolScope) []iruntime.ToolDefinition
- type MemorySearchCacheStatus
- type MemorySearchFTSStatus
- type MemorySearchManager
- func (m *MemorySearchManager) Close()
- func (m *MemorySearchManager) NotifyFileChanged(path string)
- func (m *MemorySearchManager) NotifySessionChanged(ctx context.Context, sessionKey string, force bool)
- func (m *MemorySearchManager) ReadFile(ctx context.Context, relPath string, from, lines *int) (map[string]any, error)
- func (m *MemorySearchManager) Search(ctx context.Context, query string, opts memorycore.SearchOptions) ([]memorycore.SearchResult, error)
- func (m *MemorySearchManager) Status() memorycore.ProviderStatus
- func (m *MemorySearchManager) StatusDetails(ctx context.Context) (*MemorySearchStatus, error)
- func (m *MemorySearchManager) SyncWithProgress(ctx context.Context, onProgress func(completed, total int, label string)) error
- type MemorySearchSourceCount
- type MemorySearchStatus
- type ModelToolCall
- type OverflowDeps
- type PromptAugmentDeps
- type ProviderStatus
- type QueryConfig
- type ResolvedConfig
- type SearchOptions
- type SearchResult
- type SessionSyncConfig
- type StoreConfig
- type SyncConfig
- type ToolExecDeps
Constants ¶
View Source
const ( RootPath = "memory/" FilePath = "memory.md" )
View Source
const ( DefaultFlushToolLoopTimeout = 2 * time.Minute DefaultFlushToolLoopTurns = 6 )
View Source
const ( DefaultChunkTokens = memorycore.DefaultChunkTokens DefaultChunkOverlap = memorycore.DefaultChunkOverlap DefaultWatchDebounceMs = memorycore.DefaultWatchDebounceMs DefaultSessionDeltaBytes = memorycore.DefaultSessionDeltaBytes DefaultSessionDeltaMessages = memorycore.DefaultSessionDeltaMessages DefaultMaxResults = memorycore.DefaultMaxResults DefaultMinScore = memorycore.DefaultMinScore DefaultHybridCandidateMultiple = memorycore.DefaultHybridCandidateMultiple DefaultCacheEnabled = memorycore.DefaultCacheEnabled UnlimitedCacheEntries = memorycore.UnlimitedCacheEntries DefaultMemorySource = memorycore.DefaultMemorySource )
Variables ¶
This section is empty.
Functions ¶
func AugmentPrompt ¶
func AugmentPrompt( ctx context.Context, scope iruntime.PromptScope, prompt []openai.ChatCompletionMessageParamUnion, deps PromptAugmentDeps, ) []openai.ChatCompletionMessageParamUnion
func ExecuteCommand ¶
func ExecuteCommand(ctx context.Context, call iruntime.CommandCall, deps CommandExecDeps) (handled bool, err error)
func ExecuteTool ¶
func HandleOverflow ¶
func HandleOverflow( ctx context.Context, call any, prompt []openai.ChatCompletionMessageParamUnion, deps OverflowDeps, )
func PurgeTablesBestEffort ¶
func RunFlushToolLoop ¶
func RunFlushToolLoop( ctx context.Context, model string, messages []openai.ChatCompletionMessageParamUnion, deps FlushToolLoopDeps, ) error
func StopManagersForLogin ¶
func StopManagersForLogin(bridgeID, loginID string)
StopManagersForLogin stops and removes all memory managers for a login. Used during disconnect and purge to release goroutines and timers.
Types ¶
type CacheConfig ¶
type CacheConfig = memorycore.CacheConfig
type ChunkingConfig ¶
type ChunkingConfig = memorycore.ChunkingConfig
type CommandExecDeps ¶
type CommandExecDeps struct {
GetManager func(scope iruntime.ToolScope) (execManager, string)
ResolveSessionKey func(scope iruntime.ToolScope) string
SplitQuotedArgs func(raw string) ([]string, error)
WriteFile func(ctx context.Context, scope iruntime.CommandScope, mode string, path string, content string, maxBytes int) (updatedPath string, err error)
}
type ExperimentalConfig ¶
type ExperimentalConfig = memorycore.ExperimentalConfig
type FallbackStatus ¶
type FallbackStatus = memorycore.FallbackStatus
type FlushSettings ¶
type FlushToolLoopDeps ¶
type FlushToolLoopDeps struct {
TimeoutMs int64
MaxTurns int
NextTurn func(ctx context.Context, model string, messages []openai.ChatCompletionMessageParamUnion) (
assistant openai.ChatCompletionMessageParamUnion,
calls []ModelToolCall,
done bool,
err error,
)
ExecuteTool func(ctx context.Context, name string, argsJSON string) (string, error)
OnToolError func(name string, err error)
}
type HybridConfig ¶
type HybridConfig = memorycore.HybridConfig
type Integration ¶
type Integration struct {
// contains filtered or unexported fields
}
Integration is the self-owned memory integration module. It implements ToolIntegration, PromptIntegration, CommandIntegration, EventIntegration, LoginPurgeIntegration, and LoginLifecycleIntegration directly, wiring all deps from Host capability interfaces.
func (*Integration) AdditionalSystemMessages ¶
func (i *Integration) AdditionalSystemMessages(_ context.Context, _ iruntime.PromptScope) []openai.ChatCompletionMessageParamUnion
func (*Integration) AugmentPrompt ¶
func (i *Integration) AugmentPrompt(ctx context.Context, scope iruntime.PromptScope, prompt []openai.ChatCompletionMessageParamUnion) []openai.ChatCompletionMessageParamUnion
func (*Integration) CommandDefinitions ¶
func (i *Integration) CommandDefinitions(_ context.Context, _ iruntime.CommandScope) []iruntime.CommandDefinition
func (*Integration) ExecuteCommand ¶
func (i *Integration) ExecuteCommand(ctx context.Context, call iruntime.CommandCall) (bool, error)
func (*Integration) ExecuteTool ¶
func (*Integration) Name ¶
func (i *Integration) Name() string
func (*Integration) OnCompactionLifecycle ¶
func (i *Integration) OnCompactionLifecycle(ctx context.Context, evt iruntime.CompactionLifecycleEvent)
func (*Integration) OnContextOverflow ¶
func (i *Integration) OnContextOverflow(ctx context.Context, call iruntime.ContextOverflowCall)
func (*Integration) OnFileChanged ¶
func (i *Integration) OnFileChanged(_ context.Context, evt iruntime.FileChangedEvent)
func (*Integration) OnSessionMutation ¶
func (i *Integration) OnSessionMutation(ctx context.Context, evt iruntime.SessionMutationEvent)
func (*Integration) PurgeForLogin ¶
func (i *Integration) PurgeForLogin(ctx context.Context, scope iruntime.LoginScope) error
func (*Integration) StopForLogin ¶
func (i *Integration) StopForLogin(bridgeID, loginID string)
func (*Integration) ToolApprovalRequirement ¶
func (*Integration) ToolAvailability ¶
func (*Integration) ToolDefinitions ¶
func (i *Integration) ToolDefinitions(_ context.Context, _ iruntime.ToolScope) []iruntime.ToolDefinition
type MemorySearchCacheStatus ¶
type MemorySearchFTSStatus ¶
type MemorySearchManager ¶
type MemorySearchManager struct {
// contains filtered or unexported fields
}
func GetMemorySearchManager ¶
func GetMemorySearchManager(host iruntime.Host, agentID string) (*MemorySearchManager, string)
func (*MemorySearchManager) Close ¶
func (m *MemorySearchManager) Close()
Close stops background timers/goroutines. It is safe to call multiple times.
func (*MemorySearchManager) NotifyFileChanged ¶
func (m *MemorySearchManager) NotifyFileChanged(path string)
func (*MemorySearchManager) NotifySessionChanged ¶
func (m *MemorySearchManager) NotifySessionChanged(ctx context.Context, sessionKey string, force bool)
func (*MemorySearchManager) Search ¶
func (m *MemorySearchManager) Search(ctx context.Context, query string, opts memorycore.SearchOptions) ([]memorycore.SearchResult, error)
func (*MemorySearchManager) Status ¶
func (m *MemorySearchManager) Status() memorycore.ProviderStatus
func (*MemorySearchManager) StatusDetails ¶
func (m *MemorySearchManager) StatusDetails(ctx context.Context) (*MemorySearchStatus, error)
func (*MemorySearchManager) SyncWithProgress ¶
func (m *MemorySearchManager) SyncWithProgress(ctx context.Context, onProgress func(completed, total int, label string)) error
SyncWithProgress forces a reindex and reports indexing progress.
type MemorySearchSourceCount ¶
type MemorySearchStatus ¶
type MemorySearchStatus struct {
Files int
Chunks int
Dirty bool
WorkspaceDir string
DBPath string
Provider string
Model string
Sources []string
ExtraPaths []string
SourceCounts []MemorySearchSourceCount
Cache *MemorySearchCacheStatus
FTS *MemorySearchFTSStatus
Fallback *memorycore.FallbackStatus
}
type ModelToolCall ¶
type OverflowDeps ¶
type OverflowDeps struct {
IsSimpleMode func(call any) bool
ResolveSettings func() *FlushSettings
TrimPrompt func(prompt []openai.ChatCompletionMessageParamUnion) []openai.ChatCompletionMessageParamUnion
ContextWindow func(call any) int
ReserveTokens func() int
EffectiveModel func(call any) string
EstimateTokens func(prompt []openai.ChatCompletionMessageParamUnion, model string) int
AlreadyFlushed func(call any) bool
MarkFlushed func(ctx context.Context, call any)
RunFlushToolLoop func(ctx context.Context, call any, model string, prompt []openai.ChatCompletionMessageParamUnion) (bool, error)
OnError func(ctx context.Context, err error)
}
type PromptAugmentDeps ¶
type PromptAugmentDeps struct {
ShouldInjectContext func(scope iruntime.PromptScope) bool
ShouldBootstrap func(scope iruntime.PromptScope) bool
ResolveBootstrapPaths func(scope iruntime.PromptScope) []string
MarkBootstrapped func(ctx context.Context, scope iruntime.PromptScope)
ReadSection func(ctx context.Context, scope iruntime.PromptScope, path string) string
}
type ProviderStatus ¶
type ProviderStatus = memorycore.ProviderStatus
type QueryConfig ¶
type QueryConfig = memorycore.QueryConfig
type ResolvedConfig ¶
type ResolvedConfig = memorycore.ResolvedConfig
func MergeSearchConfig ¶
func MergeSearchConfig(defaults *agents.MemorySearchConfig, overrides *agents.MemorySearchConfig) *ResolvedConfig
type SearchOptions ¶
type SearchOptions = memorycore.SearchOptions
type SearchResult ¶
type SearchResult = memorycore.SearchResult
type SessionSyncConfig ¶
type SessionSyncConfig = memorycore.SessionSyncConfig
type StoreConfig ¶
type StoreConfig = memorycore.StoreConfig
type SyncConfig ¶
type SyncConfig = memorycore.SyncConfig
type ToolExecDeps ¶
type ToolExecDeps struct {
GetManager func(scope iruntime.ToolScope) (execManager, string)
ResolveSessionKey func(scope iruntime.ToolScope) string
ResolveCitationsMode func(scope iruntime.ToolScope) string
ShouldIncludeCitations func(ctx context.Context, scope iruntime.ToolScope, mode string) bool
}
Click to show internal directories.
Click to hide internal directories.