mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2026-07-19 14:13:35 -04:00
Closed
opened 2026-02-22 18:27:26 -05:00 by yindo
·
4 comments
No Branch/Tag Specified
master
5846-bug-when-scrolling-up-scrolling-jumps
refactor-remove-workspace-pfp
5969-bug-stopgenerationbutton-disappears-on-the-first-prompt-that-initiates-an-agent-session
2235-bug-how-to-upload-a-folder-with-subfolders-with-files-to-anythingllm
5990-workspace-update-fails-with-unknown-argument-router_id-v1130v1150-intel-mac
opencomputer-examples
pg
feat/image-generation-translations
feat/image-generation
5924-bug-meeting-summary-fails-with-sincludes-is-not-a-function-when-default-llm-is-anthropic-claude
render
feat/uniform-modal-component
5883-bug-unescaped-content-in-json-strings-being-passed-to-document-generator-tools
5901-bug-api-update-embeddings-fails-prisma-argument-filename-is-missing-on-workspace_documentscreate-desktop-windows-v1141
hybrid-search
1981-translations
5752-bug-prompts-to-local-jan-endpoint-unresponsive
feat-disable-native-tool-calling-env-var
5676-bug-non-ollama-agent-providers-do-not-parse-and-present-reasoning-content
feat/markdown-web-scraping
5717-bug-apiv1documentupload-silently-drops-metadata-field-in-desktop-1130-arg-count-mismatch-nested-payload-key
fix/aibitat-context-overflow
5711-bug-erratic-deepseek-v4-flash-the-agent-model-failed-to-respond-400-the-reasoning_content
5631-feat-custom-api-request-timeouts-for-ai-providers
feat-reasoning-control
feat-agent-clarifying-questions-translations
5583-bug-lm-studio-provider-does-not-present-reasoning-output
5313-normalize-translations
feat/memory-translations
5305-lemonade-embedding-engine-swallows-errors-falsely-reports-documents-as-embedded
5060-bug-agent-interactions-agent-are-not-persisted-to-thread-history-via-api
pptx-subagent
feat-render-images-from-mcp-tool-results
stt-provider-expansion-openai-api-compatible
feat-file-search-agent-tool
feat-native-embedder-job-queue
5189-normalize-translations
feat-file-search-agent-tool-translations
i18n-eslint
5140-auto-migration
5112-bug-openrouter-failed-message-bug
3506-feat-parameters-for-openrouter-models
4992-feat-preserve-scroll-position
4973-bug-markdown-numbered-list-display-in-reasoning-pane
desktop
4938-bug-pending-chat-rerendering-ui-bug
quickstart-env
node-llama-cpp-in-container-cuda
node-llama-cpp-in-container
ollama-in-container
4817-feat-set-cooldown-per-mcp-server
4845-keyboard-shortcuts-to-navigate-in-chat
4844-feat-reorder-threads-by-latest-interaction
standardize-username-constraints-normalize-translations
4792-feat-refactor-workspacepfp-image
1382-embed-ip-improvements
1382-bug-embed-api-improvements
refactor-eslint-frontend
4687-feat-refactor-vector-db-providers
4615-feat-disable-apidocs-with-environment-variable
4559-feat-agent-web-search-enable-ordering-of-results
4599-bug-ollama-race-condition-bug
4572-bug-lmstudio-provided-llm-stopped-working-with-anything-llm-after-upgrading-to-190
4508-agent-youtube-transcript-analysis
4497-feat-workspace-names
frontend-eslint
ollama-lmstudio-auto-context-window
4431-validate-vector-database-connectioN
2019-slash-command-keyboard-selection
microsoft-foundry-provider
4431-validate-vector-database-connection
4325-sys-prompt-var-improvements
3209-feat-apiv1workspacestream-chat-sources-citations
4210-bug-voice-to-text-overwrite
4136-feat-jan-as-a-backend-server-option
4172-feat-openai-o3-support
1.8.3-rerelease
web-push-notifications-service
tasks
3955-feat-jinaai-embedder-provider-support
3921-feat-agent-skills-uiux-improvements
3901-bug-validfunccall-checks-optional-arguments
keyboard-dev
1787-custom-roles-and-permissions
add-jira-slack-data-connector
office-extension-wip
lightmode-dropdown-color-update
3586-bug-agent-flow-function-description-provided-by-user-is-not-seen-in-the-llm-query
3463-bug-agent-continues-to-run-if-request-failed-even-after-exit
3439-feat-call-variables-within-the-flow-api-block-url-field
3282-manager-view-models-workspace
3280-token-counting-server-side-truncation-improvements
3147-bug-embedded-chat-widget---not-considering-query-mode-option-always-working-in-chat-mode
2995-feat-disable-temperature-setting-for-deepseek-r1-deepseek-reasoner-model
2827-feat-perplexity-citations
2866-feat-finally-a-gemini-models-endpoint
2647-feat-hpp-header-for-a-c++-code-file-mime-addition
lancedb-revert
1656-feat-implement-tooltip-ui-designs
2011-feat-bump-perplexity-models
1873-feat-auto-add-and-watch-folder-for-document-uploads
1297-feat-gemini-agent-support
1759-bug-ui-bug-fixes
1686-feat-implement-winston-for-logging
1536-bug-toggling-on-users-can-delete-workspaces-does-not-take-effect
agent-ui-mobile-styles
1522-feat-chromadb-support
1595-bug-unable-to-get-live-web-search-and-browsing-agent-working-using-google-custom-search-engine-error-getaddrinfo-enotfound-http-errno-3008
1582-bug-lm-studio-does-not-allow-for-different-model-selection
1312-bug-usernames-should-not-be-case-sensitive-when-logging-in
1029-feat-hf-serverless-inference-api
1086-feat-implement-normalized-input-fields
knowledge-graph-support
644-bug-uploaded-file-name-does-not-match-the-displayed-file-name-after-the-upload
v1.15.0
v1.14.2
v1.14.1
v1.14.0
v1.13.0
v1.12.1
v1.12.0
v1.11.2
v1.11.1
v1.11.0
v1.10.0
v1.9.1
v1.9.0
v1.8.5
v1.8.4
v1.8.3
v1.8.2
v1.8.1
v1.8.0
v1.7.8
v1.7.6
v1.7.5
v1.7.4
v1.4.0
v1.3.0
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.1.1
v1.1.0
v1.0.0
Labels
Clear labels
Desktop
Docker
Integration Request
Integration Request
OS: Linux
OS: Mobile
OS: Windows
UI/UX
blocked
bug
bug
core-team-only
documentation
duplicate
embed-widget
enhancement
feature request
github_actions
good first issue
investigating
needs info / can't replicate
possible bug
pull-request
question
stage: specifications
wontfix
Mirrored from GitHub Pull Request
No Label
investigating
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Mintplex-Labs/anything-llm#1963
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @emad-qadri on GitHub (Jan 30, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3063
Originally assigned to: @timothycarambat on GitHub.
Description
Perform a vector similarity search in a workspace - http://localhost:3001/api/v1/workspace/slug/vector-search
I am trying to Perform a vector similarity search in a workspace with a small code base embedded (DB: LanceDB). Below is the request and response (in-part). I am not able to figure out the relation between "scoreThreshold" parameter in request and "score" in response. Are they same/ different? How are they correlated?
if my scoreThreshold is 0.25; why am I getting a result chuck with score 0.000029567665478680283?
REQUEST
{
"query": "what function implements the antenna switch based on 5g?",
"topN": 6,
"scoreThreshold": 0.25
}
RESPONSE
{
"id": "96cda555-1687-401d-b39e-e32867f50776",
"text": "<document_metadata>\nsourceDocument: hal/btc/halbtc8822b1ant.c\npublished: 1/28/2025, 7:24:59 PM\n</document_metadata>\n\n/* rf4 type by efuse, and for ant at main aux inverse use,\n * because is 2x2, and control types are the same, does not need\n */\nstatic void halbtc8822b1ant_set_rfe_type(struct btc_coexist *btc)\n{\n\tstruct rfe_type_8822b_1ant rfe_type = &btc->rfe_type_8822b_1ant;\n\tstruct btc_board_info board_info = &btc->board_info;\n\n\t/ Ext switch buffer mux /\n\tbtc->btc_write_1byte(btc, 0x974, 0xff);\n\tbtc->btc_write_1byte_bitmask(btc, 0x1991, 0x3, 0x0);\n\tbtc->btc_write_1byte_bitmask(btc, 0xcbe, 0x8, 0x0);\n\n\t/ the following setup should be got from Efuse in the future /\n\trfe_type->rfe_module_type = board_info->rfe_type;\n\n\trfe_type->ext_switch_polarity = 0;\n\trfe_type->ext_switch_exist = TRUE;\n\trfe_type->ext_switch_type = BT_8822B_1ANT_SWITCH_USE_SPDT;\n}\n\n/anttenna control by bb mac bt antdiv pta to write 0x4c 0xcb4,0xcbd/\n\nstatic\nvoid hallbtc8822b1ant_set_ant_switch(struct btc_coexist btc,\n\t\t\t\t boolean force_exec, u8 ctrl_type,\n\t\t\t\t u8 pos_type)\n{\n\tstruct coex_dm_8822b_1ant coex_dm = &btc->coex_dm_8822b_1ant;\n\tstruct rfe_type_8822b_1ant rfe_type = &btc->rfe_type_8822b_1ant;\n\tboolean polarity_inverse;\n\tu8 regval = 0;\n\n\tif (!rfe_type->ext_switch_exist)\n\t\treturn;\n\n\tif (!force_exec) {\n\t\tif (((ctrl_type << 8) + pos_type) == coex_dm->cur_switch_status)\n\t\t\treturn;\n\t}\n\n\tcoex_dm->cur_switch_status = (ctrl_type << 8) + pos_type;\n\n\t/ swap control polarity if use different switch control polarity/\n\t/ Normal switch polarity for SPDT,\n\t * 0xcbd[1:0] = 2b'01 => Ant to BTG, WLA\n\t * 0xcbd[1:0] = 2b'10 => Ant to WLG\n\t /\n\tpolarity_inverse = (rfe_type->ext_switch_polarity == 1);\n\n\tif (rfe_type->ext_switch_type ==\n\t BT_8822B_1ANT_SWITCH_USE_SPDT) {\n\t\tswitch (ctrl_type) {\n\t\tdefault:\n\t\tcase BT_8822B_1ANT_CTRL_BY_BBSW:\n\t\t\t/ 0x4c[23] = 0 /\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0x4e, 0x80, 0x0);\n\t\t\t/ 0x4c[24] = 1 /\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0x4f, 0x01, 0x1);\n\t\t\t/ BB SW, DPDT use RFE_ctrl8 and RFE_ctrl9 as ctrl pin/\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0xcb4, 0xff, 0x77);\n\n\t\t\t/ 0xcbd[1:0] = 2b'01 for no switch_polarity_inverse,\n\t\t\t * ANTSWB =1, ANTSW =0\n\t\t\t /\n\t\t\tif (pos_type == BT_8822B_1ANT_TO_S0WLG_S1BT)\n\t\t\t\tregval = 0x3;\n\t\t\telse if (pos_type == BT_8822B_1ANT_TO_WLG)\n\t\t\t\tregval = (!polarity_inverse ? 0x2 : 0x1);\n\t\t\telse\n\t\t\t\tregval = (!polarity_inverse ? 0x1 : 0x2);\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0xcbd, 0x3, regval);\n\t\t\tbreak;\n\t\tcase BT_8822B_1ANT_CTRL_BY_PTA:\n\t\t\t/ 0x4c[23] = 0 /\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0x4e, 0x80, 0x0);\n\t\t\t/ 0x4c[24] = 1 /\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0x4f, 0x01, 0x1);\n\t\t\t/ PTA, DPDT use RFE_ctrl8 and RFE_ctrl9 as ctrl pin /\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0xcb4, 0xff, 0x66);\n\n\t\t\t/ 0xcbd[1:0] = 2b'10 for no switch_polarity_inverse,\n\t\t\t * ANTSWB =1, ANTSW =0 @ GNT_BT=1\n\t\t\t /\n\t\t\tregval = (!polarity_inverse ? 0x2 : 0x1);\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0xcbd, 0x3, regval);\n\t\t\tbreak;\n\t\tcase BT_8822B_1ANT_CTRL_BY_ANTDIV:\n\t\t\t/ 0x4c[23] = 0 /\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0x4e, 0x80, 0x0);\n\t\t\t/ 0x4c[24] = 1 /\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0x4f, 0x01, 0x1);\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0xcb4, 0xff, 0x88);\n\n\t\t\t/ no regval_0xcbd setup required, because\n\t\t\t * antenna switch control value by antenna diversity\n\t\t\t /\n\t\t\tbreak;\n\t\tcase BT_8822B_1ANT_CTRL_BY_MAC:\n\t\t\t/ 0x4c[23] = 1 /\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0x4e, 0x80, 0x1);\n\n\t\t\t/ 0x64[0] = 1b'0 for no switch_polarity_inverse,\n\t\t\t * DPDT_SEL_N =1, DPDT_SEL_P =0\n\t\t\t /\n\t\t\tregval = (!polarity_inverse ? 0x0 : 0x1);\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0x64, 0x1, regval);\n\t\t\tbreak;\n\t\tcase BT_8822B_1ANT_CTRL_BY_FW:\n\t\t\t/ 0x4c[23] = 0 /\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0x4e, 0x80, 0x0);\n\t\t\t/ 0x4c[24] = 1 /\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0x4f, 0x01, 0x1);\n\t\t\tbreak;\n\t\tcase BT_8822B_1ANT_CTRL_BY_BT:\n\t\t\t/ 0x4c[23] = 0 /\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0x4e, 0x80, 0x0);\n\t\t\t/ 0x4c[24] = 0 /\n\t\t\tbtc->btc_write_1byte_bitmask(btc, 0x4f, 0x01, 0x0);\n\n\t\t\t/ no setup required, because antenna switch control\n\t\t\t * value by BT vendor 0xac[1:0]\n\t\t\t /\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/ set gnt_wl gnt_bt control by sw high low, or\n * hwpta while in power on, ini, wlan off, wlan only, wl2g non-currrent,\n * wl2g current, wl5g\n */\n\nstatic\nvoid halbtc8822b1ant_set_ant_path(struct btc_coexist *btc,\n\t\t\t\t u8 ant_pos_type, boolean force_exec,\n\t\t\t\t u8 phase)\n{\n\tstruct coex_sta_8822b_1ant *coex_sta = &btc->coex_sta_8822b_1ant;\n\tstruct coex_dm_8822b_1ant coex_dm = &btc->coex_dm_8822b_1ant;\n\tu32 u32tmp1 = 0, u32tmp2 = 0;\n\tu8 u8tmp = 0, ctrl_type, pos_type;\n\tu8 wl_ctrl, wl_state;\n\tu8 bt_ctrl, bt_state;\n\n\tif (!force_exec) {\n\t\tif (coex_dm->cur_ant_pos_type == ((ant_pos_type << 8) + phase))\n\t\t\treturn;\n\t}\n\n\tcoex_dm->cur_ant_pos_type = (ant_pos_type << 8) + phase;\n\n\tif (btc->dbg_mode) {\n\t\tu32tmp1 = btc->btc_read_4byte(btc, 0xcbc);\n\t\tu32tmp2 = btc->btc_read_4byte(btc, 0xcb4);\n\t\tu8tmp = btc->btc_read_1byte(btc, 0x73);\n\n\t\tBTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,\n\t\t\t "[BTCoex], (Before Ant Setup) 0xcb4 = 0x%x, 0xcbc = 0x%x, 0x73 = 0x%x\n",\n\t\t\t u32tmp1, u32tmp2, u8tmp);\n\t\tBTC_TRACE(trace_buf);\n\t}\n\n\tswitch (phase) {\n\tcase BT_8822B_1ANT_PHASE_POWERON:\n\t\tBTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,\n\t\t\t "[BTCoex], set_ant_path - 1ANT_PHASE_COEX_POWERON\n");\n\t\tBTC_TRACE(trace_buf);\n\n\t\t/ set Path control owner to BT at power-on step /\n\t\thalbtc8822b1ant_coex_ctrl_owner(btc, BT_8822B_1ANT_PCO_BTSIDE);\n\n\t\tif (ant_pos_type == BTC_ANT_PATH_AUTO)\n\t\t\tant_pos_type = BTC_ANT_PATH_BT;\n\n\t\tcoex_sta->run_time_state = FALSE;\n\t\tbreak;\n\tcase BT_8822B_1ANT_PHASE_INIT:\n\t\t/ Ext switch buffer mux /\n\t\tbtc->btc_write_1byte(btc, 0x974, 0xff);\n\t\tbtc->btc_write_1byte_bitmask(btc, 0x1991, 0x3, 0x0);\n\t\tbtc->btc_write_1byte_bitmask(btc, 0xcbe, 0x8, 0x0);\n\n\t\tBTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,\n\t\t\t "[BTCoex], set_ant_path - 1ANT_PHASE_COEX_INIT\n");\n\t\tBTC_TRACE(trace_buf);\n\n\t\thalbtc8822b1ant_ltecoex_enable(btc, 0x0);\n\n\t\thallbtc8822b1ant_ltecoex_table(btc, BT_8822B_1ANT_CTT_WL_VS_LTE,\n\t\t\t\t\t 0xffff);\n\n\t\thallbtc8822b1ant_ltecoex_table(btc, BT_8822B_1ANT_CTT_BT_VS_LTE,\n\t\t\t\t\t 0xffff);\n\n\t\t/ set GNT_BT to SW high /\n\t\thalbtc8822b1ant_set_gnt_bt(btc, BT_8822B_1ANT_GNT_BLOCK_RFC_BB,\n\t\t\t\t\t BT_8822B_1ANT_GNT_CTRL_BY_SW,\n\t\t\t\t\t BT_8822B_1ANT_GNT_SET_TO_HIGH);\n\n\t\t/ set GNT_WL to SW low /\n\t\thalbtc8822b1ant_set_gnt_wl(btc, BT_8822B_1ANT_GNT_BLOCK_RFC_BB,\n\t\t\t\t\t BT_8822B_1ANT_GNT_CTRL_BY_SW,\n\t\t\t\t\t BT_8822B_1ANT_GNT_SET_TO_LOW);\n\n\t\t/ set Path control owner to WL at initial step /\n\t\thalbtc8822b1ant_coex_ctrl_owner(btc, BT_8822B_1ANT_PCO_WLSIDE);\n\n\t\tcoex_sta->run_time_state = FALSE;\n\n\t\tif (ant_pos_type == BTC_ANT_PATH_AUTO)\n\t\t\tant_pos_type = BTC_ANT_PATH_BT;\n\n\t\tbreak;\n\tcase BT_8822B_1ANT_PHASE_WONLY:\n\t\t/ Ext switch buffer mux /\n\t\tbtc->btc_write_1byte(btc, 0x974, 0xff);\n\t\tbtc->btc_write_1byte_bitmask(btc, 0x1991, 0x3, 0x0);\n\t\tbtc->btc_write_1byte_bitmask(btc, 0xcbe, 0x8, 0x0);\n\n\t\tBTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,\n\t\t\t "[BTCoex], set_ant_path - 1ANT_PHASE_WLANONLY_INIT\n");\n\t\tBTC_TRACE(trace_buf);\n\n\t\thalbtc8822b1ant_ltecoex_enable(btc, 0x0);\n\n\t\thallbtc8822b1ant_ltecoex_table(btc, BT_8822B_1ANT_CTT_WL_VS_LTE,\n\t\t\t\t\t 0xffff);\n\n\t\thallbtc8822b1ant_ltecoex_table(btc, BT_8822B_1ANT_CTT_BT_VS_LTE,\n\t\t\t\t\t 0xffff);\n\n\t\t/ set GNT_BT to SW Low /\n\t\thalbtc8822b1ant_set_gnt_bt(btc, BT_8822B_1ANT_GNT_BLOCK_RFC_BB,\n\t\t\t\t\t BT_8822B_1ANT_GNT_CTRL_BY_SW,\n\t\t\t\t\t BT_8822B_1ANT_GNT_SET_TO_LOW);\n\n\t\t/ Set GNT_WL to SW high /\n\t\thalbtc8822b1ant_set_gnt_wl(btc, BT_8822B_1ANT_GNT_BLOCK_RFC_BB,\n\t\t\t\t\t BT_8822B_1ANT_GNT_CTRL_BY_SW,\n\t\t\t\t\t BT_8822B_1ANT_GNT_SET_TO_HIGH);\n\n\t\t/ set Path control owner to WL at initial step /\n\t\thalbtc8822b1ant_coex_ctrl_owner(btc, BT_8822B_1ANT_PCO_WLSIDE);\n\n\t\tcoex_sta->run_time_state = FALSE;\n\n\t\tif (ant_pos_type == BTC_ANT_PATH_AUTO)\n\t\t\tant_pos_type = BTC_ANT_PATH_WIFI;\n\t\tbreak;\n\tcase BT_8822B_1ANT_PHASE_WOFF:\n\t\tBTC_SPRINTF(trace_buf, BT_TMP_BUF_SIZE,\n\t\t\t "[BTCoex], set_ant_path - 1ANT_PHASE_WLAN_OFF\n");\n\t\tBTC_TRACE(trace_buf);\n\n\t\t/ Disable LTE Coex Function in WiFi side */\n\t\thalbtc8822b1ant_ltecoex_enable(btc, 0x0);",
"metadata": {
"url": "github://hal/btc/halbtc8822b1ant.c",
"title": "hal/btc/halbtc8822b1ant.c",
"author": "fastoe",
"description": "No description found.",
"docSource": "hal/btc/halbtc8822b1ant.c",
"chunkSource": "github://https://github.com/fastoe/RTL8812BU?payload=c033ed9af3ac85c53fa6ef0ce64f66bca28403125c36160816c164a2fdc8c20e4ef93913ee2bed280907335383c74215bf874aa8d28148e88bde8a223bb628a1213630aedd615c49f536108d05f10d3539f429f6a9bfe0046a76524fa3dd08cc20957aa977dcc866d1d95e3f3207ca7c457d427fbabc8731e8d0a1cf7176081430a5818096019e3bfe163feb5a185c8e:da8a6f218c3287d809c436b480c1db85",
"published": "1/28/2025, 7:24:59 PM",
"wordCount": 13906,
"tokenCount": 64907
},
"distance": 0.42097437381744385,
"score": 0.000029567665478680283
}
]
}
@timothycarambat commented on GitHub (Jan 30, 2025):
Do you have reranking enabled on this workspace?
@timothycarambat commented on GitHub (Jan 30, 2025):
I believe that is what is going on here. When reranking is introduced into the search we do this:
https://github.com/Mintplex-Labs/anything-llm/blob/e86ad82496e36bb2c529280fac488a99a1586832/server/utils/vectorDbProviders/lance/index.js#L127
Since the rerank score should be the most relevant score since reranking does a different job than just raw search and is often better at determining relevance to a query. The issue is our default rerank model is
ms-marco-MiniLM-L-6-v2which will do very poorly on code based documents since that is not in its core training set. We would need to add a code-based model.This is one of the reasons that reranking is not default enabled, since it is largely best at semantic text, not code or data tables.
That being said, the relationship between score and threshold are exactly as you would presume. In this particular instance
rerankingis just giving a very very low confidence score since it is basically not built to handle that.The
_distancevalue you see is really what is being filtered on even during reranking, because that model is much more generic and can handle many different types.If you turn of reranking the scores will make sense.
@emad-qadri commented on GitHub (Jan 31, 2025):
That makes sense, @timothycarambat. Thanks!
However, since source code analysis is one of the primary use cases for RAG systems within AnythingLLM, I’d appreciate it if you could add a reranking model soon. I’ve already determined that using a different embedding model is necessary for generating high-quality code embeddings—e.g., jina-embeddings-v2-base-code performs well for this purpose.
One question: does a reranking model need to be derived from a related embedding model, or can any model trained on code be effective? I’m not an expert in this field, so take my question with a grain of salt.
@timothycarambat commented on GitHub (Jan 31, 2025):
Totally reasonable question. The easiest way to frame re-rankers is that they are totally independent from embedders, LLM, or anything else. The specifically take a prompt and a lists of texts and rerank them to be most to least relevant.
This is distinctly different from embedding which turns text into vector values that are later pushed into a vector DB. While vectorization is supposed to retain semantic meaning, its not always the best.
In your case, you could do the following:
Now, when you embed documents your code content is more semantically captured while also retaining the text documents as well. The reason a model like this is not the default is that they tend to be quite large. Our default embedder is like 50mb. That model, for example, is 300mb
[DOCS]: Perform a vector similarity search in a workspaceto [GH-ISSUE #3063] [DOCS]: Perform a vector similarity search in a workspace