Agent Zero AI framework
rag + markdown, final touches
frdel4767db3b60e5
diff --git a/docker/base/Dockerfile b/docker/base/Dockerfileindex bb7b2cc38..14febd005 100644--- a/docker/base/Dockerfile+++ b/docker/base/Dockerfile@@ -18,10 +18,11 @@ ENV TZ=UTC# Copy contents of the project to /COPY ./fs/ /-# install packages software+# install packages software (split for better cache management)RUN bash /ins/install_base_packages1.shRUN bash /ins/install_base_packages2.shRUN bash /ins/install_base_packages3.sh+RUN bash /ins/install_base_packages4.sh# install python after packages to ensure version overridingRUN bash /ins/install_python.shdiff --git a/docker/base/fs/ins/install_base_packages3.sh b/docker/base/fs/ins/install_base_packages3.shindex 0903810a2..c77f6d492 100644--- a/docker/base/fs/ins/install_base_packages3.sh+++ b/docker/base/fs/ins/install_base_packages3.sh@@ -10,6 +10,4 @@ echo "====================BASE PACKAGES3 NPM===================="# we shall not install npx separately, it's discontinued and some versions are broken# npm i -g npx-npm i -g shx-echo "====================BASE PACKAGES3 END===================="diff --git a/docker/base/fs/ins/install_base_packages4.sh b/docker/base/fs/ins/install_base_packages4.shnew file mode 100644index 000000000..45726ddc0--- /dev/null+++ b/docker/base/fs/ins/install_base_packages4.sh@@ -0,0 +1,9 @@+#!/bin/bash+set -e++echo "====================BASE PACKAGES4 START===================="++apt-get install -y --no-install-recommends \+ tesseract-ocr tesseract-ocr-script-latn poppler-utils++echo "====================BASE PACKAGES4 END===================="\ No newline at end of filediff --git a/docker/run/fs/ins/install_additional.sh b/docker/run/fs/ins/install_additional.shindex b2d79b6dc..53e78c43e 100644--- a/docker/run/fs/ins/install_additional.sh+++ b/docker/run/fs/ins/install_additional.sh@@ -4,9 +4,4 @@# bash /ins/install_playwright.sh "$@"# searxng - moved to base image-# bash /ins/install_searxng.sh "$@"--#TODO : move to base image--apt-get install -y --no-install-recommends \- tesseract-ocr-all poppler-utils\ No newline at end of file+# bash /ins/install_searxng.sh "$@"\ No newline at end of filediff --git a/prompts/default/agent.system.tool.response.md b/prompts/default/agent.system.tool.response.mdindex 215536260..57f92dac6 100644--- a/prompts/default/agent.system.tool.response.md+++ b/prompts/default/agent.system.tool.response.md@@ -3,7 +3,8 @@ final answer to userends task processing use only when done or no task activeput result in text argalways write full file paths-always use markdown formatting headers bold text lists emojis improve readability+always use markdown formatting headers bold text lists+use emojis as icons improve readabilityprefer using tablesoutput full file paths not only names they are clickableimages shown with diff --git a/prompts/default/fw.document_query.optmimize_query.md b/prompts/default/fw.document_query.optmimize_query.mdindex 88a6ddcef..7251a14b4 100644--- a/prompts/default/fw.document_query.optmimize_query.md+++ b/prompts/default/fw.document_query.optmimize_query.md@@ -1,7 +1,28 @@-You are an AI assistant being part of a larger RAG system based on vector similarity search.-Your job is to take a human written question and convert it into a concise vector store search query.-The goal is to yield as many correct results and as few false positives as possible.-!! You will be given a "Search Query".-!! The response should ONLY contain the optimized search query-!! Do not include any other text, confirmations or explanations. Do not prefix your response.-!! You are working as a tool and not as a conversational agent.+# AI role+- You are an AI assistant being part of a larger RAG system based on vector similarity search+- Your job is to take a human written question and convert it into a concise vector store search query+- The goal is to yield as many correct results and as few false positives as possible++# Input+- you are provided with original search query as user message++# Response rules !!!+- respond only with optimized result query text+- no text before or after+- no conversation, you are a tool agent, not a conversational agent++# Optimized query+- optimized query is consise, short and to the point+- contains only keywords and phrases, no full sentences+- include alternatives and variations for better coverage+++# Examples+User: What is the capital of France?+Agent: france capital city++User: What does it say about transmission?+Agent: transmission gearbox automatic manual++User: What did John ask Monica on Tuesday?+Agent: john monica conversation dialogue question ask tuesdaydiff --git a/python/helpers/document_query.py b/python/helpers/document_query.pyindex 0959e286e..62327f055 100644--- a/python/helpers/document_query.py+++ b/python/helpers/document_query.py@@ -40,7 +40,7 @@ from agent import Agentfrom langchain.text_splitter import RecursiveCharacterTextSplitter-DEFAULT_SEARCH_THRESHOLD = 0.6+DEFAULT_SEARCH_THRESHOLD = 0.5class DocumentQueryStore:"""