API

Mendable API Concepts

Mendable API Concepts

Mendable API allow you to use Mendable Search in any project.

Ingestion

Ingestion is the process of connecting your data sources to Mendable. You can ingest your data via the Mendable platform or via the Mendable API.

Conversation

A conversation is a series of 'chats' between a user and a Mendable AI assistant. To be able to start a conversation, you need to create a new conversation using the Mendable API endpoint. That will return a conversation_id which you can use to start a chat.

Chat

A chat is a single interaction between a user and a Mendable AI assistant. A chat is made up of a question and a response. The Mendable AI assistant uses the question to generate a response and saves on the respecitve conversation based on the conversation_id

History

A history is a list of previous chats in a conversation. The Mendable AI assistant uses the history to allow users to ask followup questions. At the moment, you must track the history on the front end and pass it to the endpoint in this format.

[
 { "prompt" : "How do I create a new project?", "response" : "You can create a new project by going to the projects page and clicking the new project button." },
 { "prompt" : "Ok, how do i rename it", "response" : "You cannot currently rename a project via the dashboard, contact Support for assistance." }
]

ANON_KEY vs API_KEY

ANON_KEY is safe to be used client-side. API_KEY is not. ANON_KEY is normally used with the REACT components and API_KEY is used with the Mendable API.

If you are using the ANON_KEY, remember to whitelist your URLs in the Mendable dashboard settings.

Previous
Overview