Error adding and searching short_term and entities memory

Hi, I am trying to use the crewai’s in-built memory feature but it is giving me an error while adding and searching.

Crewai version: 0.86.0
OS: Windows 11
pyhton: 3.12.6

    @crew
def crew(self) -> Crew:
    return Crew(
        agents=self.agents,
        tasks=self.tasks,
        manager_llm=LLM(temperature=0, model="claude-3-haiku-20240307"),
        process=Process.hierarchical,
        memory=True,
        verbose=True
    )

ERROR:root:Error during short_term save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body' 

ERROR:root:Error during short_term search: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities search: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'

Can you share more of your code? Also if you could add the full error message.

Kindly find my code for the tasks below.

import os

from crewai import Agent,Crew,Process,Task,LLM
from crewai.project import CrewBase, agent, crew, task

from src.types import Summaries, ActionItems, FollowUps, Ideas

@CrewBase
class Insights:

    agents_config = 'config/agents.yaml'
    tasks_config = 'config/tasks.yaml'

    @agent
    def meeting_summarizer(self) -> Agent:
        return Agent(
            config=self.agents_config['meeting_summarizer'],
            verbose=True
        )

    @agent
    def meeting_note_taker(self ) -> Agent:
        return Agent(
            config=self.agents_config['meeting_note_taker'],
            verbose=True
        )

    @agent
    def meeting_analyzer(self ) -> Agent:
        return Agent(
            config=self.agents_config['meeting_analyzer'],
            verbose=True,
        )

    @agent
    def meeting_follower(self ) -> Agent:
        return Agent(
            config=self.agents_config['meeting_follower'],
            verbose=True
        )

    @agent
    def meeting_ideas(self) -> Agent:
        return Agent(
            config=self.agents_config['meeting_ideas'],
            verbose=True
        )

    @task
    def summarize_meeting(self) -> Task:
        return Task(
            config=self.tasks_config['summarize_meeting'],
            output_json=Summaries,
            #async_execution=True,
        )

    @task
    def analyze_notes(self) -> Task:
        return Task(
            config=self.tasks_config['analyze_notes'],
            #async_execution=True
        )

    @task
    def analyze_action_items(self) -> Task:
        return Task(
            config=self.tasks_config['analyze_action_items'],
            output_json=ActionItems,
            #async_execution=True
        )

    @task
    def analyze_followup(self) -> Task:
        return Task(
            config=self.tasks_config['analyze_followup'],
            output_json=FollowUps,
            #async_execution=True
        )

    @task
    def analyze_ideas(self) -> Task:
        return Task(
            config=self.tasks_config['analyze_ideas'],
            output_json=Ideas,
        )

    @crew
    def crew(self) -> Crew:
        return Crew(
            agents=self.agents,
            tasks=self.tasks,
            manager_llm=LLM(temperature=0, model="claude-3-haiku-20240307"),
            process=Process.hierarchical,
            memory=True,
            verbose=True
        )

I do not get any more errors. I receive below before a task starts

    ERROR:root:Error during short_term search: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
    ERROR:root:Error during entities search: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'

I receive below after a task has completed

ERROR:root:Error during short_term save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'
ERROR:root:Error during entities save: APIStatusError.__init__() missing 2 required keyword-only arguments: 'response' and 'body'

This issue has been reported in the Github as well. I tried with the latest version 0.95.0 but it made no difference.

I have successfully resolved the issue I was encountering.

The resolution involved adding credits to my OpenAI account. Following this, both short-term and entity memory functionalities began to operate as expected.

I was aware Crewai memory, by default, used OpenAI embeddings. However, the documentation did not explicitly state the requirement of OpenAI credits for the memory feature to function correctly.

I am now able to observe data being populated within both my entity and short-term memory.

It would be beneficial if Crewai could return a low credit error more explicitly when this is the root cause of an issue.

Really good idea on returning the exception error. Will relay.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.