feat(memory-islands): LLM-driven folder-scoped fact extraction (v0.2.0) - #15
Open
skorphil wants to merge 10 commits into
Open
feat(memory-islands): LLM-driven folder-scoped fact extraction (v0.2.0)#15skorphil wants to merge 10 commits into
skorphil wants to merge 10 commits into
Conversation
…and OWUI compatibility fixes
…regression tests OWUI's /api/chat/completions handler pops folder_id and chat_id out of the top-level form_data and re-injects them into body['metadata'] (keys metadata.folder_id, metadata.chat_id, metadata.user_id). The filter inlet therefore never sees top-level folder_id/chat_id, so _resolve_folder always returned None and chats inside a folder were wrongly treated as Global Workspace (e.g. /island-guidelines emitted the 'outside folder' guidance). Read folder_id/chat_id from body['metadata'] first, falling back to legacy top-level keys and the Chats model. Verified against a running OWUI 0.11.0 container: Chats.get_chat_folder_id is async. Tests now use the real payload shape (metadata carries the IDs; top-level is absent) and lock the resolution behavior: metadata folder_id wins, Chats-model fallback uses metadata.chat_id, and global workspace returns None so the command handler only emits the outside-folder guidance in that case.
…se OWUI version floor The outlet body carries a top-level chat_id but no metadata/folder_id, so auto-learning could not resolve the folder for chats inside a folder. The outlet now declares the __user__ reserved arg (passed by OWUI's outlet_filter_handler when declared) and forwards the user id into _resolve_folder, which resolves the folder via the Chats model. Also: - Add async Chats.get_chat_folder_id regression test (the method is async in OWUI v0.10+, so _resolve_folder must await the coroutine) and a Chats=None import-failure test asserting graceful None without raising. - Raise required_open_webui_version from >=0.3.0 to >=0.10.0: metadata.folder_id and Chats.get_chat_folder_id only exist from v0.10, older versions silently no-op folder resolution. - Add icon_url placeholder for meta template parity.
Replace guidelines and prefix-scan learning with background LLM fact extraction per the 0.2.0 spec: - schema v2 (facts + updated_at; legacy v1 tables recreated) - EXTRACTION_MODEL / EXTRACTION_INTERVAL valves - resilient generate_chat_completion import + strict JSON parsing - remove custom folder guidelines and all /island-* slash commands - rewrite unit tests and extend valves integration spec - add CHANGELOG.md with [Unreleased] entries
…on (OQ-3 Option 1)
- Remove all /island-* slash commands and the custom guidelines mechanism (native folder System Prompt replaces it). - Document LLM-driven automatic fact extraction via the internal OWUI generation engine (generate_chat_completion) with EXTRACTION_MODEL / EXTRACTION_INTERVAL valves; language-agnostic. - Document all six Filter valves, schema v2 (folder_id PK, facts, updated_at) with legacy v1 recreated (no migration), the companion Manager Action install, the disable-native-Memories step, and the reserved @memory prefix caveat. - Changelog: add the reserved @memory prefix note under [Unreleased].
…guide - Fix releases links to the actual remote (toolfab-ai/owui-plugins) in docs/plugin_readme_template.md. - Rename docs/plugin_meta_template to docs/plugin_meta_template.md and update the stale AGENTS.md link. - Add docs/llm_and_error_handling.md (consolidated LLM-call & error-handling pattern) and reference it from docs/plugin_development.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rewrites the Memory Islands Filter plugin per the v0.2.0 spec: replaces custom folder guidelines and brittle English-prefix fact learning with LLM-driven, folder-scoped fact extraction.
Changes
memoriestable now storesfacts+updated_at; legacy v1 tables (withguidelinescolumn) are detected and recreated automatically.EXTRACTION_MODEL(model id for background extraction; empty = reuse chat model) andEXTRACTION_INTERVAL(extract every N exchanges, default 1).generate_chat_completion(open_webui.utils.chat->open_webui.apps.webui.utils.chat-> None), strict JSON array contract with<NONE>/jsonfence/partial-JSON handling, 60s timeout, background task viaasyncio.create_task, full error handling perdocs/llm_and_error_handling.md./island-*slash commands (CommandsMixin andsrc/_commands.pydeleted).Verification
uv run ruff check plugins/memory-islands— All checks passeduv run ruff format plugins/memory-islands— 10 files formatted / unchangeduv run python build.py— 64 passed, 1 skipped (integration deselected automatically)Notes
plugin.pyis gitignored (built artifact regenerated viabuild.py).