Building a stripe chatbot with function calling and vector store

Hello everyone,

I’m building a chatbot that performs Stripe API actions using function calling. The chatbot stores parameters in a vector database (I’m using an OpenSearch dense-vector index) and makes Stripe requests in sequence. However, I’m encountering some issues:

  1. Incorrect Function Calls: Sometimes, when I ask the chatbot to create a payment link, it calls the wrong function—for example, it creates a price ID object instead of a payment link.
  2. Unwanted Context Retrieval: In a new chat session, if I prompt the chatbot to create a payment link, I expect it to ask me for a price ID or guide me to create one, or perhaps list existing prices. Instead, it retrieves context from the vector database that includes previous price and quantity information from past sessions, which is not desired.
  3. Vector Search Challenges: I need help with performing vector searches effectively. Currently, I embed the user query using OpenAI embeddings and perform a vector search to return relevant data. I’m not sure if I’m implementing the vector search correctly or optimally, and any advice on how to improve this would be greatly appreciated.

My goal is for the chatbot to retrieve and use context only when necessary, and to perform accurate vector searches to enhance its responses.

Since I’m new to building chatbots with function calling and vector databases, I’d appreciate any guidance or recommendations on how to address these issues.

Thank you!