-
Notifications
You must be signed in to change notification settings - Fork 318
perf(retrieval): add content trigram index #389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
suguanYang
merged 59 commits into
main
from
fix/wangbinqi/resolve-staging-main-conflicts
Sep 7, 2026
Merged
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
baca046
feat(retrieval): enhance agentic navigation with scope tracking, outl…
EricNGOntos 8b3b6da
Resolve Issue #126 (#127)
EricNGOntos 16ddaa0
chore(agentic): remove legacy topic_hints dead code after c0261ebc re…
EricNGOntos b6916a5
fix: route oversized pdf shards through s3
suguanYang b4c8a59
Merge pull request #131 from Ontos-AI/feat/suguan/pdf-split-s3-mineru…
suguanYang a9c397a
feat(agentic): add discovery fallback, budget-aware prompts, and VLM …
EricNGOntos 80d60db
feat(agentic): reconcile navigation asset search flow (#136)
EricNGOntos c263182
chore: sync main into staging (#139)
EricNGOntos 607df45
chore: sync main into staging
suguanYang a5a2e6e
Merge pull request #156 from Ontos-AI/chore/wangbinqi/sync-main-into-…
suguanYang 90f9d45
Merge pull request #160 from Ontos-AI/main
suguanYang 50b68e1
Merge pull request #165 from Ontos-AI/main
suguanYang d28d8a5
Merge pull request #175 from Ontos-AI/main
suguanYang d5bf22c
Merge pull request #178 from Ontos-AI/main
suguanYang b55f84e
Merge pull request #185 from Ontos-AI/main
suguanYang 69f27cb
Merge pull request #191 from Ontos-AI/main
suguanYang b3b43cc
Merge pull request #197 from Ontos-AI/main
suguanYang 81b6e9e
Merge pull request #199 from Ontos-AI/main
suguanYang 564fc7a
Merge pull request #205 from Ontos-AI/main
suguanYang 9816c0b
Merge pull request #209 from Ontos-AI/main
suguanYang a77021c
Merge pull request #211 from Ontos-AI/main
suguanYang 417b8b5
Merge pull request #218 from Ontos-AI/main
suguanYang 5af4307
Merge pull request #230 from Ontos-AI/main
suguanYang 03374ff
Merge pull request #241 from Ontos-AI/main
suguanYang 4d7494e
Merge pull request #250 from Ontos-AI/main
suguanYang ae33ce0
Merge pull request #259 from Ontos-AI/main
suguanYang 247c754
Merge pull request #267 from Ontos-AI/main
suguanYang 657d890
Merge pull request #269 from Ontos-AI/main
suguanYang eaeb3b5
Merge pull request #271 from Ontos-AI/main
suguanYang d2acac0
Merge pull request #273 from Ontos-AI/main
suguanYang 7cbf0a0
Merge pull request #275 from Ontos-AI/main
suguanYang 82d00ee
Merge pull request #277 from Ontos-AI/main
suguanYang 6e39e49
Merge pull request #281 from Ontos-AI/main
suguanYang 4772d75
Merge pull request #283 from Ontos-AI/main
suguanYang 55c473a
revert(worker): rely on visibility-timeout recovery
suguanYang e87a0fc
Merge pull request #285 from Ontos-AI/revert/wangbinqi/bounded-worker…
suguanYang ceac1e7
Merge pull request #288 from Ontos-AI/main
suguanYang bf6d0f6
Merge pull request #290 from Ontos-AI/main
suguanYang 6e81538
fix(ecs): preserve validated worker cpu capacity
suguanYang cd14ae9
Merge pull request #293 from Ontos-AI/fix/wangbinqi/worker-2vcpu-staging
suguanYang bafef80
Merge pull request #295 from Ontos-AI/main
suguanYang f87621c
Merge pull request #305 from Ontos-AI/main
suguanYang 9d9b9e2
Merge pull request #308 from Ontos-AI/main
suguanYang 2f5f72a
Merge pull request #309 from Ontos-AI/main
suguanYang 62efb50
Merge pull request #314 from Ontos-AI/main
suguanYang 69c557e
Merge pull request #320 from Ontos-AI/main
suguanYang 9a16786
Merge pull request #326 from Ontos-AI/main
suguanYang 74de156
Merge pull request #328 from Ontos-AI/main
suguanYang 9d92a28
Merge pull request #339 from Ontos-AI/main
suguanYang 3aee5e6
Merge pull request #345 from Ontos-AI/main
suguanYang 8e5dbd9
Merge pull request #349 from Ontos-AI/main
suguanYang 9315258
Merge pull request #358 from Ontos-AI/main
suguanYang f8a2941
Merge pull request #363 from Ontos-AI/main
suguanYang abf5973
Merge pull request #369 from Ontos-AI/main
suguanYang ba1225e
Merge pull request #376 from Ontos-AI/main
suguanYang cc4690c
perf(retrieval): add content trigram index for regex grep
suguanYang 80a93e9
Merge pull request #384 from Ontos-AI/perf/wangbinqi/content-trigram-…
suguanYang c0a2442
chore: resolve staging and main migration conflicts
suguanYang 2ad2035
fix: remove unused merge migration import
suguanYang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
apps/api/alembic/versions/0a1b2c3d4e5f_add_content_trigram_index.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| """Add trigram acceleration for regex searches over published chunk content.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from typing import Sequence | ||
|
|
||
| from alembic import op | ||
|
|
||
|
|
||
| revision: str = "0a1b2c3d4e5f" | ||
| down_revision: str | None = "9f0a1b2c3d4e" | ||
|
suguanYang marked this conversation as resolved.
Dismissed
|
||
| branch_labels: Sequence[str] | None = None | ||
|
suguanYang marked this conversation as resolved.
Dismissed
|
||
| depends_on: Sequence[str] | None = None | ||
|
suguanYang marked this conversation as resolved.
Dismissed
|
||
|
|
||
| _INDEX_NAME = "idx_document_chunks_content_trgm" | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| op.execute("CREATE EXTENSION IF NOT EXISTS pg_trgm") | ||
| external_transaction = bool( | ||
| op.get_context().opts.get("knowhere_external_transaction", False) | ||
| ) | ||
| if external_transaction: | ||
| op.execute( | ||
| f"CREATE INDEX IF NOT EXISTS {_INDEX_NAME} " | ||
| "ON document_chunks USING gin (content gin_trgm_ops) " | ||
| "WHERE content IS NOT NULL" | ||
| ) | ||
| return | ||
| with op.get_context().autocommit_block(): | ||
| op.execute( | ||
| f"CREATE INDEX CONCURRENTLY IF NOT EXISTS {_INDEX_NAME} " | ||
| "ON document_chunks USING gin (content gin_trgm_ops) " | ||
| "WHERE content IS NOT NULL" | ||
| ) | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| external_transaction = bool( | ||
| op.get_context().opts.get("knowhere_external_transaction", False) | ||
| ) | ||
| if external_transaction: | ||
| op.execute(f"DROP INDEX IF EXISTS {_INDEX_NAME}") | ||
| return | ||
| with op.get_context().autocommit_block(): | ||
| op.execute(f"DROP INDEX CONCURRENTLY IF EXISTS {_INDEX_NAME}") | ||
21 changes: 21 additions & 0 deletions
21
apps/api/alembic/versions/d3e4f5a6b7c8_merge_retrieval_index_heads.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| """Merge the retrieval index migration branches.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from collections.abc import Sequence | ||
|
|
||
| revision: str = "d3e4f5a6b7c8" | ||
| down_revision: tuple[str, str] = ( | ||
| "0a1b2c3d4e5f", | ||
| "c2d3e4f5a6b7", | ||
| ) | ||
| branch_labels: Sequence[str] | None = None | ||
| depends_on: Sequence[str] | None = None | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| """Merge migration heads without applying additional schema changes.""" | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| """Split the migration graph back into its two parent heads.""" |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.