From 22ecb7cb393f4eeaaf0a031a14b5e4b9f961f1f6 Mon Sep 17 00:00:00 2001
From: Timothy Carambat <rambat1010@gmail.com>
Date: Fri, 23 Aug 2024 09:32:19 -0700
Subject: [PATCH] Add RAG agent plugin to API agent (#2171)

---
 server/utils/agents/ephemeral.js   | 5 +++++
 server/utils/boot/MetaGenerator.js | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/server/utils/agents/ephemeral.js b/server/utils/agents/ephemeral.js
index 831fa5032..a523780b4 100644
--- a/server/utils/agents/ephemeral.js
+++ b/server/utils/agents/ephemeral.js
@@ -188,6 +188,7 @@ class EphemeralAgentHandler extends AgentHandler {
     );
 
     this.#funcsToLoad = [
+      AgentPlugins.memory.name,
       AgentPlugins.docSummarizer.name,
       AgentPlugins.webScraping.name,
       ...(await agentSkillsFromSystemSettings()),
@@ -209,6 +210,10 @@ class EphemeralAgentHandler extends AgentHandler {
       model: this.model ?? "gpt-4o",
       chats: await this.#chatHistory(20),
       handlerProps: {
+        invocation: {
+          workspace: this.#workspace,
+          workspace_id: this.#workspace.id,
+        },
         log: this.log,
       },
     });
diff --git a/server/utils/boot/MetaGenerator.js b/server/utils/boot/MetaGenerator.js
index a8daeecbc..68cd2cbbe 100644
--- a/server/utils/boot/MetaGenerator.js
+++ b/server/utils/boot/MetaGenerator.js
@@ -166,7 +166,7 @@ class MetaGenerator {
   }
 
   async #fetchConfg() {
-    this.#log(`fetching custome meta tag settings...`);
+    this.#log(`fetching custom meta tag settings...`);
     const { SystemSettings } = require("../../models/systemSettings");
     const customTitle = await SystemSettings.getValueOrFallback(
       { label: "meta_page_title" },
-- 
GitLab