Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
37d7516
Add search, sort, multi-select and collapse to project sources
Rafael-Silva-Oliveira Aug 14, 2026
b2e9779
Fix partial bulk-remove reconciliation and Select all on indexing rows
Rafael-Silva-Oliveira Aug 14, 2026
23ae247
Make source selection all-or-nothing instead of per-chip checkboxes
Rafael-Silva-Oliveira Aug 14, 2026
7e3fed2
Freeze bulk selection, keep uploads visible, always reconcile
Rafael-Silva-Oliveira Aug 14, 2026
1b724a4
Select all covers every match, not the collapsed slice
Rafael-Silva-Oliveira Aug 14, 2026
385cedd
Refresh after upload, and block uploads during a bulk remove
Rafael-Silva-Oliveira Aug 14, 2026
3e78c54
Apply list refreshes newest-wins so a stale one cannot undo a delete
Rafael-Silva-Oliveira Aug 14, 2026
340a999
Merge branch 'main' into feat/project-sources-search-sort
Rafael-Silva-Oliveira Aug 14, 2026
955e2ec
Open a project source in a preview + quick-edit modal
Rafael-Silva-Oliveira Aug 14, 2026
7ce0d70
Say why a source is read-only once, and drop the duplicate close
Rafael-Silva-Oliveira Aug 14, 2026
a5c1d97
Render HTML sources in the artifact canvas, and generalise the View tab
Rafael-Silva-Oliveira Aug 14, 2026
2da1877
Zoom the rendered HTML preview
Rafael-Silva-Oliveira Aug 14, 2026
eb052e6
Show one scrollbar in the HTML preview, not two
Rafael-Silva-Oliveira Aug 14, 2026
4e23f82
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 14, 2026
6d0108e
Address Codex review on the source preview modal
Rafael-Silva-Oliveira Aug 14, 2026
827e6a4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 14, 2026
0b40b6d
Settle the edit claim, let deletes win, and keep line endings
Rafael-Silva-Oliveira Aug 15, 2026
ce0ef1e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 15, 2026
2cadae6
Merge branch 'main' into feat/project-sources-preview-panel
Rafael-Silva-Oliveira Aug 15, 2026
e0bec42
Survive a restart mid-edit, and stop two copies going in
Rafael-Silva-Oliveira Aug 15, 2026
2d4079f
Let one version win a crash, and stop calling a slow save dead
Rafael-Silva-Oliveira Aug 15, 2026
591165d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 15, 2026
04ad7c6
Claim atomically, publish atomically, and stay visibly alive
Rafael-Silva-Oliveira Aug 15, 2026
6380b71
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 15, 2026
1daea04
Settle the job with the edit, and delete the file only once it sticks
Rafael-Silva-Oliveira Aug 15, 2026
5364b8d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
253 changes: 219 additions & 34 deletions studio/backend/core/rag/ingestion.py

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions studio/backend/core/rag/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,14 @@ def create_document(
embedding_model: str | None = None,
linked_folder_id: str | None = None,
linked_relative_path: str | None = None,
replaces_document_id: str | None = None,
commit: bool = True,
) -> str:
document_id = document_id or str(uuid.uuid4())
conn.execute(
"INSERT INTO documents(id, scope, kb_id, thread_id, project_id, filename, sha256, "
"status, stored_path, created_at, embedding_model, linked_folder_id, "
"linked_relative_path) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)",
"linked_relative_path, replaces_document_id) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
(
document_id,
scope,
Expand All @@ -151,6 +152,7 @@ def create_document(
embedding_model,
linked_folder_id,
linked_relative_path,
replaces_document_id,
),
)
if commit:
Expand All @@ -165,12 +167,14 @@ def set_document_status(
*,
num_chunks: int | None = None,
error: str | None = None,
commit: bool = True,
) -> None:
conn.execute(
"UPDATE documents SET status=?, num_chunks=COALESCE(?, num_chunks), error=? WHERE id=?",
(status, num_chunks, error, document_id),
)
conn.commit()
if commit:
conn.commit()


def set_document_embedding_model(
Expand All @@ -187,7 +191,7 @@ def set_document_embedding_model(
def list_documents(conn: sqlite3.Connection, scope: str) -> list[dict]:
rows = conn.execute(
"SELECT id, scope, kb_id, thread_id, project_id, filename, sha256, status, error, "
"num_chunks, created_at, linked_folder_id "
"num_chunks, stored_path, created_at, linked_folder_id "
"FROM documents d WHERE scope=? AND NOT EXISTS "
"(SELECT 1 FROM linked_folder_retired_scopes r WHERE r.scope=d.scope) "
"ORDER BY created_at DESC",
Expand Down Expand Up @@ -249,10 +253,16 @@ def add_chunks(
chunks,
vectors,
regions = None,
*,
commit: bool = True,
) -> None:
"""Incrementally index one document's chunks into chunks + FTS5 + vec0.
``vectors`` parallels ``chunks``; optional ``regions`` (also parallel) holds
per-chunk PDF highlight rects, stored as JSON."""
per-chunk PDF highlight rects, stored as JSON.

``commit=False`` leaves the rows in the caller's transaction, so a replacement can
publish its chunks and retire the chunks it replaces in one commit -- retrieval
filters by scope rather than status, so between two commits both versions answer."""
if len(vectors):
rag_db.ensure_vec(conn, len(vectors[0]))
for i, (chunk, vector) in enumerate(zip(chunks, vectors)):
Expand Down Expand Up @@ -285,7 +295,8 @@ def add_chunks(
"INSERT INTO chunks_vec(scope, chunk_id, embedding) VALUES(?,?,?)",
(scope, chunk_id, _f32(vector)),
)
conn.commit()
if commit:
conn.commit()


def delete_document(
Expand Down
Loading