Add option to generate summaries of each note and index them. #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extension to #34
I'm not sure about this yet.
The general idea is to generate a short one-paragraph summary of each note, generate embeddings for it, and index it. This is in addition to the recently added embeddings index that is per paragraph.
So far I'm testing out the
phi-3
model with ollama and some summaries are okay, but a lot include random hallucinations.I'm probably going to add this to the AI: Search page and merge it as an experimental feature for now, but the prompt will definitely need some tweaking, and will need to test other local models.
edit:
I'm merging this in with the setting off by default (like the normal embeddings). I had much better luck using
gemma2
as the model to generate summaries. It does make indexing take quite a bit longer though when using a locally hosted model.I also added some in-memory caching so that repeatedly editing a page doesn't cause the same thing to be regenerating over and over.