Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
fix vector_store_path duplication/inconsistency
Nick Sweetingdb54a6c8b3b1
diff --git a/browser_use/agent/memory/service.py b/browser_use/agent/memory/service.pyindex 7400f6da8..bbe7e6019 100644--- a/browser_use/agent/memory/service.py+++ b/browser_use/agent/memory/service.py@@ -57,7 +57,7 @@ class Memory:self.config.embedder_dims = 512else:# Ensure LLM instance is set in the config- self.config = config+ self.config = MemoryConfig(config) # re-validate user-provided configself.config.llm_instance = llm# Check for required packagesdiff --git a/browser_use/agent/memory/views.py b/browser_use/agent/memory/views.pyindex 1a24db613..fd1b3cb32 100644--- a/browser_use/agent/memory/views.py+++ b/browser_use/agent/memory/views.py@@ -7,7 +7,9 @@ from pydantic import BaseModel, ConfigDict, Fieldclass MemoryConfig(BaseModel):"""Configuration for procedural memory."""- model_config = ConfigDict(from_attributes=True, validate_default=True, revalidate_instances='always')+ model_config = ConfigDict(+ from_attributes=True, validate_default=True, revalidate_instances='always', validate_assignment=True+ )# Memory settingsagent_id: str = Field(default='browser_use_agent', min_length=1)@@ -24,7 +26,12 @@ class MemoryConfig(BaseModel):# Vector store settingsvector_store_provider: Literal['faiss'] = 'faiss'- vector_store_path: str = Field(default='/tmp/mem0_384_faiss')+ vector_store_base_path: str = Field(default='/tmp/mem0')++ @property+ def vector_store_path(self) -> str:+ """Returns the full vector store path for the current configuration. e.g. /tmp/mem0_384_faiss"""+ return f'{self.vector_store_base_path}_{self.embedder_dims}_{self.vector_store_provider}'@propertydef embedder_config_dict(self) -> dict[str, Any]:@@ -46,7 +53,7 @@ class MemoryConfig(BaseModel):'provider': self.vector_store_provider,'config': {'embedding_model_dims': self.embedder_dims,- 'path': f'{self.vector_store_path}_{self.embedder_dims}_faiss',+ 'path': self.vector_store_path,},}diff --git a/docs/customize/agent-settings.mdx b/docs/customize/agent-settings.mdxindex 898e91948..f512c5cdf 100644--- a/docs/customize/agent-settings.mdx+++ b/docs/customize/agent-settings.mdx@@ -293,7 +293,7 @@ The `MemoryConfig` model provides these configuration options:#### Vector Store Settings- `vector_store_provider`: Provider for vector storage (currently only `'faiss'` is supported)-- `vector_store_path`: Path for storing vector data+- `vector_store_base_path`: Path for storing vector data (e.g. /tmp/mem0)The model automatically sets appropriate defaults based on the LLM being used:- For `ChatOpenAI`: Uses OpenAI's `text-embedding-3-small` embeddings