Initial implementation of compaction MCP server

Ephemeral, per-session context management for LLMs with 8 MCP tools:
store, query, status, compact, pin, forget, configure, update.

Features: scoring with decay/importance/access, Jaccard dedup,
summary promotion, budget-based eviction, auto-detection of
client context window via MCP hooks.
This commit is contained in:
2026-03-07 16:57:12 +00:00
commit 0ddd0e4598
8 changed files with 1050 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
package main
// EstimateTokens returns a rough token count for a string.
// Uses ~4 characters per token heuristic.
func EstimateTokens(s string) int {
if len(s) == 0 {
return 0
}
return (len(s) + 3) / 4
}