Skip to content

Search design doc#78

Open
tekrajchhetri wants to merge 7 commits intoimprovementfrom
search_design_doc
Open

Search design doc#78
tekrajchhetri wants to merge 7 commits intoimprovementfrom
search_design_doc

Conversation

@tekrajchhetri
Copy link
Copy Markdown
Collaborator

Addressed: #76

This design document provides a high-level architectural overview and design considerations (algorithms + system implementation) for search for StructSense + Dandi.

Added a section outlining the task for the search system.
Added a section detailing the current situation with BioPortal as the ontology database, including its benefits and trade-offs.
Expanded the search design document with detailed requirements, proposed approach, implementation strategy, and design principles for the retrieval and reranking system.
Clarified search requirements and added references for models used in ranking and retrieval strategy.
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @tekrajchhetri, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a foundational design document for a new search system tailored for StructSense and Dandi. The initiative aims to mitigate current dependencies on BioPortal by establishing an independent, high-performance search capability. The proposed architecture details a hybrid retrieval and reranking strategy, integrating advanced techniques like vector search and various encoder models, all encapsulated within a modular, API-first service designed for scalability and extensibility.

Highlights

  • New Search Design Document: A comprehensive design document for a new search system for StructSense + Dandi has been added, outlining its architecture and design considerations.
  • Addressing BioPortal Limitations: The document identifies and addresses current limitations stemming from the dependency on BioPortal, such as API rate limits and implementation reliance.
  • Hybrid Retrieval and Reranking Approach: A two-stage search process is proposed, combining efficient retrieval (e.g., BM25, vector search) with advanced reranking techniques (e.g., dual-encoders, cross-encoders) to optimize relevance and performance.
  • Key Search Requirements: The design emphasizes support for contextualized retrieval, keyword-based search, and generalizability to various use cases.
  • API-First Implementation with Design Principles: The system will be implemented as an API-first service with modular components, adhering to principles like scalability, extensibility, and provenance by design.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • docs/design_docs/search_design_doc.md
    • Added a new design document for the search system.
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a comprehensive design document for a new search system. The document is well-structured, outlining the motivation, requirements, and a solid two-stage (retrieval and re-ranking) architectural approach. My review includes a few suggestions to fix minor typos, an invalid tag in the Mermaid diagram, and placeholder content in the references to enhance the document's accuracy and clarity.

tekrajchhetri and others added 2 commits February 26, 2026 16:42
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

Before further detail, let’s first understand the steps involved. This task typically consists of two main stages:**retrieval** and **reranking**.

In the first stage, **retrieval**, the objective is to identify a subset of potentially relevant candidates from $\mathcal{D}$. This is achieved by maximizing a scoring function $f(q, d)$, which estimates the relevance between the query and each candidate document:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please make more specific to this case.
is d a specific concept? Is D all ontologies that are provided?


Note at this stage we want to prioritize high recall and computational efficiency.

In the second stage, **reranking**, the retrieved candidates $\mathcal{D}_K$ are re-evaluated using a more expressive (and often computationally expensive) relevance model $g(q, d)$. The goal is to refine the initial ordering by more precisely estimating relevance:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is D_k? How do you get one? How is it related to d^*?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djarecka D is the candidate set as described above and _K is the subset.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I understand that D_k is a subset, but how do you get this subset

2. **Keyword-based retrieval** — The system must also support fast and efficient keyword-based search.
3. **Generalizability** — The implementation should be easily adaptable to other use cases with minimal or no additional effort.

## Proposed approach
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please make connection between the concepts described in the previous section (e.g., Keyword-based retrieval, Contextualized retrieval) and the terms used in the diagram

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@djarecka what do you mean by make connection? Do you want me to include mentions like BM25 for keyword based retrieval?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's really not meant to be tricky, the diagram simply doesn't have the terms that you spent time introducing in the previous section, e.g., Contextualized retrieval, Keyword-based retrieval, etc. I just thought that it might be useful to create the connection between the diagram and the introduction you wrote

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.

2 participants