Extraction: system+user split with explicit SAVE/DON'T SAVE rules,
few-shot examples, stricter JSON-only format. Min fact length 15 chars.
System prompt: model now knows about its 3-level memory, how to use
recalled facts, and that user can control memory via chat commands.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Before inserting, check if a near-identical memory exists (cosine > 0.85).
If found, skip insert. Prevents flooding the DB with repeated facts
from the same conversation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Open WebUI sends the proxy model name to our endpoint; passing it
directly to Ollama caused 404. Now stripped before forwarding.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
DB saves were happening inside the generator after [DONE], causing
connection abort if any await failed. Moved to BackgroundTask.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Open WebUI requires this endpoint to discover and list available models
from OpenAI-compatible connections.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>