agent-zero icon indicating copy to clipboard operation
agent-zero copied to clipboard

Red Error when searching memory

Open rejavarti opened this issue 5 months ago • 2 comments

Good Afternoon/Evening,

I have been using this for a bit, and have recently been getting many errors popping up, all of them are showing the same error, sometimes it will go away for a bit, then re-surface

Traceback (most recent call last): Traceback (most recent call last): File "/a0/agent.py", line 323, in monologue prompt = await self.prepare_prompt(loop_data=self.loop_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/a0/agent.py", line 411, in prepare_prompt await self.call_extensions("message_loop_prompts_after", loop_data=loop_data) File "/a0/agent.py", line 831, in call_extensions await cls(agent=self).execute(**kwargs) File "/a0/python/extensions/message_loop_prompts_after/_91_recall_wait.py", line 13, in execute await task File "/usr/lib/python3.12/asyncio/futures.py", line 289, in await yield self # This tells Task to wait for completion. ^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/tasks.py", line 385, in __wakeup future.result() File "/usr/lib/python3.12/asyncio/futures.py", line 202, in result raise self._exception.with_traceback(self._exception_tb) File "/usr/lib/python3.12/asyncio/tasks.py", line 316, in __step_run_and_handle_result result = coro.throw(exc) ^^^^^^^^^^^^^^^ File "/a0/python/extensions/message_loop_prompts_after/_50_recall_memories.py", line 69, in search_memories memories = await db.search_similarity_threshold( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/a0/python/helpers/memory.py", line 305, in search_similarity_threshold return await self.db.asearch( ^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/langchain_core/vectorstores/base.py", line 380, in asearch query, **kwargs

File "/opt/venv/lib/python3.12/site-packages/langchain_core/vectorstores/base.py", line 603, in asimilarity_search_with_relevance_scores score_threshold = kwargs.pop("score_threshold", None) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

12 stack lines skipped <<<

File "/usr/lib/python3.12/asyncio/futures.py", line 289, in await yield self # This tells Task to wait for completion. ^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/tasks.py", line 385, in __wakeup future.result() File "/usr/lib/python3.12/asyncio/futures.py", line 202, in result raise self._exception.with_traceback(self._exception_tb) File "/usr/lib/python3.12/concurrent/futures/thread.py", line 59, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/langchain_core/runnables/config.py", line 613, in wrapper raise RuntimeError from exc ^^^^^^^^^^^^^^^^^^^^^ File "/opt/venv/lib/python3.12/site-packages/langchain_community/vectorstores/faiss.py", line 427, in similarity_search_with_score_by_vector _id = self.index_to_docstore_id[i] ~~~~~~~~~~~~~~~~~~~~~~~~~^^^ KeyError: 3687

KeyError: 3687

I have re-installed Agent-Zero, had the system clear memory and check for issues, and it is still popping up, just wondering a direction

Checking for codebase and environment mismatches Clearing all cached embeddings for a truly fresh memory state Checking for any remaining or hidden memory files Clearing all memory and starting fresh Upgrading FAISS and LangChain to latest versions Memory fully cleared and ready for fresh use Checking and deleting FAISS index and docstore files again FAISS memory index and docstore deleted—system will rebuild on next use

rejavarti avatar Jul 22 '25 23:07 rejavarti

I have the same problem

kwisser avatar Aug 11 '25 08:08 kwisser

Same error that appear randomly even with version 0.9.6.

Sometimes a second prompt, in the current or in a new chat, with just an "hello" fix it.

PowZone avatar Oct 29 '25 11:10 PowZone

Image

Stupidoldguy avatar Dec 01 '25 20:12 Stupidoldguy

This error comes from invalid utility LLM response. We can mitigate that. What models and providers are you using for utility model?

frdel avatar Dec 02 '25 05:12 frdel

Hi there!

Same error here. Using Venice.ai

otronomo avatar Dec 16 '25 12:12 otronomo