-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Vector Search & LLM Integration #5552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Conversation
Preview: bs-llm-demo.mp4 |
ChatGPT just opened integrations, would be lit if I could use ChatGPT to search Bookstack :) |
This is awesome Dan! Would be even more amazing to see integration with Ollama so we can self host everything locally and not have to worry about calling ChatGPT :) |
@ItsNoted local LLM support would be an important requirement really for an implementation since I know that matters a lot to our kind of audience, and when building I tested this in bulk using Ollama (since they are fairly OpenAI API compatible) and all seemed fairly functional. |
Also made models configurable. Tested system scales via 86k vector entries.
Added a formal object type to carry across vector search results. Added permission application and entity combining with vector search results. Also updated namespace from vectors to queries.
Allowing the vector query results and the LLM response to each come back over the same HTTP request at two different times via a somewhat standard. Uses a package for JS SSE client, since native browser client does not support over POST, which is probably important for this endpoint as we don't want crawlers or other bots abusing this via accidentally.
This is a proof of concept for some level of somewhat native LLM integration.
This manages vector indexing, searching and LLM querying, with vectors stored & queried in the local BookStack database, and an external LLM service (OpenAI, Ollama etc...) queried for embeddings & query execution using locally found vector-based results for context.
The result is a LLM generated response to user query, with a list of relevant BookStack content used for the query as reference.
Issues & Questionables
all-minilm
=384,openai:text-embedding-3-small
=1536,openai:text-embedding-3-large
=3072vector(1536)
mariadb column seemed to result in 0 hex values. Seems like the column size has to be correct, can't insert under?Considerations
Todo
Implementation Notes
proxy_buffering off; proxy_cache off;
.