Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

refactor(agent): Colocate prompt with in-app agent code (#14483)

Ben Bachema011c10aa20f
diff --git a/packages/shared/scripts/seeder/seed-postgres.ts b/packages/shared/scripts/seeder/seed-postgres.ts
index 1ba94072ac..48ec152ada 100644
--- a/packages/shared/scripts/seeder/seed-postgres.ts
+++ b/packages/shared/scripts/seeder/seed-postgres.ts
@@ -47,7 +47,7 @@ const IN_APP_AGENT_SYSTEM_PROMPT_NAME = "in-app-agent-system-prompt";
const IN_APP_AGENT_SYSTEM_PROMPT_PATH = resolve(
__dirname,
"../../../..",
- "ee/src/in-app-agent/prompts/in-app-agent-system-prompt.txt",
+ "web/src/ee/features/in-app-agent/prompts/in-app-agent-system-prompt.txt",
);
const inAppAgentSystemPrompt = readFileSync(
diff --git a/scripts/in-app-agent/README.md b/scripts/in-app-agent/README.md
index 255ce6fcce..6c4d8502f8 100644
--- a/scripts/in-app-agent/README.md
+++ b/scripts/in-app-agent/README.md
@@ -2,7 +2,7 @@
The canonical system prompt for the in-app agent lives at:
-`ee/src/in-app-agent/prompts/in-app-agent-system-prompt.txt`
+`web/src/ee/features/in-app-agent/prompts/in-app-agent-system-prompt.txt`
The local Postgres seeder reads this file and creates the text prompt named
`in-app-agent-system-prompt` in the seed project
diff --git a/scripts/in-app-agent/sync-prompt.sh b/scripts/in-app-agent/sync-prompt.sh
index 5d0d734bad..8ade900a9f 100755
--- a/scripts/in-app-agent/sync-prompt.sh
+++ b/scripts/in-app-agent/sync-prompt.sh
@@ -3,7 +3,7 @@ set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(cd "${SCRIPT_DIR}/../.." && pwd)"
-PROMPT_FILE="${REPO_ROOT}/ee/src/in-app-agent/prompts/in-app-agent-system-prompt.txt"
+PROMPT_FILE="${REPO_ROOT}/web/src/ee/features/in-app-agent/prompts/in-app-agent-system-prompt.txt"
PROMPT_NAME="in-app-agent-system-prompt"
REGIONS=(STAGING EU US JP HIPAA)
BASE_URLS=(
diff --git a/ee/src/in-app-agent/prompts/in-app-agent-system-prompt.txt b/web/src/ee/features/in-app-agent/prompts/in-app-agent-system-prompt.txt
similarity index 100%
rename from ee/src/in-app-agent/prompts/in-app-agent-system-prompt.txt
rename to web/src/ee/features/in-app-agent/prompts/in-app-agent-system-prompt.txt
diff --git a/web/src/ee/features/in-app-agent/server/agent.ts b/web/src/ee/features/in-app-agent/server/agent.ts
index 2faa1bb5d6..c91d388047 100644
--- a/web/src/ee/features/in-app-agent/server/agent.ts
+++ b/web/src/ee/features/in-app-agent/server/agent.ts
@@ -27,8 +27,7 @@ const ASSISTANT_TITLE = "Langfuse Assistant";
const IN_APP_AGENT_SYSTEM_PROMPT_NAME = "in-app-agent-system-prompt";
const LOCAL_IN_APP_AGENT_SYSTEM_PROMPT_DIR = path.join(
process.cwd(),
- "..",
- "ee/src/in-app-agent/prompts/",
+ "src/ee/features/in-app-agent/prompts/",
);
const MAX_AGENT_STEPS = 10;
const LANGFUSE_DOCS_MCP_URL = "https://langfuse.com/api/mcp";