From 77ba8aa77118e7f0335f7be7ef2188b72aaffaaf Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Tue, 16 Jun 2026 23:31:59 +0200 Subject: [PATCH] Refactor local knowledge context API endpoint and update agent reason string --- backend/agent/router.py | 2 +- src/chatApi.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/agent/router.py b/backend/agent/router.py index 7d1c662..d5548b0 100644 --- a/backend/agent/router.py +++ b/backend/agent/router.py @@ -154,7 +154,7 @@ def _fast_path( if library_slug and mentions_knowledge: knowledge = _manifest_by_slug(manifests, "knowledge-answer") if knowledge: - return _workflow_result(knowledge, confidence=0.95, reason="The request explicitly refers to the selected knowledge database.") + return _workflow_result(knowledge, confidence=0.95, reason="The request explicitly refers to local knowledge.") if _GREETING_RE.match(text): direct = _manifest_by_slug(manifests, "input-output") diff --git a/src/chatApi.js b/src/chatApi.js index 80f7a00..3b2e138 100644 --- a/src/chatApi.js +++ b/src/chatApi.js @@ -18,10 +18,8 @@ export async function prepareStartupModels(apiBase) { return expectBackendJson(response) } -export async function fetchLocalLibraryContext(apiBase, slug, prompt, signal) { - if (!slug) return { contextBlock: null, sources: [] } - - const response = await fetch(`${apiBase}/libraries/${slug}/context`, { +export async function fetchLocalLibraryContext(apiBase, prompt, signal) { + const response = await fetch(`${apiBase}/knowledge/context`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, signal,