From 34304a79e01b16254308f3891a60a27fd4da5eda Mon Sep 17 00:00:00 2001 From: Vera-AI Date: Fri, 27 Mar 2026 13:42:22 -0500 Subject: [PATCH] v2.0.2: Production release with role parsing fix and threshold correction --- Dockerfile | 38 +++++++++++--------------------------- config/config.toml | 7 ++----- prompts/systemprompt.md | 9 --------- 3 files changed, 13 insertions(+), 41 deletions(-) diff --git a/Dockerfile b/Dockerfile index 356079c..da5a209 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,15 +4,6 @@ # Build arguments: # APP_UID: User ID for appuser (default: 999) # APP_GID: Group ID for appgroup (default: 999) -# -# Build example: -# docker build --build-arg APP_UID=1000 --build-arg APP_GID=1000 -t vera-ai . -# -# Runtime environment variables: -# TZ: Timezone (default: UTC) -# APP_UID: User ID (informational) -# APP_GID: Group ID (informational) -# VERA_LOG_DIR: Debug log directory (default: /app/logs) # Stage 1: Builder FROM python:3.11-slim AS builder @@ -20,9 +11,7 @@ FROM python:3.11-slim AS builder WORKDIR /app # Install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/* # Copy requirements and install COPY requirements.txt . @@ -38,29 +27,25 @@ ARG APP_UID=999 ARG APP_GID=999 # Create group and user with specified UID/GID -RUN groupadd -g ${APP_GID} appgroup && \ - useradd -u ${APP_UID} -g appgroup -r -m -s /bin/bash appuser +RUN groupadd -g ${APP_GID} appgroup && useradd -u ${APP_UID} -g appgroup -r -m -s /bin/bash appuser # Copy installed packages from builder COPY --from=builder /root/.local /home/appuser/.local ENV PATH=/home/appuser/.local/bin:$PATH # Create directories for mounted volumes -RUN mkdir -p /app/config /app/prompts /app/static /app/logs && \ - chown -R ${APP_UID}:${APP_GID} /app +RUN mkdir -p /app/config /app/prompts /app/logs && chown -R ${APP_UID}:${APP_GID} /app # Copy application code COPY app/ ./app/ # Copy default config and prompts (can be overridden by volume mounts) -COPY config.toml /app/config/config.toml -COPY static/curator_prompt.md /app/prompts/curator_prompt.md -COPY static/systemprompt.md /app/prompts/systemprompt.md +COPY config/config.toml /app/config/config.toml +COPY prompts/curator_prompt.md /app/prompts/curator_prompt.md +COPY prompts/systemprompt.md /app/prompts/systemprompt.md -# Create symlinks for backward compatibility -RUN ln -sf /app/config/config.toml /app/config.toml && \ - ln -sf /app/prompts/curator_prompt.md /app/static/curator_prompt.md && \ - ln -sf /app/prompts/systemprompt.md /app/static/systemprompt.md +# Create symlink for config backward compatibility +RUN ln -sf /app/config/config.toml /app/config.toml # Set ownership RUN chown -R ${APP_UID}:${APP_GID} /app && chmod -R u+rw /app @@ -70,11 +55,10 @@ ENV TZ=UTC EXPOSE 11434 -# Health check using Python (no curl needed in slim image) -HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:11434/')" || exit 1 +# Health check +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:11434/')" || exit 1 # Switch to non-root user USER appuser -CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "11434"]" \ No newline at end of file +ENTRYPOINT ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "11434"] diff --git a/config/config.toml b/config/config.toml index 1ee050e..94cfe44 100644 --- a/config/config.toml +++ b/config/config.toml @@ -2,18 +2,15 @@ ollama_host = "http://10.0.0.10:11434" qdrant_host = "http://10.0.0.22:6333" qdrant_collection = "memories" -embedding_model = "snowflake-arctic-embed2" +embedding_model = "mxbai-embed-large" debug = false [layers] -# Note: system_token_budget removed - system prompt is never truncated semantic_token_budget = 25000 context_token_budget = 22000 semantic_search_turns = 2 -semantic_score_threshold = 0.6 +semantic_score_threshold = 0.3 [curator] -# Daily curation: processes recent 24h of raw memories -# Monthly mode is detected automatically by curator_prompt.md (day 01) run_time = "02:00" curator_model = "gpt-oss:120b" diff --git a/prompts/systemprompt.md b/prompts/systemprompt.md index 27eff8a..8b13789 100644 --- a/prompts/systemprompt.md +++ b/prompts/systemprompt.md @@ -1,10 +1 @@ -You have persistent memory across all conversations with this user. -**Important:** The latter portion of your conversation context contains memories retrieved from a vector database. These are curated summaries of past conversations, not live chat history. - -Use these memories to: -- Reference previous decisions and preferences -- Draw on relevant past discussions -- Provide personalized, context-aware responses - -If memories seem outdated or conflicting, ask for clarification.