agents: surface search hit counts to guide keep/demote decisions
Nodes actively found by search now show "Search hits: N ← actively found by search, prefer to keep" in both the node section (seen by extractor, linker, etc.) and rename candidate listings. Extractor and rename prompts updated to respect this signal — merge into high-hit nodes rather than demoting them, skip renaming nodes that are working well in search.
This commit is contained in:
parent
7a3ce4f17d
commit
de204e3075
3 changed files with 16 additions and 0 deletions
|
|
@ -110,6 +110,9 @@ New node keys should be descriptive: `skills#bcachefs-assert-triage`,
|
|||
nodes. Make existing ones better rather than adding more.
|
||||
- **DEMOTE aggressively.** If a node's useful content is now captured
|
||||
in a better node, demote it. This is how the graph gets cleaner.
|
||||
- **Respect search hits.** Nodes marked "actively found by search" are
|
||||
being retrieved in live queries. Prefer to keep these — merge *into*
|
||||
them rather than demoting them.
|
||||
- **Don't force it.** If the neighborhood is already well-organized,
|
||||
say so. "This neighborhood is clean — no changes needed" is a
|
||||
valid output. Don't produce filler.
|
||||
|
|
|
|||
|
|
@ -51,5 +51,8 @@ If a node already has a reasonable name, skip it.
|
|||
- **Don't rename to something longer than the original.**
|
||||
- **Preserve the date.** Always keep YYYY-MM-DD.
|
||||
- **When in doubt, skip.** A bad rename is worse than an auto-slug.
|
||||
- **Respect search hits.** Nodes marked "actively found by search" are
|
||||
being retrieved by their current name. Skip these unless the rename
|
||||
clearly preserves searchability.
|
||||
|
||||
{{rename}}
|
||||
|
|
|
|||
|
|
@ -114,6 +114,11 @@ pub fn format_nodes_section(store: &Store, items: &[ReplayItem], graph: &Graph)
|
|||
}
|
||||
out.push('\n');
|
||||
|
||||
let hits = crate::counters::search_hit_count(&item.key);
|
||||
if hits > 0 {
|
||||
out.push_str(&format!("Search hits: {} ← actively found by search, prefer to keep\n", hits));
|
||||
}
|
||||
|
||||
// Content (truncated for large nodes)
|
||||
let content = &node.content;
|
||||
if content.len() > 1500 {
|
||||
|
|
@ -306,6 +311,11 @@ pub fn format_rename_candidates(store: &Store, count: usize) -> (Vec<String>, St
|
|||
};
|
||||
out.push_str(&format!("Created: {}\n", created));
|
||||
|
||||
let hits = hit_map.get(key).copied().unwrap_or(0);
|
||||
if hits > 0 {
|
||||
out.push_str(&format!("Search hits: {} ← actively found by search, prefer to keep current name\n", hits));
|
||||
}
|
||||
|
||||
let content = &node.content;
|
||||
if content.len() > 800 {
|
||||
let truncated = crate::util::truncate(content, 800, "\n[...]");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue