About the conversation API again, we are having so...
# community-help
n
About the conversation API again, we are having some difficulty getting it to work for our use case, like it kind of works but it is not great, I was wondering if you had more documentation about how it actually works? Like how do you manage the interaction between typesense's collection and the LLM? What is the flow of data when the user makes a request?
Before we build our own version I want to make sure we are not missing some basic tuning we could do...
Maybe most of what we need can be achieved with a better system prompt but it is hard to design it without knowing how the data flows
j
We take the question, along with all the search parameters you specified (and you want to make sure you're using
query_by: embedding
to do a semantic search so retrieval works properly), fetch the top results for that search query, and then send it to the LLM along with the system prompt
For follow-up questions we do this:
One key thing to take into account is the
max_bytes
setting in the conversation model resource. If that context window is too low, then you might get odd results
Separately, here's another thing to consider: https://threads.typesense.org/2J4577a
n
Yes thanks that's super helpful. I had seen that other thread but wanted to make sure I understood the limitations before going that way.
Do you know of examples out there that use your flow as is?
j
This is a demo we just wrapped up last week: https://conversational-search-pg-essays.typesense.org
🚀 1
👍 1
s
@Jason Bosco Is it also possible to add azure-openai. Furthermore, before sending the searchresult to the LLM, is it possible to somehow send it to a reranker (open-source or e.g. cohere) Another major thing is the search itself. Since you mentioned the use query_by "embedding", is it generally possible to also add additional factors, other than just vector search
n
Super helpful thanks for the demo, it helps anchor the core use case. I think I gravitate more towards the other approach you highlighted where a user actually wants a search but does not necessarily know how to set the correct filters. Or when a follow up search depends on previous results
f
We actually have a demo that may match your usecase. Instead of human readable responses, the LLM instead formats the correct query to Typesense. Here's a link to the source code and here's the live versions
🙌 1
n
Really cool thanks!
Did you try to add a conversation mode on top that would help the user refine results or ask for associated results? For example once you have a first set of results, ask for cars in a similar price range but different brand?
f
This demo is limited to just generating queries, and does not keep track of the current convo context, so all subsequent queries won't keep the previous ones in mind
n
Ok, I'll see what we can do with the previous responses context
🙌 1