Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Python agentaianthropicclaude-codecompressioncontext-engineeringcontext-windowcursorfastapilangchainllmmcpopenaiprompt-engineeringproxypythonragtoken-optimizationtokenstypescript
test(memory): update _extract_user_query test to lock no-truncation
chopratejas67620522f9b8
diff --git a/tests/test_memory_handler_native_ops.py b/tests/test_memory_handler_native_ops.pyindex 44f687969..497227fa5 100644--- a/tests/test_memory_handler_native_ops.py+++ b/tests/test_memory_handler_native_ops.py@@ -842,7 +842,11 @@ def test_inject_tools_extract_query_and_has_tool_calls(assert existing == [{"function": {"name": "memory_save"}}]assert handler._extract_user_query([{"role": "assistant", "content": "skip"}]) == ""- assert handler._extract_user_query([{"role": "user", "content": "x" * 600}]) == "x" * 500+ # Pre-PR-this method truncated at 500 chars; that was a real bug+ # (none of Letta / Mem0 / Cognee / Supermemory truncate the+ # retrieval query). Now returns the full message — embedder+ # handles its own context window. See ``MemoryQuery``.+ assert handler._extract_user_query([{"role": "user", "content": "x" * 600}]) == "x" * 600assert (handler._extract_user_query([{"role": "user", "content": [{"type": "text", "text": "hello"}, {"type": "image"}]}]