mindsdb icon indicating copy to clipboard operation
mindsdb copied to clipboard

[Bug]: Agent is not able to query knowledge base

Open Better-Boy opened this issue 9 months ago • 1 comments

Short description of current behavior

Agent is not able to query the knowledge though the knowledge base exists and is working fine.

Action: kb_query_tool
Action Input: "SELECT * FROM `mindsdb.2506_00075_kb` WHERE content = 'methodology';"
Observation: Error executing knowledge base query: Can't select from <mindsdb.2506_00075_kb> in project: unknown. Please check that the knowledge base exists and your query syntax is correct.
Thought:It seems there was an error in querying the knowledge base for the specific term "methodology." I will attempt a broader search to retrieve relevant sections that might contain the methodology used in the research paper.

Let's try querying the knowledge base again with a broader search term.

When I ran the same query via the mindsdb UI editor, it gave the error - Can't select from <mindsdb.2506_00075_kb> in project: unknown.

After removing the ` (backtik) character, the query works fine.

Video or screenshots

No response

Expected behavior

No response

How to reproduce the error

  1. Create a KB
  2. Create an agent and attach the KB created from step 1
  3. Query the agent and observe the logs

Anything else?

No response

Better-Boy avatar Jun 23 '25 17:06 Better-Boy

Well what i think we need to remove the backtick somehow for querying the table from mindsdb

Can i fix this regex by introducing a private method in the k query tool ?

rawathemant246 avatar Jun 23 '25 18:06 rawathemant246