Repository navigation
feat(knowledge): upload project documents from the web into .kortix/knowledge - #4
Draft
andokivilaid wants to merge 8 commits into
Draft
andokivilaid wants to merge 8 commits into
andokivilaid wants to merge 8 commits into
Conversation
Add /v1/projects/:projectId/knowledge (GET list, POST multipart upload, PATCH move/describe, DELETE) and /knowledge/file (byte-exact download, ETag = git blob id). Documents commit under .kortix/knowledge/ with a regenerated INDEX.md in the same commit, directly on the default branch, like the dashboard's other repository editors. Reads gate on project.file.read, writes on project.file.write. Every write is a compare-and-swap on the branch tip (force-with-lease via expectedFileRevision on INDEX.md) with up to 3 re-plans, so concurrent writers never drop an index entry. commitMultipleFilesToBranch now takes Uint8Array content so binary files commit verbatim. Limits: 25 MiB per file, 10 files / 50 MiB per request, 200 MiB per project. Paths are validated: no traversal, hidden segments, link-breaking characters, or the reserved root INDEX.md. Flows KNOW-1 (lifecycle + read-back through /files and /files/content) and KNOW-2 (traversal, oversize, member/non-member/anonymous refusals). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Additive surface over /v1/projects/:projectId/knowledge:
listProjectKnowledge, uploadProjectKnowledge (multipart, one or many
Files, folder/description/replace), updateProjectKnowledgeFile (move and
describe), deleteProjectKnowledgeFile, downloadProjectKnowledgeFile
(exact bytes as a Blob), plus their types. The facade binds them as
kortix.project(id).knowledge.{list,upload,update,remove,download}.
Public surface snapshots re-recorded: additions only, no removals.
Reference docs and README list the new namespace.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Tells agents that project documents live in .kortix/knowledge/ with an INDEX.md (one line per file), to read the index when a task may need project documents, to convert office files and PDFs with anydoc / convert-documents-to-markdown, and how to add a document themselves (file + index line, landed through a change request). Registered in KORTIX_MANAGED_SKILL_NAMES so the sandbox bake, the API skills catalog, and `kortix system-skills` serve it. kortix-system lists it beside kortix-memory. Embedded starter snapshot regenerated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Project-scoped cache key for listProjectKnowledge, under qk.project.scope so project-wide invalidation reaches it. Covered by the existing "every project-scoped key is prefixed by scope" test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
/projects/[id]/customize/knowledge lists the documents in .kortix/knowledge/ (type, size, description, usage against the project limit) and uploads by drag-and-drop or file picker with an optional folder, description, and replace flag. Row actions download, edit (move + description), and delete behind a ConfirmDialog. All data flows through @kortix/sdk; the selection is pre-checked against the server limits the list returns. The tab follows Skills in the capability bar, gated on project.file.read; write controls appear only with project.file.write. Command palette entry "Knowledge". New `knowledge` i18n namespace in all nine catalogs; menu strings added to the generated key map. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
New /docs/project/knowledge page: where documents live, the INDEX.md format, how agents use them through the kortix-knowledge skill, size limits and why the repository stays small, permissions, and the HTTP and SDK surface. Linked from the project overview. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
KNOW-2 now asserts 403 for a project member on GET /knowledge and GET /knowledge/file as well as on the writes, matching the documented project.file.read gate. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
After a successful upload the selection is cleared before the modal's exit animation ends, so the title flashed "Upload 0 documents". The modal now keeps showing the last selection while it animates out. Found while driving the page in Chromium. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Users can now add documents to a project's knowledge from the web, without starting a session. Inspired by manav1125/mira-ai's knowledge base, rebuilt git-native: no new DB tables, and no prompt injection. The project repo stays the single source of truth.
Changes
GET/POST/PATCH/DELETE /v1/projects/:id/knowledgeandGET …/knowledge/file.ETagis the git blob id.project.file.read/project.file.write..kortix/knowledge/INDEX.mdland in one commit. A moved branch tip triggers a re-plan, up to 3 times.commitMultipleFilesToBranchnow accepts raw bytes.INDEX.mdreturn 400.kortix.project(id).knowledge(list/upload/update/delete/download) andqk.project.knowledge. Added with TDD; the surface snapshots only gained names.kortix-knowledgeskill. It readsINDEX.md, converts office/PDF withanydoc, and lands its own additions through a change request.Verification
pnpm test -- --domain knowledge: KNOW-1 and KNOW-2 pass (16 steps, 72 assertions), including negative paths (traversal, oversize, a member without write permission).pnpm test: exit 0, 439/439 flows. Route coverage: 0 uncovered.smoke:installpassed.audit.sh: clean.Not verified
INDEX.mdthrough the skill.🤖 Generated with Claude Code