[GH-ISSUE #144] Documents not used when in conversation mode #95

Closed
opened 2026-02-22 18:17:52 -05:00 by yindo · 4 comments
Owner

Originally created by @DavidBlore on GitHub (Jul 14, 2023).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/144

When in conversation (chat) mode, your documents aren’t used to answer queries.

This defeats the purpose of being able to chat with your documents. Currently, you can only use the query mode to ask questions that actually query your documents. Then you have to switch back to chat mode to use the chat history to continue asking about them. However, it will then stop searching for further sources as you are back in chat mode.

A code snippet (if using Pinecone) to support my suspicion of this behaviour is given below. It is also clear from just using the application that this is the case:

...

const vectorStore = await PineconeStore.fromExistingIndex(this.embedder(), {
      pineconeIndex,
      namespace,
    });

    const memory = new VectorStoreRetrieverMemory({
      vectorStoreRetriever: vectorStore.asRetriever(1),
      memoryKey: "history",
    });

    const model = this.llm();
    const prompt =
      PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is very casual and talkative and responds with a friendly tone. If the AI does not know the answer to a question, it truthfully says it does not know.
  Relevant pieces of previous conversation:
  {history}
  
  Current conversation:
  Human: {input}
  AI:`);

    const chain = new LLMChain({ llm: model, prompt, memory });
    const response = await chain.call({ input });
    return { response: response.text, sources: [], message: false };
  },

...
Originally created by @DavidBlore on GitHub (Jul 14, 2023). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/144 When in conversation (chat) mode, your documents aren’t used to answer queries. This defeats the purpose of being able to chat with your documents. Currently, you can only use the query mode to ask questions that actually query your documents. Then you have to switch back to chat mode to use the chat history to continue asking about them. However, it will then stop searching for further sources as you are back in chat mode. A code snippet (if using Pinecone) to support my suspicion of this behaviour is given below. It is also clear from just using the application that this is the case: ``` ... const vectorStore = await PineconeStore.fromExistingIndex(this.embedder(), { pineconeIndex, namespace, }); const memory = new VectorStoreRetrieverMemory({ vectorStoreRetriever: vectorStore.asRetriever(1), memoryKey: "history", }); const model = this.llm(); const prompt = PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is very casual and talkative and responds with a friendly tone. If the AI does not know the answer to a question, it truthfully says it does not know. Relevant pieces of previous conversation: {history} Current conversation: Human: {input} AI:`); const chain = new LLMChain({ llm: model, prompt, memory }); const response = await chain.call({ input }); return { response: response.text, sources: [], message: false }; }, ... ```
yindo closed this issue 2026-02-22 18:17:52 -05:00
Author
Owner

@TychoML commented on GitHub (Jul 14, 2023):

Interesting, I am not encountering this behaviour when using Pinecone in the Docker version. In other words, in chat mode, I get answers to questions from the knowledge base that are impossible for GPT to know itself, and sources to the PDFs used are provided.

@TychoML commented on GitHub (Jul 14, 2023): Interesting, I am not encountering this behaviour when using Pinecone in the Docker version. In other words, in chat mode, I get answers to questions from the knowledge base that are impossible for GPT to know itself, and sources to the PDFs used are provided.
Author
Owner

@DavidBlore commented on GitHub (Jul 14, 2023):

@TychoML Very strange. Do you get citations?

@DavidBlore commented on GitHub (Jul 14, 2023): @TychoML Very strange. Do you get citations?
Author
Owner

@TychoML commented on GitHub (Jul 14, 2023):

@DavidBlore Yes indeed I got citations in chat mode. I verified it before responding to your post just to be sure.

@TychoML commented on GitHub (Jul 14, 2023): @DavidBlore Yes indeed I got citations in chat mode. I verified it before responding to your post just to be sure.
Author
Owner

@DavidBlore commented on GitHub (Jul 14, 2023):

@TychoML My apologies, I see this was fixed by #112 !

@DavidBlore commented on GitHub (Jul 14, 2023): @TychoML My apologies, I see this was fixed by #112 !
yindo changed title from Documents not used when in conversation mode to [GH-ISSUE #144] Documents not used when in conversation mode 2026-06-05 14:33:27 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#95