[PR #601] [MERGED] [Feat] Query mode to return no-result when no context found #3413

Closed
opened 2026-02-22 18:33:44 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/601
Author: @timothycarambat
Created: 1/16/2024
Status: Merged
Merged: 1/16/2024
Merged by: @timothycarambat

Base: masterHead: 597-query-document-requirement


📝 Commits (3)

  • c74dab5 Query mode to return no-result when no context found
  • 4dcb8fe update default error for sync chat
  • 74fdcb5 remove unnecessary type conversion

📊 Changes

7 files changed (+61 additions, -117 deletions)

View changed files

📝 frontend/src/components/WorkspaceChat/ChatContainer/index.jsx (+0 -15)
📝 frontend/src/models/workspace.js (+0 -16)
📝 server/endpoints/api/workspace/index.js (+6 -5)
📝 server/endpoints/chat.js (+0 -80)
📝 server/swagger/openapi.json (+1 -1)
📝 server/utils/chats/index.js (+26 -0)
📝 server/utils/chats/stream.js (+28 -0)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #597

What is in this change?

Update query mode to no longer return a response from the LLM if zero context is found from the vector db. It makes more sense for query to be more strict and have no response if nothing is found since otherwise the model will likely hallucinate or return a refusal response - wasting tokens.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/601 **Author:** [@timothycarambat](https://github.com/timothycarambat) **Created:** 1/16/2024 **Status:** ✅ Merged **Merged:** 1/16/2024 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `597-query-document-requirement` --- ### 📝 Commits (3) - [`c74dab5`](https://github.com/Mintplex-Labs/anything-llm/commit/c74dab5d1a276914cd0a98e9e0e61b230682913d) Query mode to return no-result when no context found - [`4dcb8fe`](https://github.com/Mintplex-Labs/anything-llm/commit/4dcb8fe52bed4109fea27094e45ebebe13cd5b0e) update default error for sync chat - [`74fdcb5`](https://github.com/Mintplex-Labs/anything-llm/commit/74fdcb5af6a45aca6ea75200ce28c171daa759d0) remove unnecessary type conversion ### 📊 Changes **7 files changed** (+61 additions, -117 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/components/WorkspaceChat/ChatContainer/index.jsx` (+0 -15) 📝 `frontend/src/models/workspace.js` (+0 -16) 📝 `server/endpoints/api/workspace/index.js` (+6 -5) 📝 `server/endpoints/chat.js` (+0 -80) 📝 `server/swagger/openapi.json` (+1 -1) 📝 `server/utils/chats/index.js` (+26 -0) 📝 `server/utils/chats/stream.js` (+28 -0) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #597 ### What is in this change? Update `query` mode to no longer return a response from the LLM if zero context is found from the vector db. It makes more sense for query to be more strict and have no response if nothing is found since otherwise the model will likely hallucinate or return a refusal response - wasting tokens. ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:33:44 -05:00
yindo closed this issue 2026-02-22 18:33:44 -05:00
yindo changed title from [PR #601] [Feat] Query mode to return no-result when no context found to [PR #601] [MERGED] [Feat] Query mode to return no-result when no context found 2026-06-05 15:13:17 -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#3413