diff --git a/app/MindWork AI Studio/wwwroot/changelog/v26.9.1.md b/app/MindWork AI Studio/wwwroot/changelog/v26.9.1.md index 3758b7eb..ad8e2f9b 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v26.9.1.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v26.9.1.md @@ -22,6 +22,8 @@ - Added a way to show a source of your own documents (RAG) in your file manager. - Added the page of a passage to what the AI is told when it answers from your own documents (RAG), so it can name the page an answer rests on. - Added the details of the two databases behind local RAG to the information page: which versions they run, how much space they use on your disk, and how much they hold. +- Added a repair for your local data sources. Should the index of a data source ever become unreadable, AI Studio now says so instead of quietly finding nothing and leaves that source out of your chats until it works again. +- Added the repair itself as a button next to each of your data sources. Rebuilding an index sends your documents to your embedding provider once more, so AI Studio asks you first and never starts it on its own. - Added support for several drop areas on the same page. More complex assistants can now receive files or folders by drag and drop at more than one place. - Added drag and drop to the input and output folder of the Batch Processing assistant: drop a folder onto either field to choose it. - Added ways to load text from a file and drop zones for them, throughout the assistants and dialogs. We went through them one by one, so many fields that used to accept typed text only now take the content of a file as well. @@ -59,3 +61,4 @@ - Fixed AI Studio asking such a server for its models with an empty key attached when you had stored none at all. Servers behind a login turn those requests down. - Fixed a key that could not be saved going unmentioned for the servers you host yourself. You are now told what went wrong, instead of the settings simply staying open. - Upgraded the Visual Briefing Assistant (in preview) from the prototype to the beta state. The assistant is now completely implemented and is undergoing a deeper testing phase in preparation for release. To try it, open the app settings, allow preview features down to beta, and then enable the Visual Briefing Assistant there. +- Upgraded the vector database behind local RAG (Qdrant Edge) to version 0.8.0. diff --git a/runtime/patches/README.md b/runtime/patches/README.md index 865e67b2..8d40db7a 100644 --- a/runtime/patches/README.md +++ b/runtime/patches/README.md @@ -2,81 +2,35 @@ This directory documents temporary patches for third-party Rust dependencies. -## Qdrant Edge +## permutation_iterator -AI Studio temporarily uses a pinned commit from `SommerEngineering/qdrant` for `qdrant-edge`. -The fork commit exposes Qdrant's internal `lib/edge` crate as `qdrant-edge` and applies the -trait-solver fix from Qdrant PR #9312. +`qdrant-edge` depends on `permutation_iterator 0.1.2`, and that crate has seen no release since +2019. Its published version pulls in an outdated `rand` line, which drags a second copy of the +whole `rand` family into our dependency tree: `rand 0.7.3`, `rand_core 0.5.1`, `rand_chacha 0.2`, +`rand_hc`, `getrandom 0.1.16`, `wasi 0.9` and `cfg-if 0.1`, next to the current ones everything +else uses. -When updating to a newer Qdrant Edge version, replace the placeholder values first: +The fork `SommerEngineering/permutation-iterator-rs` is the published 0.1.2 with `rand` raised to +0.8, so it still satisfies what `qdrant-edge` asks for. AI Studio pins it in `runtime/Cargo.toml`: -```bash -export QDRANT_EDGE_VERSION="0.7.2" -export QDRANT_BRANCH="ai-studio-qdrant-edge-${QDRANT_EDGE_VERSION}" -export AISTUDIO_REPO="xxx/mindwork-ai-studio" -export QDRANT_REPO="xxx/qdrant" +```toml +[patch.crates-io] +permutation_iterator = { git = "https://github.com/SommerEngineering/permutation-iterator-rs.git", rev = "..." } ``` -1. Sync the Qdrant fork with upstream: +The same change was offered upstream in +[asimihsan/permutation-iterator-rs#14](https://github.com/asimihsan/permutation-iterator-rs/pull/14), +where it has been waiting since 2021. This is tree hygiene, not a build failure: without the patch +the runtime still builds, it just carries the old `rand` family along. -```bash -cd "$QDRANT_REPO" -git remote add upstream https://github.com/qdrant/qdrant.git 2>/dev/null || true -git fetch upstream -git fetch origin -git switch master -git merge --ff-only upstream/master -git push origin master -``` +### When this patch can go -2. Create a fresh AI Studio branch in the Qdrant fork: +Either of these is enough, and both are worth a look whenever `qdrant-edge` is updated: -```bash -cd "$QDRANT_REPO" -git switch -c "$QDRANT_BRANCH" master -``` +- crates.io carries a `permutation_iterator` newer than 0.1.2 which uses a current `rand`. Then the + `[patch.crates-io]` entry goes, and `qdrant-edge`'s own requirement decides the version. +- `qdrant-edge` stops depending on `permutation_iterator` at all. Check with + `cargo tree -i permutation_iterator` after the update. -3. Apply the AI Studio patch if upstream has not released the fix yet: - -```bash -cd "$QDRANT_REPO" -git apply "$AISTUDIO_REPO/runtime/patches/qdrant-edge-ai-studio.patch" -``` - -4. Update the exposed `qdrant-edge` version in the fork: - -```bash -cd "$QDRANT_REPO" -perl -0pi -e "s/name = \"qdrant-edge\"\\nversion = \"[^\"]+\"/name = \"qdrant-edge\"\\nversion = \"$ENV{QDRANT_EDGE_VERSION}\"/" lib/edge/Cargo.toml -``` - -5. Commit and push the fork branch: - -```bash -cd "$QDRANT_REPO" -git diff -git add lib/edge/Cargo.toml lib/segment/src/common/anonymize.rs -git commit -m "Expose qdrant-edge ${QDRANT_EDGE_VERSION} package for AI Studio" -git push origin "$QDRANT_BRANCH" -export QDRANT_EDGE_COMMIT="$(git rev-parse HEAD)" -echo "$QDRANT_EDGE_COMMIT" -``` - -6. Update AI Studio to use the new Qdrant Edge version and fork commit: - -```bash -cd "$AISTUDIO_REPO" -perl -0pi -e "s/qdrant-edge = \"[^\"]+\"/qdrant-edge = \"$ENV{QDRANT_EDGE_VERSION}\"/" runtime/Cargo.toml -perl -0pi -e "s/rev = \"[0-9a-f]+\"/rev = \"$ENV{QDRANT_EDGE_COMMIT}\"/" runtime/Cargo.toml -``` - -7. Refresh the AI Studio lock file and verify the Rust runtime: - -```bash -cd "$AISTUDIO_REPO/runtime" -cargo update -p qdrant-edge -cargo check -``` - -Remove the patch and the `[patch.crates-io]` override once Qdrant publishes a fixed `qdrant-edge` -release on crates.io. +Afterward, `grep 'name = "rand"' -A 2 runtime/Cargo.lock` must not show a 0.7 version anymore. +`SommerEngineering/permutation-iterator-rs` can then be deleted. diff --git a/runtime/patches/qdrant-edge-ai-studio.patch b/runtime/patches/qdrant-edge-ai-studio.patch deleted file mode 100644 index 3b33f565..00000000 --- a/runtime/patches/qdrant-edge-ai-studio.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/lib/edge/Cargo.toml b/lib/edge/Cargo.toml -index 7c2cf6037..d21e3c053 100644 ---- a/lib/edge/Cargo.toml -+++ b/lib/edge/Cargo.toml -@@ -1,6 +1,6 @@ - [package] --name = "edge" --version = "0.1.0" -+name = "qdrant-edge" -+version = "0.7.2" - authors = ["Qdrant Team "] - license = "Apache-2.0" - edition = "2024" -diff --git a/lib/segment/src/common/anonymize.rs b/lib/segment/src/common/anonymize.rs -index 6b5d19b12..c73d24433 100644 ---- a/lib/segment/src/common/anonymize.rs -+++ b/lib/segment/src/common/anonymize.rs -@@ -105,7 +105,7 @@ where - { - collection_opt - .as_ref() -- .map(|c| anonymize_collection_values(c)) -+ .map(|c| anonymize_collection_values::(c)) - } - - impl Anonymize for String {