Skip to content

feat(kb): DocIndexerService.search() merges autobot_docs into RAGService (#4953)#4957

Merged
mrveiss merged 1 commit intoDev_new_guifrom
issue-4953
Apr 17, 2026
Merged

feat(kb): DocIndexerService.search() merges autobot_docs into RAGService (#4953)#4957
mrveiss merged 1 commit intoDev_new_guifrom
issue-4953

Conversation

@mrveiss
Copy link
Copy Markdown
Owner

@mrveiss mrveiss commented Apr 16, 2026

Summary

  • Adds DocIndexerService.search(query, n_results) — embeds query with Ollama nomic-embed-text, queries the autobot_docs ChromaDB collection, returns SearchResult objects (score = 1 − cosine distance)
  • Extends RAGService.advanced_search() to call doc_svc.search() and merge results by hybrid_score when categories=None or "autobot_docs" is in the requested categories
  • Doc results are capped to max_results after merging and flow through _filter_stale_chunks identically to main-KB results
  • source_path is set from metadata["file_path"] so the stale-chunk filter resolves correctly against the DocIndexer hash cache

Test plan

  • 5 new unit tests in test_doc_indexer.py::TestDocIndexerSearch: not-initialised guard, empty-collection guard, happy-path SearchResult fields, n_results capping, query-exception fallback
  • All 77 tests in test_doc_indexer.py pass
  • py_compile clean on both modified files

Closes #4953

…ervice results (#4953)

- Add DocIndexerService.search() — embeds query via Ollama, queries autobot_docs
  ChromaDB collection, returns SearchResult objects (score = 1 - cosine_distance)
- Extend RAGService.advanced_search() to call doc_indexer.search() and merge
  results by hybrid_score when categories=None or "autobot_docs" is requested
- Doc results flow through _filter_stale_chunks like all other results
- 5 new tests cover: not-initialised, empty collection, happy path,
  n_results capping, and query exception handling
@mrveiss mrveiss reopened this Apr 17, 2026
@mrveiss mrveiss merged commit 6ef9693 into Dev_new_gui Apr 17, 2026
1 of 3 checks passed
@mrveiss mrveiss deleted the issue-4953 branch April 17, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant