Documentation
¶
Index ¶
- type Manager
- func (m *Manager) AddMemoryInsight(insight string, importance int) error
- func (m *Manager) AnalyzeToolSequence(task string, tools []string)
- func (m *Manager) AppendMemory(line string) error
- func (m *Manager) AppendUser(line string) error
- func (m *Manager) CompleteExecution()
- func (m *Manager) FindResumableTask(description string) *execution.Checkpoint
- func (m *Manager) GetClarificationQuestion() string
- func (m *Manager) GetDetectedPatterns() []skills.Pattern
- func (m *Manager) GetExecutionPlan() *cognition.ExecutionPlan
- func (m *Manager) GetExecutionProgress() *execution.Progress
- func (m *Manager) GetGeneratedSkills() []string
- func (m *Manager) GetIntent() perception.IntentType
- func (m *Manager) GetLastDecision() *cognition.Decision
- func (m *Manager) GetLastPerception() *perception.PerceptionResult
- func (m *Manager) GetMemoryStats() map[string]interface{}
- func (m *Manager) GetMemoryVersion() int
- func (m *Manager) GetPromptContext() string
- func (m *Manager) GetRecommendedMaxTurns() int
- func (m *Manager) GetRetrievalHints() []cognition.RetrievalHint
- func (m *Manager) GetSkillEvolutionStats() map[string]interface{}
- func (m *Manager) GetSystemStatus() map[string]interface{}
- func (m *Manager) GetTaskComplexity() perception.TaskComplexity
- func (m *Manager) GetTurnCount() int
- func (m *Manager) GetUserContext() string
- func (m *Manager) HasNoise() bool
- func (m *Manager) NeedsClarification() bool
- func (m *Manager) OnSessionEnd()
- func (m *Manager) OnTurnEnd()
- func (m *Manager) OnTurnStart()
- func (m *Manager) OnUserMessage(input string)
- func (m *Manager) Reset()
- func (m *Manager) SearchMemory(query string, limit int) []memory.SearchResult
- func (m *Manager) ShouldUseSubAgents() bool
- func (m *Manager) Start() error
- func (m *Manager) StartExecution(task string) *execution.Progress
- func (m *Manager) SuggestRecoveryAction(err error) execution.RecoveryAction
- func (m *Manager) UpdateExecutionStep(stepID int, stepName string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
Snapshot *memory.SnapshotManager // System 4: Frozen snapshot memory
Trigger *trigger.MessageTrigger // System 1 + 2: Nudge mechanism
Review *review.BackgroundReview // System 3: Background review
Perception *perception.Parser // Layer 1: Intent classification
Cognition *cognition.Planner // Layer 2: Planning and decision making
Execution *execution.Manager // Layer 3: Checkpoint + Resume
FTSMemory *memory.FTSStore // System 5: FTS full-text search
SkillCreator *skills.EnhancedAutoCreator // System 6: Auto skill evolution
LastPerception *perception.PerceptionResult
LastDecision *cognition.Decision // Last cognition decision
LastCheckpoint *execution.Checkpoint // Current execution checkpoint
// contains filtered or unexported fields
}
Manager integrates all six Cortex Agent systems: 1. User Message Trigger 2. Periodic Nudge Mechanism 3. Background Review System 4. Dual File Storage (MEMORY.md + USER.md) 5. Holographic Memory (SQLite FTS5 - coming soon) 6. Memory Manager with Frozen Snapshot
func NewManager ¶
NewManager creates a new Cortex integration manager Initializes all 6 Cortex systems and 3-layer architecture
func (*Manager) AddMemoryInsight ¶
AddMemoryInsight stores a learned insight in FTS memory
func (*Manager) AnalyzeToolSequence ¶
AnalyzeToolSequence analyzes a tool sequence for pattern recognition
func (*Manager) AppendMemory ¶
AppendMemory adds a line to the memory file Writes to disk immediately but does NOT refresh frozen snapshot
func (*Manager) AppendUser ¶
AppendUser adds a line to the user profile Writes to disk immediately but does NOT refresh frozen snapshot
func (*Manager) CompleteExecution ¶
func (m *Manager) CompleteExecution()
CompleteExecution marks execution as successfully completed
func (*Manager) FindResumableTask ¶
func (m *Manager) FindResumableTask(description string) *execution.Checkpoint
FindResumableTask checks if there's a resumable checkpoint
func (*Manager) GetClarificationQuestion ¶
GetClarificationQuestion returns the question to ask user for clarification
func (*Manager) GetDetectedPatterns ¶
GetDetectedPatterns returns all currently detected patterns
func (*Manager) GetExecutionPlan ¶
func (m *Manager) GetExecutionPlan() *cognition.ExecutionPlan
GetExecutionPlan returns the current execution plan
func (*Manager) GetExecutionProgress ¶
GetExecutionProgress returns the current execution progress
func (*Manager) GetGeneratedSkills ¶
GetGeneratedSkills returns all auto-generated skills
func (*Manager) GetIntent ¶
func (m *Manager) GetIntent() perception.IntentType
GetIntent returns the classified intent type
func (*Manager) GetLastDecision ¶
GetLastDecision returns the last cognition decision
func (*Manager) GetLastPerception ¶
func (m *Manager) GetLastPerception() *perception.PerceptionResult
GetLastPerception returns the result from the perception layer This can be used by the decision layer to: - Adjust max turns based on task complexity - Change tool selection based on intent - Request clarification if noise is detected
func (*Manager) GetMemoryStats ¶
GetMemoryStats returns statistics about the memory store
func (*Manager) GetMemoryVersion ¶
GetMemoryVersion returns the current memory version
func (*Manager) GetPromptContext ¶
GetPromptContext returns the memory context to include in system prompt Uses the frozen snapshot, not the latest version
func (*Manager) GetRecommendedMaxTurns ¶
GetRecommendedMaxTurns returns the recommended max turns based on task complexity
func (*Manager) GetRetrievalHints ¶
func (m *Manager) GetRetrievalHints() []cognition.RetrievalHint
GetRetrievalHints returns hints for memory retrieval
func (*Manager) GetSkillEvolutionStats ¶
GetSkillEvolutionStats returns statistics about skill generation
func (*Manager) GetSystemStatus ¶
GetSystemStatus returns status of all six Cortex systems
func (*Manager) GetTaskComplexity ¶
func (m *Manager) GetTaskComplexity() perception.TaskComplexity
GetTaskComplexity returns the estimated task complexity
func (*Manager) GetTurnCount ¶
GetTurnCount returns the current turn count
func (*Manager) GetUserContext ¶
GetUserContext returns the user profile for system prompt Uses the frozen snapshot
func (*Manager) NeedsClarification ¶
NeedsClarification returns true if clarification should be requested
func (*Manager) OnSessionEnd ¶
func (m *Manager) OnSessionEnd()
OnSessionEnd is called when a session completes Refreshes the memory snapshot with latest changes
func (*Manager) OnTurnEnd ¶
func (m *Manager) OnTurnEnd()
OnTurnEnd is called at the end of each LLM turn
func (*Manager) OnTurnStart ¶
func (m *Manager) OnTurnStart()
OnTurnStart is called at the beginning of each LLM turn Freezes the memory snapshot for prefix cache protection
func (*Manager) OnUserMessage ¶
OnUserMessage handles a new user message, triggering: - Layer 1: Perception (intent classification, noise detection) - Layer 2: Cognition (task planning, memory retrieval hints) - Turn counter increment - Nudge if threshold reached (async) - Skill creation flow initialization
func (*Manager) SearchMemory ¶
func (m *Manager) SearchMemory(query string, limit int) []memory.SearchResult
SearchMemory performs full-text search across all conversation history
func (*Manager) ShouldUseSubAgents ¶
ShouldUseSubAgents returns true if sub-agents should be enabled
func (*Manager) Start ¶
Start initializes all six Cortex systems Systems started in order of dependency:
- Memory systems (Snapshot, FTS)
- Review system
- Skill evolution system
- Trigger system
func (*Manager) StartExecution ¶
StartExecution begins a new execution with checkpoint support
func (*Manager) SuggestRecoveryAction ¶
func (m *Manager) SuggestRecoveryAction(err error) execution.RecoveryAction
SuggestRecoveryAction suggests what to do after failure
func (*Manager) UpdateExecutionStep ¶
UpdateExecutionStep updates the current step