Skip to main content

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

github.com/aag1091-alt/attractor

Metadata

Release files for attractor-engine 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for attractor-engine 0.1.0
File Size Uploaded
attractor_engine-0.1.0.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for attractor-engine 0.1.0
File Interpreter ABI Platform
attractor_engine-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / attractor_engine-0.1.0.tar.gz

Download URL attractor_engine-0.1.0.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8f2c7c8fd106745830e79543c981e08e17462c915d8719ef3829ca6e80160b98
BLAKE2b-256 checksum
How to use checksums
be4507ccc6bb6ef5c770191b035e6a18abb909b9b01dc837fb232ebec3a6ed86
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release files / attractor_engine-0.1.0-py3-none-any.whl

Download URL attractor_engine-0.1.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1819d326764a5411e13dfb4d032d2fdee69ebe3265f610d44c9d66d9a3ac72d3
BLAKE2b-256 checksum
How to use checksums
f29fa7256e73d37af6368c00d599eb62c97e3a07f285601585e7b15b615aeeb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page