Skip to main content
Nexyn Logo

Biological Memory Consolidation for Cognee

PyPI version License: MIT


🌐 Website | 🎮 Interactive Demo


Nexyn Core is a lightweight Python library that adds human-like memory physics to your AI applications. Built specifically to run alongside Cognee, it solves a major problem in AI memory systems: context bloat.

Instead of treating every piece of information equally, Nexyn automatically scores how important a memory is (Valence), applies a decay rate, and forgets irrelevant data over time—just like a human brain.

What It Solves

  • Infinite Context Clutter: AI agents quickly drown in their own logs. Nexyn ensures only the most important, reinforced memories survive long-term.
  • Flat Memory Structures: Nexyn categorizes data dynamically. A passing thought decays in hours; a core user instruction (like "I am allergic to peanuts") becomes a permanent instinct.

How It Works

  1. Sensory Buffer: Intercepts data before it enters your vector database.
  2. Evaluator: Uses NVIDIA NIM to quickly score the emotional/logical weight (Valence).
  3. Retrieval & Rehearsal: Every time you search for a memory, Nexyn resets its decay timer (rehearsal), naturally surfacing things you think about often.
  4. Consolidation: A background process sweeps your database and permanently deletes memories that have decayed to zero.

📦 Installation

# Using pip
pip install nexyn-core

🚀 Usage

Nexyn is designed to be completely invisible. You simply initialize it once, and it automatically intercepts your native Cognee calls to apply biological physics. You don't need to learn a new API.

import asyncio
import cognee
import nexyn

async def main():
    # 1. Initialize Nexyn's cognitive layer
    await nexyn.inject(
        nim_api_key="nvapi-your-key-here", 
        cognee_api_key="your_cognee_api_key",
        cognee_url="https://api.cognee.ai",
        tenant_id="default",
        user_id="user_123"
    )

    # 2. Add memories normally (Nexyn automatically scores Valence)
    await cognee.add("Doug is the groom. The wedding is Sunday.")
    
    # 3. Compile the Cognee knowledge graph
    await cognee.cognify()
    
    # 4. Search triggers decay physics and memory rehearsal
    results = await cognee.search("Where is Doug?")
    
    # 5. Fast-forward time to prune dead memories
    await nexyn.sweep()

if __name__ == "__main__":
    asyncio.run(main())

🎮 Interactive Dashboard

Want to see the biological pipeline in action? Check out our live visual dashboard to watch memories decay, prune, and consolidate in real-time: 👉 Live Demo

📝 License

Distributed under the MIT License.

Metadata

Release files for nexyn-core 1.0.2

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

Source distribution (sdist)

Source distribution for nexyn-core 1.0.2
File Size Uploaded
nexyn_core-1.0.2.tar.gz 34.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nexyn-core 1.0.2
File Interpreter ABI Platform
nexyn_core-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 70.6 kB

Release files / nexyn_core-1.0.2.tar.gz

Download URL nexyn_core-1.0.2.tar.gz
Size 34.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4f6404b1ac5f512697797fda5acd2d556014b734ecc6f03d4be1b2639429a77f
BLAKE2b-256 checksum
How to use checksums
007f22ee527e9e5f6799c5925ac08d5e7c2c7b94ba182bbb358ec5862ea5c1e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.9

Release files / nexyn_core-1.0.2-py3-none-any.whl

Download URL nexyn_core-1.0.2-py3-none-any.whl
Size 36.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c648f14d54e289100e21560effcf273d2d12acf0ae001c382d53f52fd1b0469b
BLAKE2b-256 checksum
How to use checksums
833b70bf5a220353e62d1d96a60fffa60bf4e21231f91b20232fbff22f4540f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.9

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.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