feat(agent): auto compact — proactive session compression to reduce token cost and latency (#2982)

When a user is idle for longer than a configured TTL, nanobot **proactively** compresses the session context into a summary. This reduces token cost and first-token latency when the user returns — instead of re-processing a long stale context with an expired KV cache, the model receives a compact summary and fresh input.
This commit is contained in:
chengyongru
2026-04-11 15:56:41 +08:00
committed by Xubin Ren
parent e392c27f7e
commit fb6dd111e1
10 changed files with 1091 additions and 7 deletions
+1
View File
@@ -82,6 +82,7 @@ class Nanobot:
mcp_servers=config.tools.mcp_servers,
timezone=defaults.timezone,
unified_session=defaults.unified_session,
session_ttl_minutes=defaults.session_ttl_minutes,
)
return cls(loop)