Repository navigation
feat: execute Responses file_search built-in tool - #34
Draft
franciscojavierarceo wants to merge 1 commit into
Draft
franciscojavierarceo wants to merge 1 commit into
franciscojavierarceo wants to merge 1 commit into
Conversation
franciscojavierarceo
requested review from
bbrowning,
jiahuei,
leseb,
maralbahari,
noobHappylife,
qandrew and
tjtanaa
as code owners
May 28, 2026 16:05
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
May 28, 2026 17:22
48035cb to
84bb97f
Compare
franciscojavierarceo
marked this pull request as draft
May 28, 2026 18:53
This was referenced May 29, 2026
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
13 times, most recently
from
June 4, 2026 03:31
d282b0c to
0ef5f75
Compare
Collaborator
|
@franciscojavierarceo Is this still in-progress or ready for review? Happy to take a look when you're ready — especially interested in how the OGX |
Collaborator
Author
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
June 11, 2026 14:01
0ef5f75 to
cc71bb1
Compare
10 tasks
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 4, 2026 00:21
5e2b78b to
2e628a1
Compare
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
2 times, most recently
from
November 4, 2026 00:58
03c188a to
f6c00a0
Compare
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 4, 2026 11:51
e7c0c83 to
1984b9f
Compare
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
November 4, 2026 11:52
f6c00a0 to
6536684
Compare
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 4, 2026 11:58
1984b9f to
0e2e73e
Compare
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
November 4, 2026 11:58
6536684 to
3c693af
Compare
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 5, 2026 03:20
0e2e73e to
8183d07
Compare
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
November 5, 2026 03:23
3c693af to
387b6c8
Compare
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 5, 2026 05:05
8183d07 to
9e919b4
Compare
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
November 5, 2026 05:06
387b6c8 to
ef99e5b
Compare
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 6, 2026 02:09
9e919b4 to
1420da9
Compare
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
November 6, 2026 02:10
ef99e5b to
0842568
Compare
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 6, 2026 02:27
1420da9 to
f0478c3
Compare
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
2 times, most recently
from
November 6, 2026 03:38
9b23299 to
5f11379
Compare
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 6, 2026 03:45
b4485be to
5179091
Compare
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
November 6, 2026 03:45
5f11379 to
d24e3b0
Compare
franciscojavierarceo
added a commit
that referenced
this pull request
Nov 6, 2026
## Summary Add a `FileSearchRepository` backed by sqlite-vec for semantic cosine retrieval on a file-backed SQLite database. It keeps portable SQL metadata and published-chunk visibility, normalizes embeddings before indexing, and records a provider identity so stores cannot silently switch indexes. Keyword and hybrid search continue through the bounded exact ranker. SQLite metadata and vector rows now publish in one transaction, so concurrent replicas cannot remove a winning attachment. Orphan cleanup rechecks rows under a writer lock and immediately reclaims stale rows and per-store tables; search skips empty stores and unpublished rows, and uses bounded exact ranking when sqlite-vec's 4,096-candidate limit is exceeded. The loadable extension path is deployment-controlled; #485 wires its configuration. BEIR-sized corpus testing exposed the old 64 MiB serialized-corpus limit and top-k edge cases with duplicate chunks and near ties. This branch keeps the default exact-search limit at 64 MiB and gives sqlite-vec a 256 MiB limit, validates vector-index coverage, and adaptively fetches candidates to preserve the requested document count. Review order: #483 → #484 → #485 → #486 → #34. PostgreSQL vector indexing remains in #278. ## Test Plan - Review follow-up: the portable vector map is migration-owned; extension-specific index SQL lives in `storage/file_search/sqlite_vec_index.rs`, publication has one implementation, and writes use `BEGIN IMMEDIATE` without a process-wide mutex. Focused storage and schema tests passed; the original 3 sqlite-vec integration tests passed, including immediate orphan-row and orphan-table recovery. - `SQLITE_VEC_EXTENSION_PATH=/tmp/vec0.so cargo test -p agentic-server-core --test sqlite_vec_repository -- --ignored`: 4 passed in CI with sqlite-vec 0.1.9, covering publication, extreme finite embeddings, restart, filtered and duplicate-chunk search, deletion, concurrent attachment conflicts, unpublished rows, empty stores, and searches beyond the 4,096-candidate limit. - `cargo test -p agentic-server-core --lib`: 1,370 passed, 6 ignored. `cargo clippy -p agentic-server-core --all-targets -- -D warnings`, `cargo fmt -- --check`, and pre-commit hooks passed. - Maral's capacity regression: a new sqlite-vec integration test publishes a serialized store above 64 MiB, then exercises keyword, hybrid, and filtered semantic searches against it. The Rust CI run passed this test and the full ignored sqlite-vec integration suite. - CI downloads the pinned Linux sqlite-vec release asset, verifies its SHA-256, and runs the ignored integration tests. ### BEIR retrieval evidence (2026-11-03, benchmark commit `fd6b574`) Compared the provider's semantic search with [OGX's published vector-mode results](https://ogx-ai.github.io/docs/building_applications/rag_benchmarks). Used the official BEIR **test** corpora, queries, and relevance judgments, title + body text, `cl100k_base` 512-token chunks with 128-token overlap, `nomic-ai/nomic-embed-text-v1.5` embeddings, and top-10 document scoring with `pytrec_eval`. The 512/128 setting comes from [OGX's documented benchmark config](https://ogx-ai.github.io/docs/building_applications/rag_benchmarks), but this was a local preparation, not [OGX's full API ingestion path](https://github.com/ogx-ai/ogx/tree/12a51077cdd4f89b16df5eb6de12a88b0bfcf7df/benchmarking/rag). A local harness loaded the prepared chunks into the actual `SqliteVecRepository` and called its `search` method for every judged query. sqlite-vec 0.1.9 ran on CPU. | Dataset | Documents / chunks / queries | nDCG@10 OGX vector → ours | Recall@10 OGX vector → ours | MAP@10 OGX vector → ours | | --- | ---: | ---: | ---: | ---: | | NFCorpus | 3,633 / 4,921 / 323 | 0.3106 → **0.3101** | 0.1482 → 0.1462 | 0.1153 → 0.1137 | | SciFact | 5,183 / 6,604 / 300 | 0.6943 → **0.6968** | 0.8369 → 0.8296 | 0.6442 → 0.6496 | | ArguAna | 8,674 / 9,278 / 1,406 | 0.3765 → **0.3928** | 0.7610 → 0.8037 | 0.2542 → 0.2624 | All 2,029 searches succeeded. An independent exhaustive NumPy cosine calculation on the same embeddings gave identical aggregate nDCG@10 for SciFact and ArguAna; NFCorpus differed by 0.000084. This validates sqlite-vec against an exact-cosine oracle on our prepared vectors. The proximity to OGX's published vector scores is indicative, not exact parity: OGX's current batch ingestion path applies whitespace cleaning and appears to use 800/400-token file-processor defaults for automatic chunking, despite the benchmark config documenting 512/128. The published run does not include materialized chunk/embedding or per-query result fixtures, so its exact input and rankings cannot yet be compared. **Scope and limit:** This is a repository-level semantic retrieval test with prepared embeddings; it does not exercise the Files/Vector Stores HTTP APIs, automatic ingestion, hybrid reranking, Responses `file_search`, or end-to-end answer generation. OGX's fourth BEIR dataset, FiQA, produces 63,129 chunks and exceeds this branch's 10,000-chunk corpus bound, so full four-dataset parity remains unvalidated. --------- Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 6, 2026 04:34
5179091 to
fa49123
Compare
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
November 6, 2026 04:34
d24e3b0 to
e016099
Compare
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 6, 2026 04:38
fa49123 to
a222dd5
Compare
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
November 6, 2026 04:39
e016099 to
8054b8a
Compare
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 6, 2026 13:37
a222dd5 to
4ef8354
Compare
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
November 6, 2026 13:37
8054b8a to
a96f634
Compare
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 6, 2026 13:41
4ef8354 to
09843d7
Compare
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
November 6, 2026 13:41
a96f634 to
2f85dcc
Compare
franciscojavierarceo
force-pushed
the
codex/file-search-responses-protocol
branch
from
November 6, 2026 18:48
09843d7 to
04a5a1e
Compare
Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
franciscojavierarceo
force-pushed
the
feat/axum-ogx-integration-v2
branch
from
November 6, 2026 18:51
2f85dcc to
487b73e
Compare
This branch has not been deployed
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
Register and execute the Responses
file_searchbuilt-in tool through the existing typed gateway tool loop. The handler searches the configured file-search service, keeps retrieved passages private for model continuation, exposesfile_search_call.resultsonly when requested, and restores typed file citations in completed and streamed output. This is the top layer of a smaller stack; the Files and vector-store APIs, provider contracts, SQLite-vec adapter, and protocol types are reviewed below it.Review order: #483 (storage contracts and portable SQL/local providers) → #484 (SQLite-vec) → #485 (Files and vector-store HTTP APIs and provider configuration) → #486 (Responses protocol and stream lifecycle) → this PR. The existing PostgreSQL/pgvector follow-up is #278; later retrieval and lifecycle work remains stacked above it.
The storage service accepts injected
FileSearchRepositoryandFileBlobStoreimplementations. The lower layers configure SQLite-vec for semantic retrieval; Milvus and remote blob stores remain adapter extension points.Test Plan
cargo test -p agentic-server-core --test file_search_tool_test: 6 passed, covering blocking and streaming calls, citations, opt-in results, mixed client tools, failures, and selector validation.cargo test -p agentic-server-core --lib: 1,385 passed, 6 ignored on the corrected, restacked file tree. Full workspacecargo test --offlinealso passed on that tree.33b20bacame from an output-item test fixture missing the typedlogprobs: []field. The corrected citation projection test passes locally; CI is running on the cleanly restacked head.