diff --git a/example/dummy_agent.ts b/example/dummy_agent.ts index 9069738..4f44399 100644 --- a/example/dummy_agent.ts +++ b/example/dummy_agent.ts @@ -1,6 +1,5 @@ import { DummyLLM } from "../src/llm"; import { Tool } from "../src/tools/tool"; -import { Memory, SimpleMemory } from "../src/memory"; import { Workflow } from "../src/workflow"; import { Agent } from "../src/agent"; @@ -17,9 +16,8 @@ async function runDummyAgent() { const llm = new DummyLLM(); const echoTool: Tool = new EchoTool(); // Explicitly type echoTool const tools: Tool[] = [echoTool]; - const memory = new SimpleMemory(); - const workflow = new Workflow({ llm, tools, memory }); - const agent = new Agent({ llm, tools, memory }); + const workflow = new Workflow({ llm }); + const agent = new Agent({ llm, tools }); const inputs = [ "Hello, Quicksilver!", diff --git a/example/ioid_agent.ts b/example/ioid_agent.ts index f3e8113..52fc203 100644 --- a/example/ioid_agent.ts +++ b/example/ioid_agent.ts @@ -1,7 +1,6 @@ import { OpenAILLM, LLM } from "../src/llm"; import { IoIDTool } from "../src/tools/ioId"; import { Agent } from "../src/agent"; -import { SimpleMemory } from "../src/memory"; import { Tool } from "../src/tools/tool"; import * as dotenv from "dotenv"; @@ -17,11 +16,10 @@ async function runExample() { const llm: LLM = new OpenAILLM(apiKey, "gpt-4"); // Use "gpt-3.5-turbo" for cost-effectiveness if needed - // Initialize tools, memory, and agent + // Initialize tools, and agent const ioidTool = new IoIDTool(); const tools: Tool[] = [ioidTool]; - const memory = new SimpleMemory(); - const agent = new Agent({ llm, tools, memory }); + const agent = new Agent({ llm, tools }); // User inputs to process const inputs = [ diff --git a/src/index.ts b/src/index.ts index 2e7b72d..4609c9a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,7 +6,6 @@ import { } from "./tools/weatherapi"; import { NewsAPITool } from "./tools/newsapi"; import { Agent } from "./agent"; -import { SimpleMemory } from "./memory"; import { Tool } from "./tools/tool"; import * as dotenv from "dotenv"; diff --git a/src/memory.ts b/src/memory.ts index a1db4cc..7df62b5 100644 --- a/src/memory.ts +++ b/src/memory.ts @@ -4,18 +4,3 @@ export interface Memory { clear(): void; } -export class SimpleMemory implements Memory { - private memory: { input: string; output: string }[] = []; - - loadMemoryVariables(): Record { - return { history: this.memory }; - } - - saveContext(input: string, output: string): void { - this.memory.push({ input, output }); - } - - clear(): void { - this.memory = []; - } -} \ No newline at end of file diff --git a/src/workflow.ts b/src/workflow.ts index f533fe3..9827bcc 100644 --- a/src/workflow.ts +++ b/src/workflow.ts @@ -55,7 +55,6 @@ export class Workflow { console.log({ toolOutput }); // FEED TOOL OUTPUT BACK TO LLM - // Previous Conversation: ${JSON.stringify(this.memory.loadMemoryVariables().history)} const finalPrompt = this.agent.prompt({ input, tool: action.tool, @@ -67,8 +66,6 @@ export class Workflow { output = action.output; // LLM handles it directly (no tool used) } - // this.memory.saveContext(input, output); - return output; } catch (error) { console.error("Workflow Error:", error);