-
Notifications
You must be signed in to change notification settings - Fork 0
Improvement/improve retrieval #66
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fecfe41
fix local search: validation, FTS5 operators, BGE query prefix, CLI e…
bernoussama 4bdf623
Merge remote-tracking branch 'origin/master' into fix-local-search
bernoussama 12ac6db
Improve keyword and hybrid retrieval
bernoussama 1f90377
Merge branch 'fix-local-search' into codex/improve-retrieval
bernoussama d60d7ea
chore(cli): bump @clankeroverflow/cli to 1.3.1
bernoussama 7b00797
fix: address PR #66 code review feedback
bernoussama 559752e
style: apply oxfmt formatting to index.ts
bernoussama 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
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
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
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
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
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
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
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
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
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
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
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
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
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,58 @@ | ||
| # Local Embedding Benchmark | ||
|
|
||
| This benchmark compares local GGUF embedding configurations through the same document formatting, | ||
| token chunking, SQLite FTS5, sqlite-vec cosine search, and reciprocal-rank fusion used by local mode. | ||
| It never reads or writes the user's ClankerOverflow database and does not change the shipped default. | ||
|
|
||
| ## Run | ||
|
|
||
| Run the complete quality and performance protocol: | ||
|
|
||
| ```sh | ||
| pnpm benchmark:local-embeddings | ||
| ``` | ||
|
|
||
| Useful focused runs: | ||
|
|
||
| ```sh | ||
| pnpm benchmark:local-embeddings --models bge --backend cpu --quality-only | ||
| pnpm benchmark:local-embeddings --models qwen,nomic --performance-only --repetitions 3 | ||
| pnpm benchmark:local-embeddings --report-from results/run.json --output results/run.json | ||
| ``` | ||
|
|
||
| The runner supports `--models`, `--backend cpu|auto`, `--quality-only`, `--performance-only`, | ||
| `--repetitions`, `--cold-repetitions`, and `--output`. Models are stored below the repository's | ||
| ignored `.cache` directory by default. Set `CLANKER_BENCHMARK_MODEL_CACHE` to override it. | ||
|
|
||
| Every model URL contains an immutable repository revision, and every download is checked against | ||
| the SHA-256 recorded in `models.ts` (with expected artifact sizes tracked there for reporting). Results are written as raw JSON and a Markdown | ||
| report. The default `results` directory is ignored because measurements are host-specific. | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| The quality report includes separate exact and tiered keyword baselines. Exact requires all query | ||
| terms; tiered keeps exact matches first and fills remaining slots from relaxed prefix-OR matches. | ||
| Hybrid uses the same relaxed lexical candidate pool as production. | ||
|
|
||
| ## Hosted promotion benchmark | ||
|
|
||
| Run the disposable Workers AI + Vectorize + PostgreSQL benchmark with Cloudflare credentials and a | ||
| Postgres URL whose role can create temporary databases: | ||
|
|
||
| ```sh | ||
| DATABASE_URL='postgresql://...' pnpm benchmark:hosted-retrieval | ||
| ``` | ||
|
|
||
| The command creates a uniquely staged Alchemy app, a 768-dimensional cosine Vectorize index, and a | ||
| temporary Postgres database. Cleanup runs in `finally`; a precise manual destroy command is printed | ||
| if Cloudflare cleanup fails. RRF passes only when overall nDCG@10 improves by at least 0.01, MRR@10 | ||
| and Recall@10 decline by no more than 0.005, and no category or language slice loses over 0.03 | ||
| nDCG@10. Hosted RRF remains disabled until a run passes this gate. | ||
|
|
||
| ## Protocol | ||
|
|
||
| - Corpus: 200 sanitized English solution entries and 100 single-reviewer queries. | ||
| - Queries: 80 English plus 10 French-to-English and 10 Arabic-to-English searches. | ||
| - Quality: nDCG@10, MRR@10, and Recall@1/3/10 with seeded bootstrap confidence intervals. | ||
| - Performance: process-cold load and first query, steady indexing throughput, warm semantic query | ||
| p50/p95, artifact size, and peak RSS. | ||
| - Profiles: model-native prompts plus raw-text quality ablations for Qwen and Nomic. | ||
| - Lanes: CPU-only and the unchanged node-llama-cpp auto-selected backend. | ||
Oops, something went wrong.
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.