#I notice in chef projects there is just ONE chat thread for the project. D

6 messages · Page 1 of 1 (latest)

covert igloo
#

Do I just KEEP talking to this one project forever? How does context length work?

frozen gyroBOT
#

Hi @covert igloo. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

In Chef projects, it is true that there is typically a single chat thread per project. This design means you continue interacting with the same thread as you build and iterate on your app. The context for the conversation is managed by the underlying AI agent, which determines how much of the previous conversation is included when generating responses.

Regarding context length: AI models have a limited context window, so not all previous messages are always included. Convex provides options to control what history is included in each message. For example, you can configure how many recent messages are included, whether to use text or vector search to find relevant past messages, and whether to search across other threads (though in Chef, you usually have just one thread). Here’s an example of how context options can be set:

const result = await thread.generateText({ prompt }, {
  contextOptions: {
    includeToolCalls: false,
    recentMessages: 100,
    searchOptions: {
      limit: 10,
      textSearch: false,
      vectorSearch: false,
      messageRange: { before: 2, after: 1 },
    },
    searchOtherThreads: false,
  },
});
#

This means that, even if you keep talking to the same project thread "forever," only a configurable subset of the conversation history is used as context for each new message. This helps manage the context length and ensures the AI can respond effectively without being overwhelmed by too much history. If you want to manually control which messages are included as context, you can fetch and customize the message history yourself before generating a new response Configuring the context of messages Using a user’s previous conversations as context manually.

So, yes, you keep using the same thread, but the context window is managed to include only the most relevant or recent parts of the conversation.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@covert igloo Kapa.ai is still learning and improving, please let me know how I did by reacting below.

covert igloo
#

How confident are you that you are not halucinating?