From 22fe1ee6bf4f945fc58f7f2d44f4d93b90870bc6 Mon Sep 17 00:00:00 2001 From: Bruno Skvorc Date: Wed, 5 Feb 2025 21:26:46 +0100 Subject: [PATCH] Added cachedir to filesystem cache --- .env.example | 1 + agent/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 5784fb517e1e..802584fefc76 100644 --- a/.env.example +++ b/.env.example @@ -4,6 +4,7 @@ # Cache Configs CACHE_STORE=database # Defaults to database. Other available cache store: redis and filesystem +CACHE_DIR=./data/cache # Directory to store the cache files if using filesystem cache REDIS_URL= # Redis URL - could be a local redis instance or cloud hosted redis. Also support rediss:// URLs PGLITE_DATA_DIR= #../pgLite/ if selecting a directory --- or memory:// if selecting in memory diff --git a/agent/src/index.ts b/agent/src/index.ts index 1ded5914eb04..8da1c3c375a8 100644 --- a/agent/src/index.ts +++ b/agent/src/index.ts @@ -1411,7 +1411,7 @@ async function startAgent( const cache = initializeCache( process.env.CACHE_STORE ?? CacheStore.DATABASE, character, - "", + process.env.CACHE_DIR ?? "", db ); // "" should be replaced with dir for file system caching. THOUGHTS: might probably make this into an env const runtime: AgentRuntime = await createAgent(