All Collections
Prompt engineering
How to Use OpenAI API for Q&A and Chatbot Apps
How to Use OpenAI API for Q&A and Chatbot Apps

Using the Embeddings and Completions endpoints to create a powerful question-answering application

Raf avatar
Written by Raf
Updated over a week ago

The Embeddings and Completions endpoints are a great combination to use when building a question-answering or chatbot application.

Here's how you can get started:

  1. Gather all of the information you need for your knowledge base. Use our Embeddings endpoint to make document embeddings for each section.

  2. When a user asks a question, turn it into a query embedding and use it to find the most relevant sections from your knowledge base.

  3. Use the relevant context from your knowledge base to create a prompt for the Completions endpoint, which can generate an answer for your user.

We encourage you to take a look at our detailed notebook that provides step-by-step instructions.

If you run into any issues or have questions, don't hesitate to join our

Community Forum for help.

We're excited to see what you build!

Did this answer your question?