From ffa9615591f67a133d28c6171f350b0dea7d4360 Mon Sep 17 00:00:00 2001 From: andy-vdg Date: Sun, 1 Nov 2026 12:39:38 +0100 Subject: [PATCH 1/3] hindsight: add ct/hindsight.sh Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017tcp6LGbfwMjznKx2UF1Zd --- ct/hindsight.sh | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 ct/hindsight.sh diff --git a/ct/hindsight.sh b/ct/hindsight.sh new file mode 100644 index 0000000000..116b1d7e4d --- /dev/null +++ b/ct/hindsight.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main" +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: andy-vdg +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://hindsight.vectorize.io/ + +APP="Hindsight" +var_tags="${var_tags:-ai;memory;mcp}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-12}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified +var_unprivileged="${var_unprivileged:-1}" + +export var_llm_provider="${var_llm_provider:-}" +export var_llm_api_key="${var_llm_api_key:-}" +export var_llm_model="${var_llm_model:-}" +export var_llm_base_url="${var_llm_base_url:-}" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -d /opt/hindsight ]]; then + msg_error "No Hindsight Installation Found!" + exit + fi + + if check_for_gh_release "hindsight" "vectorize-io/hindsight"; then + msg_info "Stopping Hindsight" + systemctl stop hindsight + msg_ok "Stopped Hindsight" + + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "hindsight" "vectorize-io/hindsight" "tarball" + PYTHON_VERSION="3.11" UV_PROJECT_DIR="/opt/hindsight" setup_uv + + msg_info "Updating Python Environment" + cd /opt/hindsight + $STD uv sync --locked --package hindsight-api-slim --extra local-ml + msg_ok "Updated Python Environment" + + msg_info "Starting Hindsight" + systemctl start hindsight + msg_ok "Started Hindsight" + msg_ok "Updated successfully!" + fi + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW}Access the API and its interactive docs using the following URL:${CL}" +echo -e "${GATEWAY}${BGN}http://${IP}:8888/docs${CL}" +echo -e "${INFO}${YW}API key: ~/hindsight.creds (inside the container)${CL}" From 1266e7e306d9220548a6d5ba11c7bc7d948d2abd Mon Sep 17 00:00:00 2001 From: andy-vdg Date: Sun, 1 Nov 2026 12:39:38 +0100 Subject: [PATCH 2/3] hindsight: add install/hindsight-install.sh Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017tcp6LGbfwMjznKx2UF1Zd --- install/hindsight-install.sh | 87 ++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 install/hindsight-install.sh diff --git a/install/hindsight-install.sh b/install/hindsight-install.sh new file mode 100644 index 0000000000..1523cc96fd --- /dev/null +++ b/install/hindsight-install.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: andy-vdg +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://hindsight.vectorize.io/ + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +PG_VERSION="18" PG_MODULES="pgvector" setup_postgresql +PG_DB_NAME="hindsight" PG_DB_USER="hindsight" PG_DB_EXTENSIONS="vector,pg_trgm,btree_gin" setup_postgresql_db +fetch_and_deploy_gh_release "hindsight" "vectorize-io/hindsight" "tarball" +PYTHON_VERSION="3.11" UV_PROJECT_DIR="/opt/hindsight" setup_uv + +msg_info "Setting up Python Environment" +cd /opt/hindsight +$STD uv sync --locked --package hindsight-api-slim --extra local-ml +msg_ok "Set up Python Environment" + +msg_info "Downloading Embedding and Reranker Models" +mkdir -p /opt/hindsight_data +HOME=/opt/hindsight_data $STD /opt/hindsight/.venv/bin/python -c "from sentence_transformers import SentenceTransformer, CrossEncoder; SentenceTransformer('BAAI/bge-small-en-v1.5'); CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2')" +msg_ok "Downloaded Embedding and Reranker Models" + +msg_info "Configuring Hindsight" +API_KEY=$(random_password 48) +cat </opt/hindsight.env +HINDSIGHT_API_HOST=0.0.0.0 +HINDSIGHT_API_PORT=8888 +HINDSIGHT_API_DATABASE_URL=postgresql://${PG_DB_USER}:${PG_DB_PASS}@127.0.0.1:5432/${PG_DB_NAME} +HINDSIGHT_API_TENANT_EXTENSION=hindsight_api.extensions.builtin.tenant:ApiKeyTenantExtension +HINDSIGHT_API_TENANT_API_KEY=${API_KEY} +HINDSIGHT_API_LLM_PROVIDER=${var_llm_provider:-none} +HINDSIGHT_API_LLM_API_KEY=${var_llm_api_key:-} +HINDSIGHT_API_LLM_MODEL=${var_llm_model:-} +HINDSIGHT_API_LLM_BASE_URL=${var_llm_base_url:-} +TRANSFORMERS_VERBOSITY=error +HF_HUB_VERBOSITY=error +TOKENIZERS_PARALLELISM=false +EOF +sed -i '/=$/d' /opt/hindsight.env +chmod 600 /opt/hindsight.env +cat <>~/hindsight.creds + +Hindsight API Key: ${API_KEY} +EOF +chmod 600 ~/hindsight.creds +msg_ok "Configured Hindsight" + +msg_info "Creating Service" +cat </etc/systemd/system/hindsight.service +[Unit] +Description=Hindsight API +Wants=network-online.target +After=network-online.target postgresql.service +Requires=postgresql.service + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/hindsight_data +Environment=HOME=/opt/hindsight_data +Environment=PYTHONUNBUFFERED=1 +EnvironmentFile=/opt/hindsight.env +ExecStart=/opt/hindsight/.venv/bin/hindsight-api +Restart=on-failure +RestartSec=10 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now hindsight +msg_ok "Created Service" + +if [[ -z "${var_llm_provider:-}" ]]; then + msg_warn "No LLM configured: Hindsight stores plain chunks only. Set HINDSIGHT_API_LLM_PROVIDER and its key in /opt/hindsight.env, then run systemctl restart hindsight" +fi + +motd_ssh +customize +cleanup_lxc From 7d0e490d6af691ffee0c42dec902e1e57a5e0f4c Mon Sep 17 00:00:00 2001 From: andy-vdg Date: Sun, 1 Nov 2026 12:39:38 +0100 Subject: [PATCH 3/3] hindsight: add json/hindsight.json Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017tcp6LGbfwMjznKx2UF1Zd --- json/hindsight.json | 72 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 json/hindsight.json diff --git a/json/hindsight.json b/json/hindsight.json new file mode 100644 index 0000000000..0fb294f4c5 --- /dev/null +++ b/json/hindsight.json @@ -0,0 +1,72 @@ +{ + "name": "Hindsight", + "slug": "hindsight", + "categories": [ + 20 + ], + "date_created": "2026-10-31", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 8888, + "documentation": "https://hindsight.vectorize.io/developer/installation", + "website": "https://hindsight.vectorize.io/", + "repository": "https://github.com/vectorize-io/hindsight", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/hindsight.webp", + "description": "Hindsight is an open-source memory server for AI agents. Agents retain conversations and documents into memory banks, then recall facts, entities and their history, or reflect on them, through a REST API, SDKs and an MCP server.", + "install_methods": [ + { + "type": "default", + "script": "ct/hindsight.sh", + "config_path": "/opt/hindsight.env", + "resources": { + "cpu": 2, + "ram": 2048, + "hdd": 12, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "app_vars": [ + { + "name": "var_llm_provider", + "label": "LLM Provider", + "type": "text", + "help": "Empty for none: memories are stored as plain chunks, without fact extraction or reflect. Otherwise openai, anthropic, gemini, groq, ollama, lmstudio and others; see https://hindsight.vectorize.io/developer/models" + }, + { + "name": "var_llm_api_key", + "label": "LLM API Key", + "type": "password", + "secret": true, + "help": "Not needed for ollama or lmstudio" + }, + { + "name": "var_llm_model", + "label": "LLM Model", + "type": "text", + "help": "Empty for the provider's default model" + }, + { + "name": "var_llm_base_url", + "label": "LLM Base URL", + "type": "text", + "help": "Empty for the provider's default. For a local LLM, e.g. the Ollama script's container: http://:11434/v1" + } + ], + "notes": [ + { + "text": "The API key is saved to `~/hindsight.creds` inside the container. Send it as `Authorization: Bearer ` to the API and the MCP endpoint.", + "type": "info" + }, + { + "text": "Without an LLM, Hindsight stores plain chunks only. Set the provider, key and model in `/opt/hindsight.env`, then run `systemctl restart hindsight`.", + "type": "info" + } + ] +}