diff options
author | Alexander_Kabui | 2024-09-02 11:20:51 +0300 |
---|---|---|
committer | Alexander_Kabui | 2024-09-02 11:20:51 +0300 |
commit | 53dcd1d02d36b425c704eb56aba6d639319fab5c (patch) | |
tree | 7f357ad68343176317ddc202cba77240ebf0868e /issues/gnqa_integration_to_global_search_Design.gmi | |
parent | 276da534291bdc25b99f53be434d5f11762c3f26 (diff) | |
download | gn-gemtext-53dcd1d02d36b425c704eb56aba6d639319fab5c.tar.gz |
Add new issue: gnqa integration to global search design.
Diffstat (limited to 'issues/gnqa_integration_to_global_search_Design.gmi')
-rw-r--r-- | issues/gnqa_integration_to_global_search_Design.gmi | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/issues/gnqa_integration_to_global_search_Design.gmi b/issues/gnqa_integration_to_global_search_Design.gmi new file mode 100644 index 0000000..897f6a3 --- /dev/null +++ b/issues/gnqa_integration_to_global_search_Design.gmi @@ -0,0 +1,56 @@ +# GNQA Integration to Global Search Design Proposal + +## Tags +* assigned: jnduli, alexm +* keywords: llm, genenetwork2 +* type: feature +* status: in-progress + +## Description +This document outlines the design proposal for integrating GNQA into the Global Search feature. + +## High-Level Design + +### UI Design +When the GN2 Global Search page loads: +1. A request is initiated via HTMX to the GNQA search page with the search query. +2. Based on the results, a page or subsection is rendered, displaying the query and the answer, and providing links to references. + +For more details on the UI design, refer to the pull request: +=> https://github.com/genenetwork/genenetwork2/pull/862 + +### Backend Design +The API handles requests to the Fahamu API and manages result caching. Once a request to the Fahamu API is successful, the results are cached using SQLite for future queries. Additionally, a separate API is provided to query cached results. + +## Deep Dive + +### Caching Implementation +For caching, we will use SQLite3 since it is already implemented for search history. Based on our study, this approach will require minimal space: + +*Statistical Estimation:* +We calculated that this caching solution would require approximately 79MB annually for an estimated 20 users, each querying the system 5 times a day. + +### Error Handling +* Handle cases where users are not logged in, as GNQA requires authentication. +* Handle scenarios where there is no response from Fahamu. +* Handle general errors. + +### Passing Questions to Fahamu +We can choose to either pass the entire query from the user to Fahamu or parse the query to search for keywords. + +### Generating Possible Questions +It is possible to generate potential questions based on the user's search and render those to Fahamu. Fahamu would then return possible related queries. + +## Related Issues +=> https://issues.genenetwork.org/issues/gn_llm_integration_using_cached_searches + +## Tasks + +* [ ] Initiate a background task from HTMX to Fahamu once the search page loads. +* [ ] Query Fahamu for data. +* [ ] Cache results from Fahamu. +* [ ] Render the UI page with the query and answer. +* [ ] For "See more," render the entire GNQA page with the query, answer, references, and PubMed data. +* [ ] Implement parsing for Xapian queries to normal queries. +* [ ] Implement error handling. +* [ ] Query Fahamu to generate possible questions based on certain keywords. |