Spaces:
Configuration error
Configuration error
fix: use correct dataset repo (agentmemory-python-data) and fix second-brain default path for Linux
Browse files- src/app.py +2 -2
- start.sh +2 -2
- sync.py +1 -1
src/app.py
CHANGED
|
@@ -1307,7 +1307,7 @@ def api_get_second_brain():
|
|
| 1307 |
if auth_err:
|
| 1308 |
return auth_err
|
| 1309 |
|
| 1310 |
-
brain_dir = os.getenv("SECOND_BRAIN_DIR", "
|
| 1311 |
if not os.path.exists(brain_dir):
|
| 1312 |
return jsonify({"error": "Second brain directory not found", "path": brain_dir}), 404
|
| 1313 |
|
|
@@ -1360,7 +1360,7 @@ def api_update_second_brain():
|
|
| 1360 |
if not safe_name.endswith(".md"):
|
| 1361 |
return jsonify({"error": "Only markdown files are allowed"}), 400
|
| 1362 |
|
| 1363 |
-
brain_dir = os.getenv("SECOND_BRAIN_DIR", "
|
| 1364 |
if not os.path.exists(brain_dir):
|
| 1365 |
os.makedirs(brain_dir, exist_ok=True)
|
| 1366 |
|
|
|
|
| 1307 |
if auth_err:
|
| 1308 |
return auth_err
|
| 1309 |
|
| 1310 |
+
brain_dir = os.getenv("SECOND_BRAIN_DIR", os.path.join(os.path.expanduser("~"), ".agentmemory", "second-brain"))
|
| 1311 |
if not os.path.exists(brain_dir):
|
| 1312 |
return jsonify({"error": "Second brain directory not found", "path": brain_dir}), 404
|
| 1313 |
|
|
|
|
| 1360 |
if not safe_name.endswith(".md"):
|
| 1361 |
return jsonify({"error": "Only markdown files are allowed"}), 400
|
| 1362 |
|
| 1363 |
+
brain_dir = os.getenv("SECOND_BRAIN_DIR", os.path.join(os.path.expanduser("~"), ".agentmemory", "second-brain"))
|
| 1364 |
if not os.path.exists(brain_dir):
|
| 1365 |
os.makedirs(brain_dir, exist_ok=True)
|
| 1366 |
|
start.sh
CHANGED
|
@@ -9,9 +9,9 @@ mkdir -p /home/user/.agentmemory/dolt
|
|
| 9 |
# Secrets to set in HF Space settings:
|
| 10 |
# HF_TOKEN — write access to the dataset repo
|
| 11 |
# GEMINI_API_KEY — powers graph, embeddings, compression, crystals
|
| 12 |
-
# AGENTMEMORY_DATASET_REPO — optional override (default: Yash030/agentmemory-data)
|
| 13 |
# =============================================================================
|
| 14 |
-
export AGENTMEMORY_DATASET_REPO="${AGENTMEMORY_DATASET_REPO:-Yash030/agentmemory-data}"
|
| 15 |
|
| 16 |
echo "[start] Restoring data from HF Dataset..."
|
| 17 |
python3 /app/sync.py restore
|
|
|
|
| 9 |
# Secrets to set in HF Space settings:
|
| 10 |
# HF_TOKEN — write access to the dataset repo
|
| 11 |
# GEMINI_API_KEY — powers graph, embeddings, compression, crystals
|
| 12 |
+
# AGENTMEMORY_DATASET_REPO — optional override (default: Yash030/agentmemory-python-data)
|
| 13 |
# =============================================================================
|
| 14 |
+
export AGENTMEMORY_DATASET_REPO="${AGENTMEMORY_DATASET_REPO:-Yash030/agentmemory-python-data}"
|
| 15 |
|
| 16 |
echo "[start] Restoring data from HF Dataset..."
|
| 17 |
python3 /app/sync.py restore
|
sync.py
CHANGED
|
@@ -18,7 +18,7 @@ except ImportError:
|
|
| 18 |
sys.exit(0)
|
| 19 |
|
| 20 |
HF_TOKEN = os.environ.get("HF_TOKEN", "")
|
| 21 |
-
REPO_ID = os.environ.get("AGENTMEMORY_DATASET_REPO", "Yash030/agentmemory-data")
|
| 22 |
DATA_DIR = os.path.expanduser("~/.agentmemory")
|
| 23 |
SKIP_FILES = {".env"} # never upload secrets
|
| 24 |
ALLOW_HIDDEN = {".hmac"} # hidden files that ARE safe to backup
|
|
|
|
| 18 |
sys.exit(0)
|
| 19 |
|
| 20 |
HF_TOKEN = os.environ.get("HF_TOKEN", "")
|
| 21 |
+
REPO_ID = os.environ.get("AGENTMEMORY_DATASET_REPO", "Yash030/agentmemory-python-data")
|
| 22 |
DATA_DIR = os.path.expanduser("~/.agentmemory")
|
| 23 |
SKIP_FILES = {".env"} # never upload secrets
|
| 24 |
ALLOW_HIDDEN = {".hmac"} # hidden files that ARE safe to backup
|