Bugfix: Should the extraction LLM receive the enriched prompt or the...

Documentation for Sessions

🐛 Bugfix: Should the extraction LLM receive the enriched prompt or the...

Date: 2026-02-11
Time: 23:01:37 UTC
Session: gspace1-106.14
Agent: backend
Confidence: 98%
Status: ✅ Documented


📋 Decision Context

Question:

Should the extraction LLM receive the enriched prompt or the raw user message?

Task: Fix memory extraction reliability — extraction was getting polluted input


🎯 Decision Made

Chosen:

Raw user message only — frontends must send rawUserMessage field alongside enriched prompt

Options Considered:

  1. Send enriched prompt (contains system instructions + history)
  2. Send raw user message only
  3. Try to strip system prompt from enriched prompt on backend

💭 Reasoning

The enriched prompt contains 500+ tokens of system instructions, persona guidance, memory context, and conversation history — all prepended to the actual user message. When this entire blob is sent to the extraction LLM as 'the user message', the LLM can't reliably distinguish user-stated facts from system instructions. It frequently returned [] because the signal-to-noise ratio was too low. The fix: a new rawUserMessage field in the HTTP request carries the clean user input. The controller passes this to ChatService, which uses it exclusively for extraction. This is a simple, reliable solution that doesn't require prompt parsing on the backend.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation