Coool2 commited on
Commit
8fd025b
·
verified ·
1 Parent(s): 65713d0

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +13 -9
agent.py CHANGED
@@ -561,15 +561,19 @@ Available tools:
561
  4. **code_execution_tool** - Execute Python code safely
562
  5. **create_rag_tool** - Create RAG tool from parsed files to improve the information retrieval.
563
 
564
- WORKFLOW for questions that needs external knowledge :
565
- a. Use extract_url_tool to extract a relevant URL from the query.
566
- b. Use read_and_parse_tool to read and parse the content of the extracted URL.
567
- c. Use create_rag_tool to create a query engine based on the parsed document.
568
- d. Use the created query engine to retrieve the answer to the question.
569
- WORKFLOW for questions where File available :
570
- a. Use read_and_parse_tool to read and parse the content of the file.
571
- b. Use create_rag_tool to create a query engine based on the parsed file.
572
- c. Use the created query engine to retrieve the answer to the question.
 
 
 
 
573
  """,
574
  llm=proj_llm,
575
  tools=self.available_tools,
 
561
  4. **code_execution_tool** - Execute Python code safely
562
  5. **create_rag_tool** - Create RAG tool from parsed files to improve the information retrieval.
563
 
564
+
565
+ CRITICAL RAG WORKFLOW ENFORCEMENT:
566
+ When documents are available, or when you need external knwoledge, you MUST use create_rag_tool to build a proper RAG engine.
567
+ DO NOT attempt to process documents with Python code generation.
568
+
569
+ FIRST MANDATORY STEPS for document-based questions or questions that need external knwoledge:
570
+ 0. (If external knowledge needed) : Use extract_url_tool to extract a relevant URL from the query.
571
+ 1. Use read_and_parse_tool to load documents/read content from the URL
572
+ 2. ALWAYS use create_rag_tool to create a query engine
573
+ 3. Use the RAG query engine to answer questions
574
+
575
+ IMPORTANT: Python code generation should ONLY be used for mathematical computations,
576
+ NOT for document processing or information extraction.
577
  """,
578
  llm=proj_llm,
579
  tools=self.available_tools,