Skip to content

Conversation

@zohaib-7035
Copy link

@zohaib-7035 zohaib-7035 commented Jan 26, 2026

Summary:
This PR introduces a metadata-based reranking feature to improve the relevance of search results in the Knowledge Space Agent. Search results are now scored and reordered based on:

  • Publication year: Newer datasets get a small boost.
  • Citation count: Highly cited datasets are preferred.
  • Trusted sources: Datasets from trusted sources (e.g., Allen Brain Atlas, GENSAT, EBRAINS) get a higher ranking.

Changes:

  • Added rerank_results_using_metadata() function in ks_search_tool.py.
  • Integrated reranking into general_search and smart_knowledge_search.
  • Added debug prints for scores to verify reranking during testing.

Testing:
Tested with sample queries like mouse brain, memory, and hippocampus. Results were correctly reranked according to metadata.

Screenshot of test output:

Screenshot from 2026-01-26 21-53-30

Impact:

  • Improves search relevance for end-users.
  • Sets foundation for further enhancements like advanced scoring and weighting.

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