Ask AI

How to Create an AI Assistant with a Knowledge Base (OpenAI Assistant)

OpenAI assistants on Latenode are primarily designed for building chatbots and advanced text-generation assistants that require specific behavior settings and the ability to maintain large information context (such as your internal documentation). They allow you to create intelligent assistants that can answer questions, perform tasks, and use external tools. With a built-in knowledge base (RAG), the assistant gains access to up-to-date information and context, making it much more useful.


Step 1: Create an Assistant in OpenAI

  1. Go to the OpenAI Playground. Here you'll see a list of your assistants (as you can see, I already have one)
  1. Click "Create Assistant".
    1. Notion image
  1. Give your assistant a name.
    1. Notion image
  1. Choose a model (I usually prefer gpt-4o-mini because it offers a good balance between cost and performance).
    1. Notion image
  1. Configure the system instructions — briefly explain how the assistant should act.
    1. Notion image

Let’s say we want to create a sales representative assistant.

Here’s a simple instruction example:

You are a helpful assistant for a sales representative.

Step 2: Add a Knowledge Base (RAG)

  1. In the "Files" section, enable the file search toggle to activate the storage functionality.
    1. Notion image
  1. Then click + Files
    1. Notion image
  1. Upload PDF, TXT, or other documents that contain important information (e.g., your documentation). For example, I’ll upload a file called sales_assistant_instructions.txt
    1. Notion image

These files will be used via Retrieval-Augmented Generation (RAG) — the assistant will treat them as its memory.

Make sure your files are well-structured: use headings, bullet points, and logical sections.

Step 3: Test the Assistant

On the right side of the screen, you can test your assistant.

Notion image
 

Let’s ask a question that pulls from the uploaded knowledge base.

Example:

Question: "Do we have any secret promo codes for important clients?"

Notion image

As you can see, the assistant accessed the knowledge base and provided a correct answer.

And that’s it — you’ve created your first assistant with a knowledge base!


Getting the API Key

To get your assistant’s API key, go to the dashboard section where you'll find the API Keys tab.

Notion image

Here, you can see all your keys and create a new one.

Notion image

Select a project, name the key, and set the permissions.

Notion image

Then copy your key and save it somewhere safe.

Notion image

Connecting the Assistant on Latenode

Latenode offers many tools for fully remote management of your assistants, including creation, configuration, file updates, and more.

Notion image

But to get started, the most basic and universal tool is Send Message to Assistant (Complete Flow).

Notion image

Add it and authorize using your API key.

Notion image

Then select the assistant you created, define the role (who the message is from), and enter your message (again, you can use the same test question).

Notion image

Run the scenario and get the response.

Notion image

Your assistant is working!

Each conversation with the assistant creates a "thread". If you specify an existing thread ID, the assistant will maintain the context of previous messages — which is essential for chatbot functionality.

💡 Useful Tips

  • Regularly update your knowledge files when your product changes.
  • Use FAQs or real user questions as the foundation of your knowledge base.
  • Don’t overload the assistant with huge files — break them into topics.

Free Template

To learn how to create a simple chatbot with context support,

Notion image

Thanks for reading!

Did this answer your question?
😞
😐
🤩