Versions in this module Expand all Collapse all v0 v0.5.0 May 11, 2026 v0.4.0 May 5, 2026 v0.3.0 May 3, 2026 v0.2.0 May 16, 2026 Changes in this version + var DefaultDecayConfig = DecayConfig + func BoostNode(ctx context.Context, store storage.Storage, id string, boost float64) error + func CacheKey(opts RecallOpts) string + func DetectOpenLoop(text string, minLen int) string + func DetectResolution(text string) bool + func ExpandQuery(query string) string + func ExportHTML(ctx context.Context, store storage.Storage) (string, error) + func FormatContext(nodes []*storage.Node) string + func FuzzyMatch(query, content string) bool + func GarbageCollect(ctx context.Context, store storage.Storage, cfg DecayConfig) (int, error) + func GracefulShutdown(e *Engine) + func IsValidNodeType(typ string) bool + func IsWellSpaced(accessTimes []time.Time, config SpacingConfig) bool + func MMRRerank(nodes []*storage.Node, scores map[string]float64, lambda float64, k int) []*storage.Node + func NormalizeBM25(rawScore float64, queryTermCount int) float64 + func QueryTermCount(query string) int + func RunDecay(ctx context.Context, store storage.Storage, cfg DecayConfig) error + func ShortestPath(ctx context.Context, store storage.Storage, fromID, toID string) ([]string, error) + func SpacingScore(accessTimes []time.Time, config SpacingConfig) float64 + func SpreadAttenuatedBoost(similarity float64, numLinked int, decay float64) float64 + func StartupSelfTest(ctx context.Context, store storage.Storage) error + func SupersedeEdge(edge *TemporalEdge) + func TimelineFilter(limit int) storage.NodeFilter + func TrimToTokenBudget(nodes []*storage.Node, budget int) []*storage.Node + type AccessTracker struct + func NewAccessTracker(store storage.Storage, interval time.Duration) *AccessTracker + func (at *AccessTracker) Flush(ctx context.Context) + func (at *AccessTracker) Log(ctx context.Context, nodeID string) + func (at *AccessTracker) Stop() + type AuditEntry struct + Agent string + Details string + NodeID string + NodeType string + Operation string + Timestamp time.Time + type AuditLog struct + func NewAuditLog(yaadDir string) (*AuditLog, error) + func (al *AuditLog) Close() + func (al *AuditLog) Count() int + func (al *AuditLog) Log(op, nodeID, nodeType, agent, details string) + type BloomFilter struct + func NewBloomFilter(expectedItems int, fpRate float64) *BloomFilter + func (bf *BloomFilter) Add(term string) + func (bf *BloomFilter) AddTerms(content string) + func (bf *BloomFilter) Count() int + func (bf *BloomFilter) FalsePositiveRate() float64 + func (bf *BloomFilter) MayContain(term string) bool + func (bf *BloomFilter) MayContainAny(query string) bool + type Community struct + ID int + NodeIDs []string + Size int + Summary string + Types map[string]int + type CommunityDetector struct + func NewCommunityDetector(store storage.Storage) *CommunityDetector + func (cd *CommunityDetector) Detect(ctx context.Context, maxIter int) ([]Community, error) + func (cd *CommunityDetector) FindCommunityForQuery(communities []Community, query string) *Community + func (cd *CommunityDetector) Summarize(ctx context.Context, communities []Community) []Community + type ConflictCandidate struct + Content string + NodeID string + Score float64 + type ContextPacker struct + func NewContextPacker(budget int) *ContextPacker + func (cp *ContextPacker) Pack(nodes []*storage.Node) *PackedContext + type ContextualScoring struct + func NewContextualScoring() *ContextualScoring + func (cs *ContextualScoring) LastActivity() time.Time + func (cs *ContextualScoring) RecordQuery(query string) + func (cs *ContextualScoring) Reset() + func (cs *ContextualScoring) TopicBoost(node *storage.Node) float64 + type ConversationSummarizer struct + func (cs *ConversationSummarizer) Summarize(conversation string, maxMemories int) []SummarizedMemory + type CuriosityConfig struct + Enabled bool + MaxTargets int + func DefaultCuriosityConfig() CuriosityConfig + type CuriosityEngine struct + func NewCuriosityEngine(config CuriosityConfig) *CuriosityEngine + func (e *CuriosityEngine) AddTarget(topic, gapType string, priority float64) *ExplorationTarget + func (e *CuriosityEngine) GetTopTargets(limit int) []*ExplorationTarget + func (e *CuriosityEngine) MarkExplored(targetID, findings string) bool + type DecayConfig struct + BoostOnAccess float64 + HalfLifeDays float64 + MinConfidence float64 + type DirectiveType string + const DirectiveContradiction + const DirectiveKnowledgeGap + const DirectiveLowConfidence + const DirectiveStaleFact + type EdgeInput struct + ToID string + Type string + type Engine struct + DecayConfig DecayConfig + func New(store storage.Storage, g graph.Graph) *Engine + func (e *Engine) Branch(ctx context.Context, nodeID, newContent, newType string) (*storage.Node, error) + func (e *Engine) CachedRecall(nodes []*storage.Node) + func (e *Engine) Close() + func (e *Engine) Compact(ctx context.Context, project string) (int, error) + func (e *Engine) CompressSession(ctx context.Context, sessionID, project string) (*storage.Node, error) + func (e *Engine) Context(ctx context.Context, project string) (*RecallResult, error) + func (e *Engine) Feedback(ctx context.Context, id string, action FeedbackAction, newContent string) error + func (e *Engine) FindConflictCandidates(ctx context.Context, nodeID, content string, limit int) ([]ConflictCandidate, error) + func (e *Engine) Forget(ctx context.Context, id string) error + func (e *Engine) FusedRecall(ctx context.Context, opts RecallOpts) (*RecallResult, error) + func (e *Engine) GetMemoryStats(ctx context.Context) (*MemoryStats, error) + func (e *Engine) GetMetrics() Metrics + func (e *Engine) GetNodeHistory(ctx context.Context, nodeID string) ([]NodeHistoryEntry, error) + func (e *Engine) GetUserProfile(ctx context.Context, project string) (*UserProfile, error) + func (e *Engine) Graph() graph.Graph + func (e *Engine) Integrity() *MemoryIntegrity + func (e *Engine) MentalModel(ctx context.Context, project string) (*mental.Model, error) + func (e *Engine) PendingNodes(ctx context.Context, project string, threshold float64) ([]*storage.Node, error) + func (e *Engine) Profile(ctx context.Context, project string) (*profile.Profile, error) + func (e *Engine) Query(ctx context.Context, question string, project string) (*QueryResult, error) + func (e *Engine) Recall(ctx context.Context, opts RecallOpts) (*RecallResult, error) + func (e *Engine) Remember(ctx context.Context, in RememberInput) (*storage.Node, error) + func (e *Engine) Rollback(ctx context.Context, id string, version int) error + func (e *Engine) SelfLink(ctx context.Context, node *storage.Node) + func (e *Engine) StartSession(ctx context.Context, project, agent string) (string, error) + func (e *Engine) Status(ctx context.Context, project string) (*Status, error) + func (e *Engine) Store() storage.Storage + func (e *Engine) UpdateUserPreference(ctx context.Context, project, key, value string) error + func (e *Engine) VectorSearch(query []float32, k int) []string + func (e *Engine) WithIntegrity(mi *MemoryIntegrity) *Engine + func (e *Engine) WithSummarizer(s compact.Summarizer) *Engine + type Entity struct + Name string + Type string + func ExtractEntities(content string) []Entity + type EntityIndex struct + func NewEntityIndex() *EntityIndex + func (ei *EntityIndex) BoostScores(query string) map[string]float64 + func (ei *EntityIndex) IndexNode(node *storage.Node) + func (ei *EntityIndex) LoadFromStore(ctx context.Context, store storage.Storage) error + func (ei *EntityIndex) RemoveNode(nodeID string) + func (ei *EntityIndex) Size() int + type EpistemicConfig struct + Enabled bool + ExpiryDays int + MaxActiveDirectives int + MaxPerSession int + MinPriority float64 + func DefaultEpistemicConfig() EpistemicConfig + type EpistemicDirective struct + Attempts int + Context string + CreatedAt time.Time + ID string + Priority float64 + Question string + Resolution string + ResolvedAt *time.Time + SourceEntityIDs []string + Type DirectiveType + type EpistemicEngine struct + func NewEpistemicEngine(config EpistemicConfig) *EpistemicEngine + func (e *EpistemicEngine) CreateDirective(dtype DirectiveType, question, context string, priority float64, ...) *EpistemicDirective + func (e *EpistemicEngine) ExpireOld() int + func (e *EpistemicEngine) GetForSession() []*EpistemicDirective + func (e *EpistemicEngine) Resolve(directiveID, resolution string) bool + type ExplorationTarget struct + CreatedAt time.Time + ExploredAt *time.Time + Findings string + GapType string + ID string + Priority float64 + Topic string + type FeedbackAction string + const FeedbackApprove + const FeedbackDiscard + const FeedbackEdit + type FeedbackSignal struct + func NewFeedbackSignal(store storage.Storage) *FeedbackSignal + func (fs *FeedbackSignal) ApplyToNodes(ctx context.Context) int + func (fs *FeedbackSignal) BoostMultiplier(nodeID string) float64 + func (fs *FeedbackSignal) MarkIrrelevant(nodeID string) + func (fs *FeedbackSignal) MarkRelevant(nodeID string) + type GitLearner struct + func NewGitLearner(dir string, engine *Engine) *GitLearner + func (gl *GitLearner) LearnFromBlame(ctx context.Context, filePath string) error + func (gl *GitLearner) LearnFromHistory(ctx context.Context, limit int, since time.Time) (*LearnResult, error) + func (gl *GitLearner) Suggest(ctx context.Context) ([]MemorySuggestion, error) + type GraphDiff struct + Added []*storage.Node + Modified []*storage.Node + Removed []string + func DiffSince(ctx context.Context, store storage.Storage, sinceVersion int) (*GraphDiff, error) + type HNSW struct + M int + func NewHNSW(dim int) *HNSW + func (h *HNSW) Contains(id string) bool + func (h *HNSW) Insert(id string, vector []float32) + func (h *HNSW) Remove(id string) + func (h *HNSW) Search(query []float32, k int) ([]string, []float32) + func (h *HNSW) Size() int + type HandoffSummary struct + Accomplished []string + BugsFound []string + Conventions []string + Decisions []string + Duration string + InProgress []string + NextSteps []string + SessionID string + type HealthCheck struct + Latency time.Duration + Message string + Name string + Status HealthStatus + type HealthChecker struct + func NewHealthChecker(store storage.Storage) *HealthChecker + func (hc *HealthChecker) Check(ctx context.Context) *HealthReport + type HealthReport struct + CacheHits int + Checks []HealthCheck + DBSize int64 + EdgeCount int + LastRecall time.Duration + NodeCount int + Status HealthStatus + Uptime time.Duration + type HealthStatus string + const HealthDegraded + const HealthHealthy + const HealthUnhealthy + type HierarchicalMemory struct + func NewHierarchicalMemory(store storage.Storage) *HierarchicalMemory + func (hm *HierarchicalMemory) Build(ctx context.Context) error + func (hm *HierarchicalMemory) FormatLevel(level int) string + func (hm *HierarchicalMemory) RetrieveAdaptive(query string) int + func (hm *HierarchicalMemory) RetrieveAtLevel(query string, level int) []MemoryCluster + type HierarchyLevel struct + Clusters []MemoryCluster + Level int + type HybridSearch struct + func NewHybridSearch(store storage.Storage, g graph.Graph, provider embeddings.Provider) *HybridSearch + func (h *HybridSearch) Search(ctx context.Context, query string, opts RecallOpts) ([]*ScoredNode, error) + type IngestResult struct + Bugs int + Conventions int + Decisions int + Files int + Preferences int + Skipped int + Source string + Specs int + Tasks int + Total int + type Ingester struct + func NewIngester(engine *Engine) *Ingester + func (ing *Ingester) DetectStack(ctx context.Context, projectDir string) (*IngestResult, error) + func (ing *Ingester) IngestClaudeMD(ctx context.Context, path string) (*IngestResult, error) + func (ing *Ingester) IngestCodeFile(ctx context.Context, path string) (*IngestResult, error) + func (ing *Ingester) IngestConversation(ctx context.Context, text string) (*IngestResult, error) + func (ing *Ingester) IngestCursorRules(ctx context.Context, path string) (*IngestResult, error) + func (ing *Ingester) IngestDirectory(ctx context.Context, dir string) (*IngestResult, error) + func (ing *Ingester) IngestFile(ctx context.Context, path string) (*IngestResult, error) + func (ing *Ingester) IngestMarkdown(ctx context.Context, content, source string) (*IngestResult, error) + type LLMExtractor struct + func NewLLMExtractor(apiKey, baseURL, model string) *LLMExtractor + func (e *LLMExtractor) Extract(ctx context.Context, content string) []Entity + type LabileMemory struct + ChunkID string + Contradicted bool + RecalledAt time.Time + Strengthened bool + type LearnResult struct + Bugs int + Conventions int + Decisions int + Duration time.Duration + Files int + Skipped int + type MemoryCluster struct + AvgConf float64 + ID string + Keywords []string + NodeIDs []string + Size int + Summary string + type MemoryExpiry struct + func NewMemoryExpiry(defaultTTL time.Duration) *MemoryExpiry + func (me *MemoryExpiry) IsExpired(createdAt time.Time, pinned bool) bool + type MemoryIntegrity struct + func NewMemoryIntegrity(yaadDir string) (*MemoryIntegrity, error) + func (mi *MemoryIntegrity) Sign(node *storage.Node) string + func (mi *MemoryIntegrity) Verify(node *storage.Node, expectedSig string) bool + func (mi *MemoryIntegrity) VerifyBatch(nodes []*storage.Node, signatures map[string]string) []string + type MemoryStats struct + LastUpdated time.Time + NodesByType map[string]int + TopTopics []string + TotalEdges int + TotalNodes int + type MemorySuggestion struct + Confidence float64 + Content string + Reason string + Type string + type Metrics struct + Errors int64 + NodesStored int64 + Recalls int64 + Remembers int64 + type NodeHistoryEntry struct + ChangedAt string + ChangedBy string + Content string + Reason string + Version int + type OpenLoop struct + ChunkID string + Context string + DetectedAt time.Time + Resolved bool + type PackedContext struct + Content string + NodesUsed int + TokensUsed int + TypeCounts map[string]int + type PageRank struct + func NewPageRank(store storage.Storage) *PageRank + func (pr *PageRank) Compute(ctx context.Context, limit int) ([]RankedNode, error) + type ProactiveContext struct + func NewProactiveContext(eng *Engine, search *HybridSearch) *ProactiveContext + func (p *ProactiveContext) Predict(ctx context.Context, project string, budget int) ([]*storage.Node, error) + type ProspectiveConfig struct + DefaultTTL time.Duration + Enabled bool + MaxActive int + TriggerThreshold float64 + func DefaultProspectiveConfig() ProspectiveConfig + type ProspectiveEngine struct + func NewProspectiveEngine(config ProspectiveConfig) *ProspectiveEngine + func (e *ProspectiveEngine) CheckTriggers(messageText string, messageEmbedding []float32) []*ProspectiveMemory + func (e *ProspectiveEngine) CleanExpired() int + func (e *ProspectiveEngine) Create(triggerCondition, action, sourceSession string, triggerEmbedding []float32, ...) *ProspectiveMemory + func (e *ProspectiveEngine) GetActive() []*ProspectiveMemory + type ProspectiveMemory struct + Action string + CreatedAt time.Time + ExpiresAt *time.Time + ID string + Priority float64 + SourceSession string + TriggerCondition string + TriggerEmbedding []float32 + TriggeredAt *time.Time + type QueryCache struct + func NewQueryCache(maxSize int, ttl time.Duration) *QueryCache + func (c *QueryCache) Clear() + func (c *QueryCache) Get(key string) *RecallResult + func (c *QueryCache) Invalidate() + func (c *QueryCache) Put(key string, result *RecallResult) + func (c *QueryCache) Stats() (size int, version uint64) + type QueryMetrics struct + Duration time.Duration + Query string + ResultCount int + SignalsUsed []string + WasUseful bool + type QueryPlan struct + BM25Limit int + GraphDepth int + Intent intent.Intent + TemporalOnly bool + UseBM25 bool + UseEntity bool + UseGraph bool + UseRecency bool + UseVector bool + type QueryPlanner struct + func NewQueryPlanner(nodeCount int, hasVectors, hasGraph bool) *QueryPlanner + func (qp *QueryPlanner) EstimateCardinality(query string) float64 + func (qp *QueryPlanner) Plan(query string, opts RecallOpts) QueryPlan + type QueryResult struct + Answer string + Confidence float64 + Sources []*storage.Node + type Quiz struct + func NewQuiz(store storage.Storage) *Quiz + func (q *Quiz) CheckAnswer(question QuizQuestion, answer string) bool + func (q *Quiz) Generate(ctx context.Context, count int) ([]QuizQuestion, error) + type QuizQuestion struct + Answer string + NodeID string + Question string + Type string + type QuizResult struct + Correct int + Score float64 + Total int + type RankedNode struct + Node *storage.Node + Score float64 + type RateLimiter struct + func NewRateLimiter(ratePerSec float64, maxBurst int) *RateLimiter + func (rl *RateLimiter) Allow() bool + func (rl *RateLimiter) Remaining() int + type RecallOpts struct + Budget int + Depth int + Limit int + Project string + Query string + Tier int + Type string + type RecallResult struct + Edges []*storage.Edge + Nodes []*storage.Node + type ReconsolidationConfig struct + Enabled bool + LabileWindow time.Duration + StrengthBonus float64 + func DefaultReconsolidationConfig() ReconsolidationConfig + type ReconsolidationEngine struct + func NewReconsolidationEngine(config ReconsolidationConfig) *ReconsolidationEngine + func (e *ReconsolidationEngine) Cleanup() int + func (e *ReconsolidationEngine) FlagContradiction(chunkID string) + func (e *ReconsolidationEngine) GetContradicted() []string + func (e *ReconsolidationEngine) IsLabile(chunkID string) bool + func (e *ReconsolidationEngine) OnRecall(chunkID string) + func (e *ReconsolidationEngine) Strengthen(chunkID string) float64 + type RememberInput struct + Agent string + Content string + Edges []EdgeInput + Key string + Pinned bool + Project string + Scope string + Session string + Summary string + Tags string + Tier int + TopicKey string + Type string + type ScoredNode struct + Node *storage.Node + Score float64 + func Rerank(ctx context.Context, nodes []*ScoredNode, store storage.Storage) []*ScoredNode + type ScoringConfig struct + BM25Weight float64 + EntityBoostCap float64 + GraphWeight float64 + MMRLambda float64 + RecencyWeight float64 + SpreadDecay float64 + VectorWeight float64 + func DefaultScoringConfig() ScoringConfig + type SessionHandoff struct + func NewSessionHandoff(store storage.Storage) *SessionHandoff + func (sh *SessionHandoff) FormatForInjection(summary *HandoffSummary) string + func (sh *SessionHandoff) Generate(ctx context.Context, sessionID string, duration time.Duration) (*HandoffSummary, error) + func (sh *SessionHandoff) GetLastSessionSummary(ctx context.Context, project string) string + type SomaticConfig struct + BoostThreshold float64 + Enabled bool + SkipThreshold float64 + func DefaultSomaticConfig() SomaticConfig + type SomaticEngine struct + func NewSomaticEngine(config SomaticConfig) *SomaticEngine + func (e *SomaticEngine) GetMarker(region string) *SomaticMarker + func (e *SomaticEngine) RecordOutcome(region string, success bool) + func (e *SomaticEngine) ShouldBoost(region string) bool + func (e *SomaticEngine) ShouldSkip(region string) bool + type SomaticMarker struct + Accesses int + Arousal float64 + Confidence float64 + Region string + Valence float64 + type SpacingConfig struct + CrammingPenalty float64 + MaxBonus float64 + OptimalInterval time.Duration + func DefaultSpacingConfig() SpacingConfig + type Sparsifier struct + func NewSparsifier(store storage.Storage) *Sparsifier + func (s *Sparsifier) Run(ctx context.Context) (*SparsifyResult, error) + type SparsifyResult struct + Compressed int + Merged int + Pruned int + type Status struct + Edges int + Nodes int + Sessions int + type SuggestedEdge struct + EdgeType string + FromID string + FromType string + Reason string + ToID string + ToType string + func SuggestLinks(ctx context.Context, store storage.Storage) ([]SuggestedEdge, error) + type SummarizedMemory struct + Content string + Type string + type TemplateMemory struct + Content string + Type string + type TemplateSet struct + Memories []TemplateMemory + Name string + Stack string + type Templates struct + func (t *Templates) Apply(ctx context.Context, eng *Engine, templateName string) (int, error) + func (t *Templates) Available() []TemplateSet + type TemporalEdge struct + Confidence float64 + Evidence string + RelationType string + SourceID string + TargetID string + ValidFrom *time.Time + ValidUntil *time.Time + func FilterActiveEdges(edges []*TemporalEdge, at time.Time) []*TemporalEdge + func FilterCurrentEdges(edges []*TemporalEdge) []*TemporalEdge + func (e *TemporalEdge) IsActiveAt(t time.Time) bool + func (e *TemporalEdge) IsCurrentlyActive() bool + type TemporalFilter struct + func NewTemporalFilter(store storage.Storage) *TemporalFilter + func (tf *TemporalFilter) ActiveEdges(ctx context.Context, nodeID string) ([]*storage.Edge, error) + func (tf *TemporalFilter) ChangedBetween(ctx context.Context, start, end time.Time, limit int) ([]*storage.Node, error) + func (tf *TemporalFilter) FilterByTime(ctx context.Context, nodes []*storage.Node, query TemporalQuery) []*storage.Node + func (tf *TemporalFilter) IsSuperseded(ctx context.Context, nodeID string) (bool, string) + func (tf *TemporalFilter) RecentSince(ctx context.Context, since time.Time, limit int) ([]*storage.Node, error) + type TemporalQuery struct + ActiveOnly bool + After time.Time + Before time.Time + type UserProfile struct + Patterns []string + Preferences map[string]string + UpdatedAt time.Time + type ZeigarnikChunk struct + ID string + Text string + type ZeigarnikConfig struct + DecayResistance float64 + Enabled bool + MinTextLength int + func DefaultZeigarnikConfig() ZeigarnikConfig + type ZeigarnikEngine struct + func NewZeigarnikEngine(config ZeigarnikConfig) *ZeigarnikEngine + func (e *ZeigarnikEngine) CloseLoop(chunkID string) + func (e *ZeigarnikEngine) DecayMultiplier(chunkID string) float64 + func (e *ZeigarnikEngine) GetActiveLoops(limit int) []*OpenLoop + func (e *ZeigarnikEngine) MarkOpenLoop(chunkID, context string) + func (e *ZeigarnikEngine) ScanChunks(chunks []ZeigarnikChunk) int