From 30e860c38e27842ca1a49ce7b7184334b044f5a3 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 2 May 2026 19:58:43 +0100 Subject: [PATCH] Bias local retrieval toward Discord history --- packages/providers/src/local-llm-render.ts | 2 ++ packages/providers/src/local-llm-tools.ts | 4 ++-- state/evidence.jsonl | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/providers/src/local-llm-render.ts b/packages/providers/src/local-llm-render.ts index 89ee48e..4171c83 100644 --- a/packages/providers/src/local-llm-render.ts +++ b/packages/providers/src/local-llm-render.ts @@ -28,6 +28,8 @@ export function buildSystemPrompt(context: ContextBundle): string { "Treat the attached interaction memory as a non-clinical behavioral read, not a diagnosis. Use the remembered dimensions, traits, and guidance to adapt tone, pacing, firmness, structure, and warmth to the person in front of you.", "Be steady with anxious or validation-seeking speakers, grounding with grandiose ones, transparent with suspicious ones, structured with rigid or obsessive ones, and firmer with controlling, contemptuous, or boundary-pushing ones.", "When the answer depends on archived Discord history or indexed repo/lore context, use the available read-only tools instead of guessing.", + "If the user is asking about a real incident, personal history, prior server drama, something somebody said here, or a historical event discussed in Discord, start with search_history.", + "Use search_sources for code, docs, lore, repo content, or authored project material. Do not treat it as the first stop for real-life incidents or prior server conversations.", "If you need to target a specific indexed repo and do not know the valid repo names yet, call list_indexed_repos before search_sources.", renderSourceGroundingInstructions(context, false), "Do not claim to have performed searches or tool calls beyond the material actually executed in this run.", diff --git a/packages/providers/src/local-llm-tools.ts b/packages/providers/src/local-llm-tools.ts index 24c30ba..4e3f38c 100644 --- a/packages/providers/src/local-llm-tools.ts +++ b/packages/providers/src/local-llm-tools.ts @@ -22,7 +22,7 @@ export function buildToolDefinitions(): OllamaToolCallDefinition[] { function: { name: "search_history", description: - "Search archived Discord history for prior conversations, decisions, preferences, and discussion fragments.", + "Search archived Discord history for prior conversations, real incidents, personal stories, decisions, preferences, relationship history, and discussion fragments from the server.", parameters: { type: "object", required: ["query"], @@ -78,7 +78,7 @@ export function buildToolDefinitions(): OllamaToolCallDefinition[] { function: { name: "search_sources", description: - "Search indexed source trees and lore repositories for code, documentation, and lore passages. Omit repoName to search across all indexed repos, or call list_indexed_repos first if you need valid repo names.", + "Search indexed source trees and lore repositories for code, documentation, authored worldbuilding, and project material. Use this for repo/lore questions, not as the first stop for real-life incidents or prior Discord conversations. Omit repoName to search across all indexed repos, or call list_indexed_repos first if you need valid repo names.", parameters: { type: "object", required: ["query"], diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 2f54995..834176e 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -20,3 +20,5 @@ {"ts":"2026-05-02T17:34:02Z","type":"implementation","status":"ok","note":"Layered private system message catalogs over the tracked base, deferred slow slash replies before provider execution, and chunked Discord output so missing keys and overlong local_llm replies stop failing live interactions."} {"ts":"2026-05-02T17:39:46Z","type":"implementation","status":"ok","note":"Source-grounding alias matching now ignores overly short repo components so social prompts mentioning Void stop tripping fake repo-evidence requirements, and direct messages intentionally count as prompts without requiring a mention."} {"ts":"2026-05-02T18:28:04Z","type":"implementation","status":"ok","note":"Pinned the owner Codex lane to a configurable CODEX_MODEL defaulting to gpt-5.4 because the local CLI still faceplants on gpt-5.5, and relaxed source-grounding from a lexical hard gate into an advisory hint so the model can decide when repo/lore tool use is actually needed."} +{"ts":"2026-05-02T18:41:02Z","type":"bugfix","status":"ok","note":"Direct local_llm replies could emit raw JSON/tool payload fragments as final Discord answers; added structured-output rewrite guard and audit output previews for direct provider responses."} +{"ts":"2026-05-02T18:58:38Z","type":"bugfix","status":"ok","note":"Local LLM could choose search_sources for real-life incident questions and get Ghostlight narrative hits; prompt/tool guidance now biases prior server drama and personal-history questions toward search_history before repo/lore search."}