Python SDK for Synapse Memory API — persistent memory for AI agents
Project description
synapse-memory — Python SDK for Synapse
Python SDK for the Synapse Memory API — persistent memory for AI agents.
Install
pip install synapse-memory-sdk
Quick Start
from synapse_memory import Synapse
synapse = Synapse(
base_url="https://synapse.schaefer.zone",
mind_key="your-mind-key-uuid",
)
# Recall all memories (LLM-formatted text)
text = synapse.memory.recall()
print(text)
# Store a new memory
synapse.memory.store(
category="fact",
content="User is Michael Schäfer",
key="user_name",
priority="critical",
source="user",
)
# Search memories
results = synapse.memory.search("insolvenz")
# Chat with the human
msgs = synapse.chat.poll()
if msgs["messages"]:
print(msgs["messages"][0]["content"])
synapse.chat.reply("Got it!")
# Persistent variables
synapse.scheduler.set_var("last_run", str(int(time.time())))
last_run = synapse.scheduler.get_var("last_run")
API Reference
synapse.memory
recall()— Get all memories as LLM-formatted textlist(category?, tag?, limit?, offset?)— List with filtersstore(**params)— Store/upsert (category, content, key?, tags?, priority?, source?, confidence?)search(q, limit?)— Full-text search (FTS5)semantic_search(q, limit?, threshold?)— Semantic searchupdate(memory_id, **params)— Update by IDdelete(memory_id)— Delete by IDstats()— Statisticsunverified(limit?)— Unverified memoriescontradictions(within_seconds?)— Detect contradictionsaudit(limit?, action?)— Audit logrelated(memory_id)— Related by shared tagsby_tag(tag)— Filter by tagdiff(since)— Incremental syncexpiring(within_seconds?)— Soon-to-expirehealth()— Mind health checksync(memories)— Bulk syncexport(format?)— Export mind
synapse.chat
poll(since_id?)— Poll for new messagesreply(content, reply_to_id?)— Send a replystatus()— Online statushistory(limit?)— Full history (JWT-only)unread(role?)— Unread count (JWT-only)
synapse.scheduler
list_crons()/create_cron(...)/delete_cron(id)/toggle_cron(id)list_vars()/get_var(key)/set_var(key, value?)/delete_var(key)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
synapse_memory_sdk-1.1.0.tar.gz
(11.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file synapse_memory_sdk-1.1.0.tar.gz.
File metadata
- Download URL: synapse_memory_sdk-1.1.0.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad9d42357eab943878a505cf680180925d46b2ba9fc107f8bbce3ab8d92a77ae
|
|
| MD5 |
3fa16d4c03721c551515c930d3f52443
|
|
| BLAKE2b-256 |
f3e8bdf3f67bde1efc30b32474bc141fa7ced820f4e50f17b28d8e734859478e
|
File details
Details for the file synapse_memory_sdk-1.1.0-py3-none-any.whl.
File metadata
- Download URL: synapse_memory_sdk-1.1.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b45506bf9a148d0c04774b3338d35f07367a2c7dd839821e31d98f68f45cb633
|
|
| MD5 |
96ed1ff14a5c634f973a3087e656aacb
|
|
| BLAKE2b-256 |
4ca6a001f321293a851c170999bc4bdd694fe886da313e49c97ad2b2e3aa8376
|