Generalized + redeployable: config via env, local Ollama embeddings, single portable sqlite-vec db, hybrid dense+FTS5 recall, mandatory credential scrub.
40 lines
1.2 KiB
Bash
Executable file
40 lines
1.2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# SecondBrain — one-shot local install. Idempotent.
|
|
# curl -fsSL https://git.atlascorporation.nl/atlas/secondbrain/raw/branch/main/deploy/install.sh | bash
|
|
# or, from a clone: bash deploy/install.sh
|
|
set -euo pipefail
|
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
cd "$DIR"
|
|
|
|
echo "==> python deps"
|
|
python3 -m venv .venv 2>/dev/null || true
|
|
. .venv/bin/activate
|
|
pip install -q --upgrade pip
|
|
pip install -q -r requirements.txt
|
|
|
|
echo "==> config"
|
|
[ -f .env ] || cp .env.example .env
|
|
echo " edit .env to point OLLAMA_URL / sources"
|
|
|
|
echo "==> ollama + embed model"
|
|
if command -v ollama >/dev/null 2>&1; then
|
|
ollama pull nomic-embed-text >/dev/null 2>&1 || true
|
|
else
|
|
echo " NOTE: ollama not found. Install from https://ollama.com and run: ollama pull nomic-embed-text"
|
|
fi
|
|
|
|
echo "==> init schema"
|
|
python3 brain.py init
|
|
|
|
cat <<'EOF'
|
|
|
|
SecondBrain installed. Next:
|
|
. .venv/bin/activate
|
|
python3 brain.py ingest-files /path/to/your/notes-or-code
|
|
python3 brain.py embed
|
|
python3 brain.py recall "your question" --hybrid
|
|
|
|
Continuous refresh (Linux): edit deploy/secondbrain-refresh.service paths, then
|
|
sudo cp deploy/secondbrain-refresh.* /etc/systemd/system/
|
|
sudo systemctl enable --now secondbrain-refresh.timer
|
|
EOF
|