Spaces:
Paused
Paused
Initial Files
Browse filesFiles changed (4)
- CaddyfileAdded+16
- DockerfileAdded+33
- package.jsonAdded+8
- start.shAdded+26
12345678910111213141516:7860 { # Route WebSocket streams (iii-stream on 3112) handle /stream/* { reverse_proxy localhost:3112 }
# Route REST API endpoints (iii-http on 3111) handle /agentmemory/* { reverse_proxy localhost:3111 }
# Route Viewer dashboard (on 3113) handle { reverse_proxy localhost:3113 }}123456789101112131415161718192021222324252627282930313233FROM node:20-bookworm
# Install CaddyRUN apt-get update && apt-get install -y debian-keyring debian-archive-keyring apt-transport-https curl unzip \ && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg \ && curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list \ && apt-get update && apt-get install -y caddy \ && apt-get clean && rm -rf /var/lib/apt/lists/*
# Set up user and environmentRUN userdel -r node && useradd -m -u 1000 userWORKDIR /app
# Install agentmemory dependenciesCOPY package.json /app/RUN npm install
# Set permissionsRUN chown -R user:user /app
# Switch to non-root userUSER userENV HOME=/app
# Copy Caddyfile and startup scriptCOPY --chown=user:user Caddyfile /app/CaddyfileCOPY --chown=user:user start.sh /app/start.shRUN chmod +x /app/start.sh
# Expose HF default portEXPOSE 7860
CMD ["/app/start.sh"]12345678{ "name": "agentmemory-hf", "version": "1.0.0", "dependencies": { "@agentmemory/agentmemory": "^0.9.21", "@agentmemory/mcp": "^0.9.21" }}1234567891011121314151617181920212223242526#!/bin/bash
# Create config foldermkdir -p ~/.agentmemory
# Dynamically write env config from environment variablescat <<EOF > ~/.agentmemory/.env# =============================================================================# agentmemory configuration (Hugging Face Spaces)# =============================================================================GEMINI_API_KEY=${GEMINI_API_KEY}GEMINI_MODEL=gemini-2.5-flashEMBEDDING_PROVIDER=geminiCONSOLIDATION_ENABLED=trueGRAPH_EXTRACTION_ENABLED=trueAGENTMEMORY_REFLECT=trueEOF
# Start agentmemory daemon in the backgroundnpx @agentmemory/agentmemory &
# Wait for bootsleep 5
# Start Caddy reverse proxycaddy run --config /app/Caddyfile --adapter caddyfileCaddyfileAdded+16
DockerfileAdded+33
package.jsonAdded+8
start.shAdded+26