Store and recall AI agent memories with semantic search in under 30 seconds.
This example connects to the Synapse Layer API, stores a memory with semantic content, and recalls it using a natural language query. It demonstrates the core store/recall loop that gives your AI agents persistent memory across sessions and tools.
- Python 3.9+
- A Synapse Layer account and
sk_connect_token (get yours here)
git clone https://github.com/SynapseLayer/synapse-layer-python-basic
cd synapse-layer-python-basic && pip install -r requirements.txt
cp .env.example .env # edit with your tokenpython3 main.py[store] Saving memory...
[store] Done.
[recall] Searching for user preferences...
[0] content: The user prefers dark mode and communicates in Portuguese.
tq_score: 0.716
[recall] 1 memories found.
- Go to forge.synapselayer.org
- Sign up or log in
- Navigate to Dashboard → Connect
- Generate a new
sk_connect_token - Paste it in your
.envfile