Skip to main content

一个基于 Rust 的超高性能认知图谱记忆引擎,支持毫秒级激活扩散与大规模联想检索。

Project description

Pero-Memory-Core (pero-rust-core)

🚀 一个为 AI 记忆而生的极致性能引擎。

基于 Rust 开发,专为本地化、低功耗、大规模 AI Agent 记忆检索场景设计。

🌟 核心特性

  • 千万级联想秒开:基于 Spreading Activation(激活扩散)算法,在 2000 万节点、2000 万关联边的图谱上,5 步联想检索仅需 0.18ms
  • 深度记忆回溯:支持高达 50 步的深度联想,在 1 秒内可处理数十万个关联节点的能量传播。
  • 内存极致优化:使用 Rust CSR 变体结构,内存占用仅为同类向量数据库的 1/10。
  • 安全性防护:内置正则表达式清洗器,原生防止 ReDoS 攻击,并支持意图向量的动态安全验证。
  • 开箱即用:提供纯净的 Python 接口,无需配置复杂的数据库环境。

📊 性能表现

任务 规模 耗时
图谱构建 4000 万边 ~24.0s
浅层联想 (5步) 4000 万规模 0.18ms
深度联想 (50步) 4000 万规模 830ms
文本清洗 10万字符 0.6ms

🛠 安装方法 (即将发布)

pip install pero-memory-core

💻 快速开始

from pero_rust_core import CognitiveGraphEngine

# 初始化引擎
engine = CognitiveGraphEngine()

# 批量添加记忆关联 (src_id, target_id, strength)
engine.batch_add_connections([(1, 2, 0.8), (2, 3, 0.5)])

# 执行记忆扩散联想
# initial_scores: 初始激活点, steps: 扩散步数
results = engine.propagate_activation({1: 1.0}, steps=5)

print(f"联想到的相关记忆点: {results}")

📜 许可证

MIT License

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

pero_memory_core-0.1.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pero_memory_core-0.1.0-cp310-cp310-win_amd64.whl (903.2 kB view details)

Uploaded CPython 3.10Windows x86-64

File details

Details for the file pero_memory_core-0.1.0.tar.gz.

File metadata

  • Download URL: pero_memory_core-0.1.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.11.2

File hashes

Hashes for pero_memory_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 41ace6cc451f4e4e5435c70197b578c12b3c550e4f7c4206b8bffb92a5f2682f
MD5 29dbe507d8318253b248e4bee744a096
BLAKE2b-256 250c4cb5d9cc4276d6ee2c71402e690058626fbd66631c00a62dbaf0090a3679

See more details on using hashes here.

File details

Details for the file pero_memory_core-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pero_memory_core-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 32d2e8f19990d66c053052bccf9bd93e5003e0260119756b13e6fece417e3732
MD5 e18affbc947d3e10a17f6efd3e29bd77
BLAKE2b-256 211166de3a7b09287999dd135f4d41a4740bbededcb81e234042dbb53e193653

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page