Gives your agent persistent memory across conversations. Store facts about users, search by meaning, and retrieve full context — powered by Smara's Ebbinghaus decay scoring.
SMARA_API_KEY in your environmentcurl -X POST https://api.smara.io/v1/memories \
-H "Authorization: Bearer $SMARA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"user_id": "user_id_here",
"fact": "User prefers dark mode and uses vim keybindings",
"importance": 0.7
}'
curl "https://api.smara.io/v1/memories/search?user_id=user_id_here&query=editor+preferences&limit=5" \
-H "Authorization: Bearer $SMARA_API_KEY"
curl "https://api.smara.io/v1/users/user_id_here/context" \
-H "Authorization: Bearer $SMARA_API_KEY"
curl -X DELETE "https://api.smara.io/v1/memories/MEMORY_ID" \
-H "Authorization: Bearer $SMARA_API_KEY"
User: "I switched to Neovim last week"
Agent thinks:
1. Search memories for "editor preferences" → finds "Uses vim keybindings"
2. Store new memory: "Switched to Neovim (from vim)" with tags ["preferences", "editor"]
3. Smara auto-detects contradiction with old vim memory → soft-deletes it
4. Respond acknowledging the switch
Full docs: https://api.smara.io/docs/
共 1 个版本