v2.0.2: Production release with role parsing fix and threshold correction

This commit is contained in:
Vera-AI
2026-03-27 13:42:22 -05:00
parent c78b3f2bb6
commit 34304a79e0
3 changed files with 13 additions and 41 deletions

View File

@@ -4,15 +4,6 @@
# Build arguments: # Build arguments:
# APP_UID: User ID for appuser (default: 999) # APP_UID: User ID for appuser (default: 999)
# APP_GID: Group ID for appgroup (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 # Stage 1: Builder
FROM python:3.11-slim AS builder FROM python:3.11-slim AS builder
@@ -20,9 +11,7 @@ FROM python:3.11-slim AS builder
WORKDIR /app WORKDIR /app
# Install build dependencies # Install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/*
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install # Copy requirements and install
COPY requirements.txt . COPY requirements.txt .
@@ -38,29 +27,25 @@ ARG APP_UID=999
ARG APP_GID=999 ARG APP_GID=999
# Create group and user with specified UID/GID # Create group and user with specified UID/GID
RUN groupadd -g ${APP_GID} appgroup && \ RUN groupadd -g ${APP_GID} appgroup && useradd -u ${APP_UID} -g appgroup -r -m -s /bin/bash appuser
useradd -u ${APP_UID} -g appgroup -r -m -s /bin/bash appuser
# Copy installed packages from builder # Copy installed packages from builder
COPY --from=builder /root/.local /home/appuser/.local COPY --from=builder /root/.local /home/appuser/.local
ENV PATH=/home/appuser/.local/bin:$PATH ENV PATH=/home/appuser/.local/bin:$PATH
# Create directories for mounted volumes # Create directories for mounted volumes
RUN mkdir -p /app/config /app/prompts /app/static /app/logs && \ RUN mkdir -p /app/config /app/prompts /app/logs && chown -R ${APP_UID}:${APP_GID} /app
chown -R ${APP_UID}:${APP_GID} /app
# Copy application code # Copy application code
COPY app/ ./app/ COPY app/ ./app/
# Copy default config and prompts (can be overridden by volume mounts) # Copy default config and prompts (can be overridden by volume mounts)
COPY config.toml /app/config/config.toml COPY config/config.toml /app/config/config.toml
COPY static/curator_prompt.md /app/prompts/curator_prompt.md COPY prompts/curator_prompt.md /app/prompts/curator_prompt.md
COPY static/systemprompt.md /app/prompts/systemprompt.md COPY prompts/systemprompt.md /app/prompts/systemprompt.md
# Create symlinks for backward compatibility # Create symlink for config backward compatibility
RUN ln -sf /app/config/config.toml /app/config.toml && \ 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
# Set ownership # Set ownership
RUN chown -R ${APP_UID}:${APP_GID} /app && chmod -R u+rw /app RUN chown -R ${APP_UID}:${APP_GID} /app && chmod -R u+rw /app
@@ -70,11 +55,10 @@ ENV TZ=UTC
EXPOSE 11434 EXPOSE 11434
# Health check using Python (no curl needed in slim image) # Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:11434/')" || exit 1
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:11434/')" || exit 1
# Switch to non-root user # Switch to non-root user
USER appuser USER appuser
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "11434"]" ENTRYPOINT ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "11434"]

View File

@@ -2,18 +2,15 @@
ollama_host = "http://10.0.0.10:11434" ollama_host = "http://10.0.0.10:11434"
qdrant_host = "http://10.0.0.22:6333" qdrant_host = "http://10.0.0.22:6333"
qdrant_collection = "memories" qdrant_collection = "memories"
embedding_model = "snowflake-arctic-embed2" embedding_model = "mxbai-embed-large"
debug = false debug = false
[layers] [layers]
# Note: system_token_budget removed - system prompt is never truncated
semantic_token_budget = 25000 semantic_token_budget = 25000
context_token_budget = 22000 context_token_budget = 22000
semantic_search_turns = 2 semantic_search_turns = 2
semantic_score_threshold = 0.6 semantic_score_threshold = 0.3
[curator] [curator]
# Daily curation: processes recent 24h of raw memories
# Monthly mode is detected automatically by curator_prompt.md (day 01)
run_time = "02:00" run_time = "02:00"
curator_model = "gpt-oss:120b" curator_model = "gpt-oss:120b"

View File

@@ -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.