rag + markdown, final touches
frdel committed
Jun 17, 2025 at 13:37 UTC
4767db3b60e5ea5fbd0f8bbc6cf1dddd0012044f
7 files changed
+43
-18
docker/base/Dockerfile
+2
-1
@@ -18,10 +18,11 @@ ENV TZ=UTC
18
# Copy contents of the project to /
19
COPY ./fs/ /
20
21
-# install packages software
21
+# install packages software (split for better cache management)
22
RUN bash /ins/install_base_packages1.sh
23
RUN bash /ins/install_base_packages2.sh
24
RUN bash /ins/install_base_packages3.sh
25
+RUN bash /ins/install_base_packages4.sh
26
27
# install python after packages to ensure version overriding
28
RUN bash /ins/install_python.sh
docker/base/fs/ins/install_base_packages3.sh
-2
@@ -10,6 +10,4 @@ echo "====================BASE PACKAGES3 NPM===================="
10
11
# we shall not install npx separately, it's discontinued and some versions are broken
12
# npm i -g npx
13
-npm i -g shx
14
-
13
echo "====================BASE PACKAGES3 END===================="
docker/base/fs/ins/install_base_packages4.sh
new
+9
@@ -0,0 +1,9 @@
1
+#!/bin/bash
2
+set -e
3
+
4
+echo "====================BASE PACKAGES4 START===================="
5
+
6
+apt-get install -y --no-install-recommends \
7
+ tesseract-ocr tesseract-ocr-script-latn poppler-utils
8
+
9
+echo "====================BASE PACKAGES4 END===================="
\ No newline at end of file
docker/run/fs/ins/install_additional.sh
+1
-6
@@ -4,9 +4,4 @@
4
# bash /ins/install_playwright.sh "$@"
5
6
# searxng - moved to base image
7
-# bash /ins/install_searxng.sh "$@"
8
-
9
-#TODO : move to base image
10
-
11
-apt-get install -y --no-install-recommends \
12
- tesseract-ocr-all poppler-utils
\ No newline at end of file
7
+# bash /ins/install_searxng.sh "$@"
\ No newline at end of file
prompts/default/agent.system.tool.response.md
+2
-1
@@ -3,7 +3,8 @@ final answer to user
3
ends task processing use only when done or no task active
4
put result in text arg
5
always write full file paths
6
-always use markdown formatting headers bold text lists emojis improve readability
6
+always use markdown formatting headers bold text lists
7
+use emojis as icons improve readability
8
prefer using tables
9
output full file paths not only names they are clickable
10
images shown with 
prompts/default/fw.document_query.optmimize_query.md
+28
-7
@@ -1,7 +1,28 @@
1
-You are an AI assistant being part of a larger RAG system based on vector similarity search.
2
-Your job is to take a human written question and convert it into a concise vector store search query.
3
-The goal is to yield as many correct results and as few false positives as possible.
4
-!! You will be given a "Search Query".
5
-!! The response should ONLY contain the optimized search query
6
-!! Do not include any other text, confirmations or explanations. Do not prefix your response.
7
-!! You are working as a tool and not as a conversational agent.
1
+# AI role
2
+- You are an AI assistant being part of a larger RAG system based on vector similarity search
3
+- Your job is to take a human written question and convert it into a concise vector store search query
4
+- The goal is to yield as many correct results and as few false positives as possible
5
+
6
+# Input
7
+- you are provided with original search query as user message
8
+
9
+# Response rules !!!
10
+- respond only with optimized result query text
11
+- no text before or after
12
+- no conversation, you are a tool agent, not a conversational agent
13
+
14
+# Optimized query
15
+- optimized query is consise, short and to the point
16
+- contains only keywords and phrases, no full sentences
17
+- include alternatives and variations for better coverage
18
+
19
+
20
+# Examples
21
+User: What is the capital of France?
22
+Agent: france capital city
23
+
24
+User: What does it say about transmission?
25
+Agent: transmission gearbox automatic manual
26
+
27
+User: What did John ask Monica on Tuesday?
28
+Agent: john monica conversation dialogue question ask tuesday
python/helpers/document_query.py
+1
-1
@@ -40,7 +40,7 @@ from agent import Agent
40
from langchain.text_splitter import RecursiveCharacterTextSplitter
41
42
43
-DEFAULT_SEARCH_THRESHOLD = 0.6
43
+DEFAULT_SEARCH_THRESHOLD = 0.5
44
45
class DocumentQueryStore:
46
"""