Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

Increase MAX_MEMORY_LENGTH from 1000 to 10000 chars

Magnus Müller3ba50e68b097
diff --git a/browser_use/tools/service.py b/browser_use/tools/service.py
index 7abfae684..0f0eba4d0 100644
--- a/browser_use/tools/service.py
+++ b/browser_use/tools/service.py
@@ -767,7 +767,7 @@ You will be given a query and the markdown of a webpage that has been filtered t
)
# Simple memory handling
- MAX_MEMORY_LENGTH = 1000
+ MAX_MEMORY_LENGTH = 10000
if len(extracted_content) < MAX_MEMORY_LENGTH:
memory = extracted_content
include_extracted_content_only_once = False
@@ -1183,7 +1183,7 @@ Validated Code (after quote fixing):
# Memory handling: keep full result in extracted_content for current step,
# but use truncated version in long_term_memory if too large
- MAX_MEMORY_LENGTH = 1000
+ MAX_MEMORY_LENGTH = 10000
if len(result_text) < MAX_MEMORY_LENGTH:
memory = result_text
include_extracted_content_only_once = False