Skip to content

Add two tier filtering to the knowledge base filter#2453

Open
ShaohongZ wants to merge 3 commits intomainfrom
add_kb_tiers
Open

Add two tier filtering to the knowledge base filter#2453
ShaohongZ wants to merge 3 commits intomainfrom
add_kb_tiers

Conversation

@ShaohongZ
Copy link
Contributor

Overview

Add two-tier confidence filtering for knowledge base results in the Fuser, with configurable thresholds.

Type of change

  • Bug fix
  • [v] New feature
  • Documentation improvement
  • Bounty issue submission
  • Other:

Changes

  • Two-tier KB filtering: Query results are now split into high confidence (≥ high_score) and low confidence (low_score to high_score) tiers. Results below low_score are discarded. High-confidence results are included directly; low-confidence results are prefixed with [Potentially relevant, low confidence] so the LLM can weigh them appropriately.
  • Configurable thresholds: high_score (default 0.92) and low_score (default 0.75) can be set via the knowledge_base config block alongside the existing min_score. min_score is a query-level floor passed to the vector store; high_score/low_score are display-level tiers applied after results are returned.
  • Fix duplicate KB query: Removed a duplicate knowledge_base.query() call that was executing the same query twice per tick.
  • Updated tests: Fuser tests updated to match the new two-tier format_context call pattern.

@ShaohongZ ShaohongZ requested review from a team as code owners March 9, 2026 19:05
@github-actions github-actions bot added robotics Robotics code changes python Python code tests Test files labels Mar 9, 2026
@codecov
Copy link

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python code robotics Robotics code changes tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant