I am encountering a agno.exceptions.ModelProviderError
when using a language model (likely OpenAI) with the agno
library. The error occurs during the _process_model_response
step, specifically when the model seems to be invoking a function called add_memory
.
The traceback indicates an “Invalid schema for function ‘add_memory’” with the specific detail: “In context=(‘properties’, ‘topics’), schema must have a ‘type’ key.”
This suggests that the schema being provided to the language model for the add_memory
function (or a function that internally uses it) is missing a crucial 'type'
key within the definition of the 'topics'
property. The 'topics'
property is likely intended to be a list of strings associated with a memory item, as seen in the agno.memory.v2.memory.UserMemory
class definition.
Context:
I am using the agno
library to build AI agents and teams. The error seems to be related to the memory management capabilities, possibly when using the ReasoningTools
or another tool that interacts with the agent’s memory. I am using PostgreSQL as the backend for memory and storage via agno.memory.v2.db.postgres.PostgresMemoryDb
and agno.storage.postgres.PostgresStorage
.
Troubleshooting Steps Taken:
- I have verified that my PostgreSQL database is running and accessible.
- I have reviewed my
CONFIG
class and the setup for database connection. - I have examined the definitions of the
Memory
andUserMemory
classes inagno
. - I have looked at the
Team
andOpenAIChat
class definitions but haven’t found any direct parameters to influence the schema generation for tool functions.
Expected Behavior:
The add_memory
function should be invoked successfully by the language model without a schema validation error. The ‘topics’ associated with a memory should be correctly handled by the underlying memory management system.
Request for Assistance:
Has anyone else encountered this specific ModelProviderError
related to the add_memory
function and the missing 'type'
key for the ‘topics’ schema? Any insights into where this schema is defined within the agno
library (specifically within the ReasoningTools
or tool integration logic) and how to resolve this issue would be greatly appreciated.
Could there be a specific configuration or version of agno
or its dependencies that might be contributing to this problem? Found the error was coming from the crawl4ai which technically have not being updated. I just found the error.
Thank you for any help you can provide!