NeuroSleepNet — Sleep-inspired persistent memory for AI agents. import nsn; nsn.init(); agent = nsn.wrap(your_slm)
Project description
NeuroSleepNet Python SDK
A sleep-inspired hybrid memory layer for continual AI learning. Give your local LLMs and agents infinite memory with a single line of code.
Installation
pip install neurosleepnet
For local LLM support (HuggingFace, Torch):
pip install "neurosleepnet[local_llm]"
Quick Start
import neurosleepnet as nsn
# 1. Initialize — no API keys required for local use
nsn.init(project="my-agent-v1")
# 2. Wrap your agent (OpenAI, LangChain, HuggingFace, etc.)
# All memory injection and storage becomes transparent.
agent = nsn.wrap(your_agent)
# 3. Use your agent as normal
response = agent("What did we talk about in our last session?")
Core Features
- Project Scoping: Isolate memories by project or agent identity.
- Attention-based Retrieval: Hybrid semantic search + recency weighting.
- Sleep Consolidation: Nightly background pruning and reinforcement of important facts.
- Local-First: Built-in SQLite fallback ensures your agent never crashes, even if the backend is down.
- Zero-Ops: Designed to run entirely on your own infrastructure.
Advanced API
# Manually remember a fact
nsn.remember("User prefers Python", importance=0.9, tags=["pref"])
# Retrieve memories semantically
memories = nsn.recall("coding preferences", top_k=3)
# Diagnostics
nsn.status()
# Explain why a memory was retrieved
nsn.explain_last()
# Export/Import full state
state = nsn.snapshot()
nsn.restore(state)
License
Apache 2.0
Project details
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 neurosleepnet-0.3.1.tar.gz.
File metadata
- Download URL: neurosleepnet-0.3.1.tar.gz
- Upload date:
- Size: 412.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e278a396104dc79d057964fd4d31d9a5ae730280817e9f9318ccd691eaf43503
|
|
| MD5 |
1c11f104ad0a5d5793ab9daa1cb5fb82
|
|
| BLAKE2b-256 |
51a5b38763fb96ad41c6474cdeeb0df73c1604947d2e2412cda305afbf193609
|
File details
Details for the file neurosleepnet-0.3.1-py3-none-any.whl.
File metadata
- Download URL: neurosleepnet-0.3.1-py3-none-any.whl
- Upload date:
- Size: 421.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4ee00aa0d83947e7e07dee7cd31807f14e724e97dce45b509ab5883e192e2d1
|
|
| MD5 |
9b932143f22e2f17dfab5b8922b3f7a9
|
|
| BLAKE2b-256 |
d892b7ee1cf8dabf5ab915e40402894359295773b17fedde591e76311e7320ea
|