-
-
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.
Hi @ssddanbrown, Little suggestion: perhaps CrewAI might help? Less mature that LangGraph but highly powerful. The idea of indexing your own instance of Bookstack to privately "talk" to your own data and "retrieve" what you need, will definitely give to Bookstack the boost that it deserves. My best. |
@trendpx I spent some time on this last month, but got to a point where I was not happy with the vector search system. It didn't feel it was working well enough to justify the addition cost in a way which would generally work well out of the box. It can work for sure, but with a lot of environment/model/context specific tweaking. I want to revisit this with an alternative & simpler approach, without vectors, to test this kind of flow: User enters query -> LLM consulted to extract key search terms -> Terms used for BookStack search -> Relevant pages and original query sent to LLM for response. I'd prefer not to require any specific extra external platforms/libraries where possible. |
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;
.