Skip to content

Commit a636bc2

Browse files
fix(docs): update README.md to reflect the new threshold value for cosine similarity in the ask command
fix(cli.py): change default threshold value in the ask command from 0.25 to 0.001 for consistency fix(config.py): update threshold value from 0.25 to 0.001 to align with new requirements test(config.py): update test case to check for the new threshold value of 0.001 instead of 0.25
1 parent 802f959 commit a636bc2

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ sources = [
125125
# embed_dims = 1536
126126
# chat_model = "gpt-4o-mini"
127127
# max_chunk_chars = 2000
128-
# threshold = 0.25 # minimum cosine similarity to include a result (also --threshold flag)
128+
# threshold = 0.001 # minimum cosine similarity to include a result (also --threshold flag)
129129
# rerank_fetch_k = 20
130130
# rerank_top_k = 5
131131
# index_code = false # set true to also index source code files

src/kb/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
kb index [DIR...] [--no-size-limit] Index sources (skip files > max_file_size_mb)
4444
kb allow <file> Whitelist a large file for indexing
4545
kb search "query" [k] Hybrid semantic + keyword search (default k=5)
46-
kb ask "question" [k] [--threshold N] RAG: search + rerank + answer (default k=8, threshold=0.25)
46+
kb ask "question" [k] [--threshold N] RAG: search + rerank + answer (default k=8, threshold=0.001)
4747
kb similar <file> [k] Find similar documents (no API call, default k=10)
4848
kb tag <file> tag1 [tag2...] Add tags to a document
4949
kb untag <file> tag1 [tag2...] Remove tags from a document

src/kb/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
# min_chunk_chars = 50
4040
4141
# Search
42-
# threshold = 0.25 # minimum cosine similarity to include a result (0.0–1.0)
42+
# threshold = 0.001 # minimum cosine similarity to include a result (0.0–1.0)
4343
# rrf_k = 60.0 # RRF smoothing constant
4444
# rerank_fetch_k = 20 # candidates to fetch for LLM rerank
4545
# rerank_top_k = 5 # how many to keep after rerank
@@ -91,7 +91,7 @@ class Config:
9191
chat_model: str = "gpt-4o-mini"
9292
max_chunk_chars: int = 2000
9393
min_chunk_chars: int = 50
94-
threshold: float = 0.25
94+
threshold: float = 0.001
9595
rrf_k: float = 60.0
9696
rerank_fetch_k: int = 20
9797
rerank_top_k: int = 5

tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_defaults(self):
2222
assert cfg.chat_model == "gpt-4o-mini"
2323
assert cfg.max_chunk_chars == 2000
2424
assert cfg.min_chunk_chars == 50
25-
assert cfg.threshold == 0.25
25+
assert cfg.threshold == 0.001
2626
assert cfg.rrf_k == 60.0
2727
assert cfg.rerank_fetch_k == 20
2828
assert cfg.rerank_top_k == 5

0 commit comments

Comments
 (0)