Initial clean commit - unified Lyra stack

This commit is contained in:
serversdwn
2025-11-16 03:17:32 -05:00
commit 94fb091e59
270 changed files with 74200 additions and 0 deletions

24
cortex/identity.py Normal file
View File

@@ -0,0 +1,24 @@
# identity.py
import json
import os
IDENTITY_PATH = os.getenv("IDENTITY_PATH", "identity.json")
def load_identity():
"""
Load Lyra's identity/persona definition from identity.json.
Returns a dict or None if missing/invalid.
"""
if not os.path.exists(IDENTITY_PATH):
print(f"[Identity] identity.json not found at {IDENTITY_PATH}")
return None
try:
with open(IDENTITY_PATH, "r", encoding="utf-8") as f:
data = json.load(f)
print(f"[Identity] Loaded identity from {IDENTITY_PATH}")
return data
except Exception as e:
print(f"[Identity] Failed to load identity.json: {e}")
return None