I want to create a feature where you can select text, press a brain svg, and that pulls up a search field, just like
the current @resources/js/citations/ search opens (in terms of UX)... it puts a search bar direclty above keyboard
(this is mainly an issue on phone) using @resources/js/keyboardManager.js ... but, in this instance, we need an enter
buton on the right... there is no search debounce or anything... why? because this instance we are gonna use that
enter button to essentially use the @resources/js/hyperlights/ logic... we will literally create a hyperlight, BUt,
this hyperlight will actually be a co-authored hyperlight.. for the actual content of it will be generated, on the
back end, via a RAG/LLM pipeline. what we need to do is: get selected text, convert to vector embedding, compare to
all other vector embeddings of all other content in the nodes table... (add a vector embedding column for htem using
postgresql feature).... then, we get the top say ten results of vector embedding comparison, along with the rest of
data from that nodes row, keep in a json... then, we have a controller that gets this json and uses the selected
passages, and the CITATION data (bibtex from teh library table for hte book of the row of hte matched node), and we
send it to deep seek vai fireworks api... with something like... we want to answer this question: "users typed text"
in rleation to this passage: "selected text", drawing on this information: matched passages and citation details. When
you are referring to a particular passage, can you please include actual quotes... if possible of what is being
referred to, followed by "[surname year]"... okay... then we get the result from deep seek, and we go get all those
[surname year] bits, using laravel controller, and we replace them with hypercite arrow links... to
url.com/book#hyperciteID ... we use that hypercite ID to create a new record in the hypercites table... it is like
this [Pasted text #2] ... that way... BUT the citedIN array will refer to THIS highlight.... as we will get this, the
result from deepseek, with OUR hypercite links, <a href="/book#hyperciteID>arrow added to the deep seek
response... as nodes to a new book which is the book/hyperlightId that user just created... right... and we send that
book... with newly created library record, nodes, and hyperlight details, to front end, which user receives (waiting
for it as pressed the brain and wrote a question and pressed enter... ) and.... perhaps we send a radio button and ask
if they want to go to the resonse... (they might have kept reading and srolling) we scroll up to the hpyerlight... it
opens (we already have a system for htis... nav to the address: url.com/book#hyperlightId will do this already) and
open, now to the response we got from deepseek and which we augmented on backedn... now user can read taht response
and, if they want to see the actual source used, click and it will -- if we did everything correctly -- open to the
actual passage referred to as we effectively hypercited it on the backend.) note... when we get the charData for the
hypercite record, charEnd and Charstart, we can try to match based on the quoted text from deep seek.. but this might
be unreliable... if we can't, we should just do the character count based on the whole node being referred to....
I want to create a feature where you can select text, press a brain svg, and that pulls up a search field, just like
the current @resources/js/citations/ search opens (in terms of UX)... it puts a search bar direclty above keyboard
(this is mainly an issue on phone) using @resources/js/keyboardManager.js ... but, in this instance, we need an enter
buton on the right... there is no search debounce or anything... why? because this instance we are gonna use that
enter button to essentially use the @resources/js/hyperlights/ logic... we will literally create a hyperlight, BUt,
this hyperlight will actually be a co-authored hyperlight.. for the actual content of it will be generated, on the
back end, via a RAG/LLM pipeline. what we need to do is: get selected text, convert to vector embedding, compare to
all other vector embeddings of all other content in the nodes table... (add a vector embedding column for htem using
postgresql feature).... then, we get the top say ten results of vector embedding comparison, along with the rest of
data from that nodes row, keep in a json... then, we have a controller that gets this json and uses the selected
passages, and the CITATION data (bibtex from teh library table for hte book of the row of hte matched node), and we
send it to deep seek vai fireworks api... with something like... we want to answer this question: "users typed text"
in rleation to this passage: "selected text", drawing on this information: matched passages and citation details. When
you are referring to a particular passage, can you please include actual quotes... if possible of what is being
referred to, followed by "[surname year]"... okay... then we get the result from deep seek, and we go get all those
[surname year] bits, using laravel controller, and we replace them with hypercite arrow links... to
url.com/book#hyperciteID ... we use that hypercite ID to create a new record in the hypercites table... it is like
this [Pasted text #2] ... that way... BUT the citedIN array will refer to THIS highlight.... as we will get this, the
result from deepseek, with OUR hypercite links, <a href="/book#hyperciteID>arrow added to the deep seek
response... as nodes to a new book which is the book/hyperlightId that user just created... right... and we send that
book... with newly created library record, nodes, and hyperlight details, to front end, which user receives (waiting
for it as pressed the brain and wrote a question and pressed enter... ) and.... perhaps we send a radio button and ask
if they want to go to the resonse... (they might have kept reading and srolling) we scroll up to the hpyerlight... it
opens (we already have a system for htis... nav to the address: url.com/book#hyperlightId will do this already) and
open, now to the response we got from deepseek and which we augmented on backedn... now user can read taht response
and, if they want to see the actual source used, click and it will -- if we did everything correctly -- open to the
actual passage referred to as we effectively hypercited it on the backend.) note... when we get the charData for the
hypercite record, charEnd and Charstart, we can try to match based on the quoted text from deep seek.. but this might
be unreliable... if we can't, we should just do the character count based on the whole node being referred to....