diff --git a/navi/config.py b/navi/config.py index 5b06595..38f48ce 100644 --- a/navi/config.py +++ b/navi/config.py @@ -59,7 +59,7 @@ # Context compression context_compression_enabled: bool = True context_compression_threshold: float = 0.80 # trigger at 80% of ollama_num_ctx - context_keep_recent: int = 10 # conversational turns to keep verbatim + context_keep_recent: int = 8 # conversational turns to keep verbatim context_summary_temperature: float = 0.3 # Global personality prompt prepended to every agent's system prompt. diff --git a/navi/core/compressor.py b/navi/core/compressor.py index 9560003..383ed7d 100644 --- a/navi/core/compressor.py +++ b/navi/core/compressor.py @@ -18,10 +18,12 @@ _SUMMARIZE_SYSTEM = ( "You are summarizing a conversation history to free up context space. " - "Produce a concise factual summary covering: key facts the user shared, " - "decisions made, tasks completed or in progress, important outputs or findings. " - "Use bullet points. Be brief — this summary replaces the conversation in context. " - "Do not include greetings or filler." + "Produce a structured factual summary covering: key facts the user shared, " + "decisions made, tasks completed or in progress, important outputs or findings, " + "any code or config snippets that were produced. " + "Use bullet points grouped by topic. Be thorough — capture enough detail that " + "the assistant can continue the conversation without the original messages. " + "Do not include greetings, filler, or meta-commentary about the summary itself." ) @@ -119,7 +121,7 @@ # Safety limit: truncate formatted input to this many characters before sending to LLM. # Prevents the summarizer from receiving near-context-sized input it can't fit alongside output. -_MAX_SUMMARY_INPUT_CHARS = 12_000 +_MAX_SUMMARY_INPUT_CHARS = 24_000 async def compress_context(