Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ logs/

# Go
vendor/
agent-memory-mcp-new
8 changes: 8 additions & 0 deletions internal/memory/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@ func (ms *Store) Recall(ctx context.Context, query string, filters Filters, limi
continue
}

// Superseded entries (temporal replacement, e.g. after a merge) are
// invisible to semantic recall — the successor carries the current
// knowledge. Kept in the DB for temporal history; List/ListLightweight
// still return them for maintenance tools.
if m.SupersededBy != "" {
continue
}

// T48 layer-aware filtering: when the flag is on, surface memories
// are invisible outside their originating Context. This prevents
// session scratch state from leaking into unrelated recall calls.
Expand Down
4 changes: 1 addition & 3 deletions internal/rag/documents.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,7 @@ func classifySourceType(docPath string, title string, content string) string {
return "k8s"
}
case ext == ".md":
if baseLower == "readme.md" || strings.HasPrefix(pathLower, "docs/") || strings.Contains(pathLower, "/docs/") || strings.Contains(contentLower, "# ") {
return "docs"
}
return "docs"
case ext == ".yaml" || ext == ".yml":
if strings.Contains(contentLower, "apiVersion:") && strings.Contains(contentLower, "kind:") {
return "k8s"
Expand Down
2 changes: 2 additions & 0 deletions internal/rag/rag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,8 @@ func TestClassifySourceType(t *testing.T) {
{path: "k8s/ingress.yaml", want: "k8s"},
{path: "dead_ends/why-we-avoid-async-migration.md", want: "dead_end"},
{path: "notes/why-we-avoid-shared-mutable-state.md", want: "dead_end"},
{path: "knowledge/mahoo-architecture.md", want: "docs"},
{path: "plans/analysis.md", want: "docs"},
}

for _, tc := range tests {
Expand Down