Summary
I’m developing a multi-agent audit system using CrewAI, where one agent validates transaction dates via a custom tool.
The transaction dates and current date are passed dynamically at runtime via the CLI.
However, CrewAI agents ignore these runtime values and instead behave as if using previous inputs —
even after all known cache and memory reset techniques are applied.
Without changing the code or the data:
- The agent sometimes receives ** incorrect transaction dates** .
- The agent sometimes uses old values of
current_date
.(current_date basically describes that day’s date) - These dates do not match the actual values passed at runtime through the
kickoff(inputs={...})
call. - In
main.py
, bothtransaction_dates
andcurrent_date
are passed correctly into the.kickoff()
method. Print statements confirm that these values are intact when received increw.py
. However, when the agent invokes the custom tool, the dates received inside the tool’s_run()
method are incorrect or appear to be from a previous run, suggesting unexpected caching or memory persistence. - Even after resetting memory and deleting all storage folders, the issue randomly reoccurs.
What Should Happen
Every time the system runs:
- The
transaction_dates
andcurrent_date
passed into.kickoff()
should be the only values used. - The custom tool should only validate against these passed values.
- There should be no memory of prior runs, prior templates, or previously cached inputs.
What I’ve Already Tried
Memory Reset
crewai reset-memories --all
my_crew.reset_memories(command_type=“all”) (in code)
Manual Folder Cleanup
Deleted crewai_storage/knowledge, short_term/, entities/, *.db files
Deleted all pycache folders
Renamed the tool
Changed class name to DateVerificationTool_Fresh to force reinitialization
UUID Injection Debugging
Added UUID to transaction_dates to detect if wrong values were used
Confirmed ghost values were still making it to the tool.
Key Questions
-
Are there any other memory/cache mechanisms CrewAI might use outside of CREWAI_STORAGE_DIR?
2.Could embeddings or internal caching override or ignore inputs passed to kickoff()?
3,Are .yaml task files fully reloaded on every run, or cached somehow?
4.Is there a way to force a fresh parse of every .yaml and custom tool on every run?
5.Could some background memory from an LLM agent interfere even if memory=True is not set?CODE
I am passing a kickoff method like this :
result = CrewaiFaudit().crew().kickoff(inputs={
“input_data”: data,
“transaction_dates”: transaction_dates_list,
“date”:data[“date”]
})
where i am giving transaction_dates and date as inputs for an agent and input_data as an input for another agent . i wrapped all the keys in {{ }} . the agent whose input is given {{ input_data }} is correctly able to pick the data in input_data and the other agent who i gave the other two keys (basically keys) are not picking the data correctly .
data consists of a dictionary like below : {
“opening_balance”: ob,
“sanctioned_funds”: sf,
“closing_balance”: cb,
“transactions”: txns,
“date”: date
}
and transaction_dates_list = [txn[“Date”] for txn in data[“transactions”]] and date is date = datetime.now().strftime(“%Y-%m-%d”)
an example of how the data disctionary is:
{
“opening_balance”: 1000.0,
“sanctioned_funds”: 2000.0,
“closing_balance”: 2150.0,
“transactions”: [
{
“Date”: “2025-04-30”,
“Description”: “Opening Balance”,
“Amount”: 1000.0,
“Balance”: 1000.0
},
{
“Date”: “2025-05-01”,
“Description”: “Salary”,
“Amount”: 2000.0,
“Balance”: 3000.0
},
{
“Date”: “2025-05-03”,
“Description”: “Rent”,
“Amount”: -800.0,
“Balance”: 2200.0
},
{
“Date”: “2025-05-05”,
“Description”: “Grocery”,
“Amount”: -150.0,
“Balance”: 2050.0
},
{
“Date”: “2025-05-10”,
“Description”: “Transfer In”,
“Amount”: 300.0,
“Balance”: 2350.0
},
{
“Date”: “2025-05-15”,
“Description”: “Utilities”,
“Amount”: -200.0,
“Balance”: 2150.0
}
],
“date”: “2025-04-24”
}
Please help me here . i am stuck at this for a couple of days