Conversation
…knowledge base The Studio built and owned its index, which suited a knowledge base and nothing else. It now mounts libraries: the knowledge base is the first, writable, and every request that does not name a library means it, so nothing that existed before has changed. Any other library is read only, a site's root-built GUFI index or one someone handed over, reached through a local tree with an optional source root. The registry lives in libraries.ts. Libraries come from the deployment (STUDIO_LIBRARIES, pinned, also a field on the deploy form) or from Settings, where an administrator adds one by path and the Studio probes the tree first: a GUFI index, the Studio's full-text tables, vectors, and whether the source is readable. Nothing is asked of GUFI and nothing is written into the index. Addressing is a library parameter on every corpus and index route, defaulting to the primary; the index functions take an index root and the corpus functions a source root, with per-root caches. A read-only library refuses upload, move, rename, delete, labels, and re-index with a 403 that says so, and the interface does not offer them. A library with no files on this host can be searched and described but not opened: the file routes answer 409 and the viewer says why. The chat tools read from the library the conversation names. On the client the Library rail header becomes the switcher when more than one library is mounted; the current library rides on every API call from one place, and on deep links as &lib=<id>, so a shared link and a reload land in the right library. STUDIO_SECTIONS chooses which sections appear, so a site can run an index viewer with no assistant. Verified against a real second GUFI index mounted on the dev server: the probe reported each library's capabilities, listing and filename search and file reads followed the named library, the primary was untouched, and mutations on the read-only library were refused. Not yet: enrichment sidecars for read-only libraries, the Query page's scope, searching across libraries, and remote libraries through GUFI's client. Each builds on this rather than changing it.
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.
The Studio built and owned its index, which suited a knowledge base and nothing else. It now mounts libraries: the knowledge base is the first, writable, and every request that does not name a library means it, so nothing that existed before changes. Any other library is read only: a site's root-built GUFI index or one someone handed over, reached through a local tree with an optional source root.
Registry (
server/src/libraries.ts): libraries come from the deployment (STUDIO_LIBRARIES, pinned; also an Additional Libraries field on the deploy form) or from Settings > Libraries, where an administrator adds one by path and the Studio probes the tree first (a GUFI index, the Studio's full-text tables, vectors, source readable). Nothing is asked of GUFI and nothing is written into the index.Addressing: a
libraryparameter on every corpus and index route, defaulting to the primary.gufi.tsfunctions take an index root (per-root caches),kb.tsa source root. Read-only libraries refuse upload, move, rename, delete, labels, and re-index with a 403; a library with no files on this host answers 409 on file routes and the viewer says why. Chat tools read from the library the conversation names.Client: the Library rail header becomes the switcher when more than one library is mounted; the current library rides on every API call from one place (
api.ts) and on deep links as&lib=<id>.STUDIO_SECTIONSchooses which sections appear, so a site can run an index viewer with no assistant.Verified against a real second GUFI index on the dev server: probe reported capabilities per library; listing, filename search, and file reads followed the named library; the primary was untouched; mutations on the read-only library were refused (403), no-files library answered 409, unknown answered 404.
Tests: 8 new server tests (registry, probe, addressing, guards, config), 3 new web tests (URL suffix, switcher, deep links). 182 server and 12 web tests pass. Docs:
docs/LIBRARIES.md, README, ARCHITECTURE,.env.example, both deploy workflows.Not yet: enrichment sidecars for read-only libraries, the Query page's scope, cross-library search, remote libraries through GUFI's client.