A Hopfield Network-based memory engine that stores and retrieves contextual memory the way a brain does — but fast.
Project description
attractor
A Hopfield Network-based memory engine that stores and retrieves contextual memory the way a brain does — but fast.
Attractor is a standalone memory service purpose-built for storing and retrieving contextual memory. It is designed to work like a brain — not like a key-value store or a vector database.
Named after the concept of attractors in dynamical systems: stored memories are energy minima, retrieval is gradient descent to the nearest basin. Give it a partial or noisy cue and it converges to the full memory.
Install
pip install attractor-engine
Usage
Start the service
attractor start # default port 7747
attractor start --port 8000 # custom port
attractor start --db postgresql://localhost/attractor # custom db url
attractor connect # verify service is running
Write a memory
curl -X POST http://localhost:7747/memories \
-H "Content-Type: application/json" \
-d '{
"content": "auth tokens should never be stored in localStorage",
"context": {
"topic": "security review",
"entities": ["auth", "frontend team"],
"task": "reviewing PR #42",
"session_id": "abc123"
},
"tags": ["security", "auth"]
}'
Retrieve by ID
curl http://localhost:7747/memories/<id>
Search
curl -X POST http://localhost:7747/memories/search \
-H "Content-Type: application/json" \
-d '{
"query": "where did we land on auth token storage",
"context_filter": { "topic": "security review" },
"limit": 5
}'
Requirements
- Python 3.10+
- PostgreSQL with pgvector extension
Status
Phase 1 complete — storage, retrieval, and semantic search are working. Phases 2–4 (association graph, decay, Hopfield retrieval) are in development.
Source
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
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 attractor_engine-0.1.0.tar.gz.
File metadata
- Download URL: attractor_engine-0.1.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f2c7c8fd106745830e79543c981e08e17462c915d8719ef3829ca6e80160b98
|
|
| MD5 |
04226880a87cc5ce0ae2ff31f3d657b2
|
|
| BLAKE2b-256 |
be4507ccc6bb6ef5c770191b035e6a18abb909b9b01dc837fb232ebec3a6ed86
|
File details
Details for the file attractor_engine-0.1.0-py3-none-any.whl.
File metadata
- Download URL: attractor_engine-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1819d326764a5411e13dfb4d032d2fdee69ebe3265f610d44c9d66d9a3ac72d3
|
|
| MD5 |
2cd264c4e5bf0c82e630d8ea68c6470a
|
|
| BLAKE2b-256 |
f29fa7256e73d37af6368c00d599eb62c97e3a07f285601585e7b15b615aeeb7
|