Skip to main content


The chat engine is a quick and simple way to chat with the data in your index.

const retriever = index.asRetriever();
const chatEngine = new ContextChatEngine({ retriever });

// start chatting
const response = await{ message: query });

The chat function also supports streaming, just add stream: true as an option:

const stream = await{ message: query, stream: true });
for await (const chunk of stream) {

Api References