-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmemory.sh
More file actions
executable file
·26 lines (23 loc) · 912 Bytes
/
memory.sh
File metadata and controls
executable file
·26 lines (23 loc) · 912 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
# AI Memory Protocol — shell wrapper
# Sets MEMORY_DIR and delegates to the installed 'memory' CLI.
#
# Usage (direct):
# bash ai_memory_protocol/memory.sh recall gateway
# bash ai_memory_protocol/memory.sh add mem "Title" --tags "topic:x"
#
# Usage (sourced — exports MEMORY_DIR into current shell):
# source ai_memory_protocol/memory.sh
# memory recall gateway
#
# Installation:
# pipx install -e ai_memory_protocol # puts 'memory' on PATH globally
# Then just: export MEMORY_DIR=~/workspace/.memories
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
WORKSPACE_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
# Default to .memories workspace; override with MEMORY_DIR env var
export MEMORY_DIR="${MEMORY_DIR:-$WORKSPACE_DIR/.memories}"
# If script is run directly (not sourced), execute with arguments
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
exec memory "$@"
fi