NWcortex 1.0.2__tar.gz → 1.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {nwcortex-1.0.2 → nwcortex-1.0.4}/LICENSE +21 -21
- {nwcortex-1.0.2 → nwcortex-1.0.4}/MANIFEST.in +11 -10
- {nwcortex-1.0.2 → nwcortex-1.0.4/NWcortex.egg-info}/PKG-INFO +126 -10
- {nwcortex-1.0.2 → nwcortex-1.0.4}/NWcortex.egg-info/SOURCES.txt +57 -0
- nwcortex-1.0.4/NWcortex.egg-info/entry_points.txt +10 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/NWcortex.egg-info/requires.txt +7 -0
- nwcortex-1.0.4/NWcortex.egg-info/top_level.txt +4 -0
- {nwcortex-1.0.2/NWcortex.egg-info → nwcortex-1.0.4}/PKG-INFO +126 -10
- {nwcortex-1.0.2 → nwcortex-1.0.4}/README.md +400 -289
- nwcortex-1.0.4/benchmarks/run_benchmarks.py +487 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/examples/emergence_demo.py +230 -230
- {nwcortex-1.0.2 → nwcortex-1.0.4}/examples/locomo_test.py +597 -597
- {nwcortex-1.0.2 → nwcortex-1.0.4}/examples/memory_basic.py +164 -164
- {nwcortex-1.0.2 → nwcortex-1.0.4}/pyproject.toml +68 -61
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/__init__.py +404 -398
- nwcortex-1.0.4/star_graph/abstraction.py +1 -0
- nwcortex-1.0.4/star_graph/anchor.py +2 -0
- nwcortex-1.0.4/star_graph/async_manager.py +1 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/atom_facts.py +541 -541
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/autobiography.py +4 -4
- nwcortex-1.0.4/star_graph/batch_vectorizer.py +199 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/benchmark.py +10 -10
- nwcortex-1.0.4/star_graph/bm25.py +2 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/brain_sphere.py +247 -247
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/cascade.py +264 -264
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/causal_edges.py +217 -217
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/cli.py +126 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/cluster_memory.py +200 -200
- nwcortex-1.0.4/star_graph/cognitive_cache.py +2 -0
- nwcortex-1.0.4/star_graph/community.py +1 -0
- nwcortex-1.0.4/star_graph/competition.py +1 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/compiler.py +524 -524
- nwcortex-1.0.4/star_graph/compression.py +1 -0
- nwcortex-1.0.4/star_graph/conflict_detection.py +1 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/consolidation/__init__.py +37 -37
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/abstraction.py +2 -2
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/community.py +642 -642
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/competition.py +3 -3
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/compression.py +959 -959
- nwcortex-1.0.4/star_graph/consolidation/conflict_detection.py +182 -0
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/domain_router.py +401 -401
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/evolution.py +4 -4
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/ghost.py +2 -2
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/hub.py +847 -847
- nwcortex-1.0.4/star_graph/consolidation/memory_revision.py +284 -0
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/micro_sleep.py +295 -295
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/reflection_loop.py +426 -426
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/self_org.py +302 -302
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/sleep.py +590 -563
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/sleep_consolidate.py +943 -943
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/sleep_nrem.py +352 -206
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/sleep_rem.py +148 -148
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/sleep_report.py +151 -125
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/consolidation}/survival.py +294 -294
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/contrib/__init__.py +33 -33
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/contrib/benchmark.py +820 -820
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/contrib/mcp_server.py +166 -11
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/contrib/snapshot.py +567 -567
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/contrib/streaming.py +399 -399
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/contrib/symbolic_filter.py +182 -182
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/cortex.py +534 -534
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/cortex_api/__init__.py +31 -31
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/cortex_api}/async_manager.py +463 -463
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/cortex_api}/gate.py +218 -218
- nwcortex-1.0.4/star_graph/cortex_api/manager.py +250 -0
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/cortex_api}/manager_stats.py +49 -49
- nwcortex-1.0.4/star_graph/cortex_api/mcp_server.py +24 -0
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/cortex_api}/runtime.py +1079 -1045
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/cortex_api}/runtime_core.py +440 -440
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/cortex_api}/runtime_lifecycle.py +407 -407
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/cortex_api}/runtime_stats.py +2 -2
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/cortex_api}/scheduler.py +10 -6
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/cortex_api}/server.py +170 -166
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/cortex_api}/working_memory.py +267 -267
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/cortex_api}/write_gate.py +326 -326
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/cost_estimator.py +325 -325
- nwcortex-1.0.4/star_graph/cross_encoder.py +2 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/defaults.yaml +39 -1
- nwcortex-1.0.4/star_graph/domain_router.py +1 -0
- nwcortex-1.0.4/star_graph/dual_channel.py +2 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/edge_budget.py +4 -4
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/edge_decay.py +4 -4
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/edge_management.py +264 -264
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/embedding_provider/__init__.py +43 -43
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/embedding_provider/providers.py +404 -404
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/episodic_memory.py +264 -264
- nwcortex-1.0.4/star_graph/evolution.py +1 -0
- nwcortex-1.0.4/star_graph/exact_cache.py +2 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/extras/__init__.py +41 -41
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/extras/autobiography.py +329 -329
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/extras/resonance.py +214 -214
- nwcortex-1.0.4/star_graph/forget_certificate.py +225 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/four_layer.py +624 -624
- nwcortex-1.0.4/star_graph/gate.py +1 -0
- nwcortex-1.0.4/star_graph/ghost.py +1 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/goal_tree.py +365 -365
- nwcortex-1.0.4/star_graph/graph.py +5 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/hippocampus.py +262 -262
- nwcortex-1.0.4/star_graph/hub.py +1 -0
- nwcortex-1.0.4/star_graph/index.py +2 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/logger.py +118 -118
- nwcortex-1.0.4/star_graph/manager.py +1 -0
- nwcortex-1.0.4/star_graph/manager_stats.py +1 -0
- nwcortex-1.0.4/star_graph/markdown_export.py +274 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/math_utils.py +43 -43
- nwcortex-1.0.4/star_graph/mcp_server.py +1 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/memory_core/__init__.py +43 -43
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/memory_core}/anchor.py +52 -15
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/memory_core}/graph.py +3 -3
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/memory_core}/index.py +98 -98
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/memory_core}/tier.py +960 -960
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/memory_core}/tiered.py +4 -4
- nwcortex-1.0.4/star_graph/memory_revision.py +1 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/metrics.py +181 -181
- nwcortex-1.0.4/star_graph/micro_sleep.py +1 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/multimodal.py +715 -561
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/online.py +116 -116
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/personality.py +299 -299
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/raw_buffer.py +275 -275
- nwcortex-1.0.4/star_graph/reflection_loop.py +1 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/resonance.py +4 -4
- nwcortex-1.0.4/star_graph/retrieval_budget.py +2 -0
- nwcortex-1.0.4/star_graph/retrieval_core.py +2 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/retrieval_engine/__init__.py +36 -36
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/retrieval_engine}/bm25.py +156 -129
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/retrieval_engine}/cognitive_cache.py +625 -625
- nwcortex-1.0.4/star_graph/retrieval_engine/cross_encoder.py +110 -0
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/retrieval_engine}/dual_channel.py +691 -691
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/retrieval_engine}/exact_cache.py +4 -4
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/retrieval_engine}/retrieval_budget.py +125 -125
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/retrieval_engine}/retrieval_core.py +1208 -1029
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/retrieval_engine}/retrieval_pipeline.py +37 -37
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/retrieval_engine}/retriever.py +3 -3
- nwcortex-1.0.4/star_graph/retrieval_pipeline.py +2 -0
- nwcortex-1.0.4/star_graph/retriever.py +2 -0
- nwcortex-1.0.4/star_graph/runtime.py +1 -0
- nwcortex-1.0.4/star_graph/runtime_core.py +1 -0
- nwcortex-1.0.4/star_graph/runtime_lifecycle.py +1 -0
- nwcortex-1.0.4/star_graph/runtime_stats.py +1 -0
- nwcortex-1.0.4/star_graph/scheduler.py +1 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/seed.py +34 -34
- nwcortex-1.0.4/star_graph/self_org.py +1 -0
- nwcortex-1.0.4/star_graph/server.py +1 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/shard.py +231 -231
- nwcortex-1.0.4/star_graph/sleep.py +1 -0
- nwcortex-1.0.4/star_graph/sleep_consolidate.py +1 -0
- nwcortex-1.0.4/star_graph/sleep_nrem.py +1 -0
- nwcortex-1.0.4/star_graph/sleep_rem.py +1 -0
- nwcortex-1.0.4/star_graph/sleep_report.py +1 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/snapshot.py +4 -4
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/spreading.py +211 -211
- nwcortex-1.0.4/star_graph/sqlite_storage.py +2 -0
- nwcortex-1.0.4/star_graph/storage.py +2 -0
- nwcortex-1.0.4/star_graph/storage_backend.py +2 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/streaming.py +4 -4
- nwcortex-1.0.4/star_graph/survival.py +1 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/symbolic_filter.py +4 -4
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/thermal_store.py +337 -260
- nwcortex-1.0.4/star_graph/tier.py +2 -0
- nwcortex-1.0.4/star_graph/tiered.py +2 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/timespine.py +296 -296
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/topology.py +332 -332
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/tracing.py +366 -366
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/versioned_memory.py +217 -217
- nwcortex-1.0.4/star_graph/working_memory.py +1 -0
- nwcortex-1.0.4/star_graph/write_gate.py +1 -0
- nwcortex-1.0.4/star_graph/zero_llm_pipeline.py +312 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_abstraction.py +379 -379
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_abstractive_memory.py +177 -177
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_anchor.py +503 -503
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_atom_facts.py +51 -51
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_autobiography.py +344 -344
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_bm25.py +148 -148
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_brain_sphere.py +244 -244
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_cascade.py +86 -86
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_causal_edges.py +85 -85
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_cluster_memory.py +111 -111
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_cognitive_cache.py +223 -223
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_cognitive_compiler.py +220 -220
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_community.py +487 -487
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_competition.py +228 -228
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_compiler.py +626 -626
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_compression.py +623 -623
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_config_schema.py +125 -125
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_cortex_hierarchy.py +336 -336
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_cost_estimator.py +240 -240
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_domain_router.py +186 -186
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_edge_budget.py +154 -154
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_edge_decay.py +157 -157
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_edge_management.py +235 -235
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_embedding.py +116 -116
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_episodic_memory.py +159 -159
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_evolution.py +396 -396
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_four_layer.py +418 -418
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_gate.py +225 -225
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_ghost.py +243 -243
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_ghost_intensity.py +442 -442
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_goal_tree.py +324 -324
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_graph.py +675 -675
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_hippocampus.py +173 -173
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_index.py +92 -92
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_layers.py +92 -92
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_logger.py +87 -87
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_manager_stats.py +45 -45
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_math_utils.py +88 -88
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_memory_tier.py +233 -233
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_metrics.py +229 -229
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_micro_sleep.py +292 -292
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_multimodal.py +459 -451
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_online.py +135 -135
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_oscillation_match.py +178 -178
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_personality.py +209 -209
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_raw_buffer.py +170 -170
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_readme_doctest.py +90 -90
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_reflection_loop.py +332 -332
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_resonance.py +131 -131
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_retrieval_budget.py +103 -103
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_retriever.py +526 -526
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_router.py +281 -281
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_scheduler.py +646 -646
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_seed.py +62 -62
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_self_org.py +232 -232
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_shard.py +413 -413
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_sleep_consolidation.py +604 -604
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_sleep_report.py +109 -109
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_spreading.py +149 -149
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_sqlite_storage.py +257 -257
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_storage.py +136 -136
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_storage_backend.py +54 -54
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_streaming.py +433 -433
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_survival.py +583 -583
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_thermal_store.py +310 -310
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_tier.py +423 -423
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_timespine.py +187 -187
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_topology.py +169 -169
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_tracing.py +437 -437
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_v08_modules.py +558 -558
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_versioned_memory.py +112 -112
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_working_memory.py +195 -195
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_write_gate.py +439 -439
- nwcortex-1.0.2/NWcortex.egg-info/entry_points.txt +0 -5
- nwcortex-1.0.2/NWcortex.egg-info/top_level.txt +0 -1
- nwcortex-1.0.2/star_graph/manager.py +0 -128
- nwcortex-1.0.2/star_graph/mcp_server.py +0 -4
- {nwcortex-1.0.2 → nwcortex-1.0.4}/NWcortex.egg-info/dependency_links.txt +0 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/examples/ablation_benchmark.py +0 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/examples/locomo_eval.py +0 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/examples/locomo_llm_eval.py +0 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/examples/memory_benchmark.py +0 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/setup.cfg +0 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/__main__.py +0 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/config.py +0 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/embedding.py +0 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/layers.py +0 -0
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/memory_core}/sqlite_storage.py +0 -0
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/memory_core}/storage.py +0 -0
- {nwcortex-1.0.2/star_graph → nwcortex-1.0.4/star_graph/memory_core}/storage_backend.py +0 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/star_graph/router.py +0 -0
- {nwcortex-1.0.2 → nwcortex-1.0.4}/tests/test_retrieval_trace.py +0 -0
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Thatgfsj
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Thatgfsj
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
include README.md
|
|
2
|
-
include LICENSE
|
|
3
|
-
include star_graph/defaults.yaml
|
|
4
|
-
recursive-include
|
|
5
|
-
|
|
6
|
-
prune
|
|
7
|
-
prune
|
|
8
|
-
prune
|
|
9
|
-
prune
|
|
10
|
-
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include star_graph/defaults.yaml
|
|
4
|
+
recursive-include star_graph/contrib *.py
|
|
5
|
+
recursive-include examples *.py
|
|
6
|
+
prune venv
|
|
7
|
+
prune dist
|
|
8
|
+
prune build
|
|
9
|
+
prune .git
|
|
10
|
+
prune __pycache__
|
|
11
|
+
global-exclude *.pyc
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: NWcortex
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: NeuroWeave Cortex (NWC) — Graph-first cognitive memory runtime for AI agents. Hippocampal-inspired architecture with domain routing, spreading activation, edge budget management, 4-layer compression, thermal storage, personality modeling, and 8-phase sleep consolidation.
|
|
5
5
|
Author-email: Thatgfsj <thatgfsj@users.noreply.github.com>
|
|
6
6
|
License: MIT
|
|
@@ -24,6 +24,11 @@ Requires-Dist: PyYAML>=6.0
|
|
|
24
24
|
Requires-Dist: scikit-learn>=1.3.0
|
|
25
25
|
Provides-Extra: embeddings
|
|
26
26
|
Requires-Dist: sentence-transformers>=2.2.0; extra == "embeddings"
|
|
27
|
+
Provides-Extra: mcp
|
|
28
|
+
Requires-Dist: mcp>=1.0.0; extra == "mcp"
|
|
29
|
+
Provides-Extra: all
|
|
30
|
+
Requires-Dist: sentence-transformers>=2.2.0; extra == "all"
|
|
31
|
+
Requires-Dist: mcp>=1.0.0; extra == "all"
|
|
27
32
|
Dynamic: license-file
|
|
28
33
|
|
|
29
34
|
# NeuroWeave Cortex (NWC) — Cognitive Memory Runtime
|
|
@@ -46,6 +51,12 @@ Vector databases retrieve. Graph databases traverse. NeuroWeave Cortex runs a **
|
|
|
46
51
|
| Automatic forgetting (survival decay) | no | no | yes |
|
|
47
52
|
| Memory strengthening (rehearsal) | no | no | yes |
|
|
48
53
|
| Conflict detection (contradiction edges) | no | no | yes |
|
|
54
|
+
| Multi-strategy RRF retrieval fusion | no | no | yes |
|
|
55
|
+
| Cross-Encoder reranking | no | no | yes |
|
|
56
|
+
| Explainable reasoning paths | no | no | yes |
|
|
57
|
+
| Memory revision engine (sleep) | no | no | yes |
|
|
58
|
+
| Hot/Warm/Cold memory tiering | no | no | yes |
|
|
59
|
+
| Multimodal (text+image+audio) | no | no | yes |
|
|
49
60
|
| Fuzzy recall ("I think I remember...") | no | no | yes |
|
|
50
61
|
| Emergent abstraction (pattern discovery) | no | no | yes |
|
|
51
62
|
| Temporal context (TimeSpine-indexed) | no | no | yes |
|
|
@@ -92,6 +103,9 @@ print(report)
|
|
|
92
103
|
# Persist
|
|
93
104
|
mgr.save("agent_memory.json")
|
|
94
105
|
mgr.load("agent_memory.json")
|
|
106
|
+
|
|
107
|
+
# Export to editable Markdown (GBrain-aligned)
|
|
108
|
+
mgr.export_markdown("memories/")
|
|
95
109
|
```
|
|
96
110
|
|
|
97
111
|
## Architecture
|
|
@@ -109,12 +123,15 @@ Layer 3: Behavior │ Cortex routing, memory gating, working memory,
|
|
|
109
123
|
│
|
|
110
124
|
Layer 2: Cognitive │ Hub abstraction, cascade recall, TimeSpine temporal index,
|
|
111
125
|
(retriever.py, │ sleep consolidation, evolution, ghost revival,
|
|
112
|
-
sleep.py, │ abstraction, community detection, competition
|
|
113
|
-
evolution.py, │
|
|
114
|
-
ghost.py, │
|
|
126
|
+
sleep.py, │ abstraction, community detection, competition,
|
|
127
|
+
evolution.py, │ conflict detection, memory revision, cross-encoder
|
|
128
|
+
ghost.py, │ "How do memories connect, strengthen, and fade?"
|
|
115
129
|
abstraction.py, │
|
|
116
130
|
community.py, │
|
|
117
131
|
competition.py, │
|
|
132
|
+
conflict_detection.py,│
|
|
133
|
+
memory_revision.py, │
|
|
134
|
+
cross_encoder.py, │
|
|
118
135
|
timespine.py, │
|
|
119
136
|
cascade.py, │
|
|
120
137
|
hub.py) │
|
|
@@ -139,11 +156,14 @@ Layer 1: Storage │ CRUD, persistence, ANN indexing, tiered storage,
|
|
|
139
156
|
| `retrieval_pipeline.py` | 5-layer dimensional descent (L0→L4) with automatic degradation |
|
|
140
157
|
| `scheduler.py` | Context-aware retrieval with memory type selection |
|
|
141
158
|
| `working_memory.py` | Short-term buffer (15-item, 1h TTL) — auto-promotes to long-term |
|
|
142
|
-
| `sleep.py` |
|
|
159
|
+
| `sleep.py` | 10-phase sleep: N1_Replay → N2_Merge → N2b_ConflictDetection → N2c_MemoryRevision → N3_Compression → N3d_SleepRebuild → REM_Emotion → N4_Prune (v1.0.4) |
|
|
143
160
|
| `evolution.py` | Survival-based decay (Ebbinghaus/Power-law/Exponential), belief transitions, interference |
|
|
144
161
|
| `retriever.py` | HybridFusion + OscillationResonance + VectorSimilarity + Personalized PageRank + explainable scores |
|
|
145
162
|
| `dual_channel.py` | System-1 (fast) + System-2 (deep) dual-channel retrieval with auto-trigger |
|
|
146
|
-
| `bm25.py` | Sparse keyword retrieval (BM25) with reciprocal rank fusion for hybrid search |
|
|
163
|
+
| `bm25.py` | Sparse keyword retrieval (BM25) with weighted reciprocal rank fusion for hybrid search |
|
|
164
|
+
| `cross_encoder.py` | Post-retrieval Cross-Encoder reranking (sentence-transformers) for precision improvement |
|
|
165
|
+
| `conflict_detection.py` | Semantic contradiction detection with overwrite/coexist/deprecate resolution strategies |
|
|
166
|
+
| `memory_revision.py` | Sleep-phase memory revision engine — surprise-prioritized, template/LLM re-summarization |
|
|
147
167
|
| `ghost.py` | Latent memory traces with fuzzy recall and contradiction tracking (NegativeGhost) |
|
|
148
168
|
| `abstraction.py` | Emergent category discovery from anchor clusters |
|
|
149
169
|
| `community.py` | Louvain community detection with centroid routing |
|
|
@@ -162,6 +182,11 @@ Layer 1: Storage │ CRUD, persistence, ANN indexing, tiered storage,
|
|
|
162
182
|
| `resonance.py` | Phase-locked oscillation resonance for temporal-coherent retrieval |
|
|
163
183
|
| `streaming.py` | Streaming memory buffer with backpressure |
|
|
164
184
|
| `benchmark.py` | Built-in benchmark suite (5 categories) |
|
|
185
|
+
| `batch_vectorizer.py` | Deferred batch embedding writes (buffer >= 32 / >30s flush) with SQLite WAL crash recovery |
|
|
186
|
+
| `zero_llm_pipeline.py` | 7-stage zero-LLM ingestion: security → embed → dedup → entity → classify → score → link |
|
|
187
|
+
| `multimodal.py` | Cross-modal text/image/audio memory — CLIP image encoding, Whisper/spectrogram audio, unified embedding space |
|
|
188
|
+
| `forget_certificate.py` | Ed25519-signed JWS deletion certificates — GDPR Article 17 provable erasure |
|
|
189
|
+
| `markdown_export.py` | Operator-owned plain-text memory export (GBrain-aligned); timeline + topic Markdown |
|
|
165
190
|
| `config.py` | Centralized YAML config with schema validation, dot-path access, overrides |
|
|
166
191
|
|
|
167
192
|
## Retrieval Benchmarks
|
|
@@ -264,11 +289,14 @@ See `star_graph/defaults.yaml` for all 300+ tunable parameters.
|
|
|
264
289
|
# From PyPI (package name: NWcortex, import as: star_graph)
|
|
265
290
|
pip install NWcortex
|
|
266
291
|
|
|
267
|
-
# With sentence-transformers for semantic embeddings
|
|
292
|
+
# With sentence-transformers for semantic embeddings
|
|
268
293
|
pip install "NWcortex[embeddings]"
|
|
269
294
|
|
|
270
|
-
#
|
|
271
|
-
pip install
|
|
295
|
+
# With MCP server support (for AI agent integration)
|
|
296
|
+
pip install "NWcortex[mcp]"
|
|
297
|
+
|
|
298
|
+
# Everything
|
|
299
|
+
pip install "NWcortex[all]"
|
|
272
300
|
|
|
273
301
|
# Run demo
|
|
274
302
|
python examples/emergence_demo.py
|
|
@@ -276,6 +304,91 @@ python examples/emergence_demo.py
|
|
|
276
304
|
|
|
277
305
|
**Note:** Without `[embeddings]`, the system uses a lightweight TF-IDF fallback for text encoding. Install `sentence-transformers` only if you need semantic-quality embeddings.
|
|
278
306
|
|
|
307
|
+
## MCP Server — AI Agent Integration
|
|
308
|
+
|
|
309
|
+
NeuroWeave Cortex ships with a [Model Context Protocol](https://modelcontextprotocol.io) server. Connect any MCP-compatible AI agent (Claude Desktop, OpenClaw, Cursor, etc.) for persistent cognitive memory across conversations.
|
|
310
|
+
|
|
311
|
+
### Quick start
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
# Install with MCP support
|
|
315
|
+
pip install "NWcortex[mcp]"
|
|
316
|
+
|
|
317
|
+
# Launch the MCP server on stdio
|
|
318
|
+
nwc-mcp
|
|
319
|
+
|
|
320
|
+
# With persistent storage
|
|
321
|
+
nwc-mcp --storage agent_memory.json
|
|
322
|
+
|
|
323
|
+
# Load a previously saved memory graph
|
|
324
|
+
nwc-mcp --load my_memories.json
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Tool reference (12 tools)
|
|
328
|
+
|
|
329
|
+
| Tool | Description |
|
|
330
|
+
|------|-------------|
|
|
331
|
+
| `remember` | Store a long-term memory (tags, importance, emotional valence) |
|
|
332
|
+
| `remember_working` | Store in fast ephemeral working-memory buffer (current task context) |
|
|
333
|
+
| `recall` | Context-aware semantic retrieval with task-type routing |
|
|
334
|
+
| `forget` | Remove a memory, creating a ghost trace for potential fuzzy recall |
|
|
335
|
+
| `sleep` | Run 5-phase sleep consolidation — merges, prunes, forms schemas |
|
|
336
|
+
| `consolidate` | Micro-consolidation — incremental, non-blocking |
|
|
337
|
+
| `stats` | Memory system statistics (anchors, edges, ghosts, schemas, cognitive health) |
|
|
338
|
+
| `fuzzy_recall` | Low-confidence recall from ghost traces ("I seem to remember...") |
|
|
339
|
+
| `get_profile` | Inferred user profile from accumulated memories |
|
|
340
|
+
| `evolve` | Memory evolution cycle (decay, boost, conflict resolution) |
|
|
341
|
+
| `save` | Persist memory graph to disk (JSON) |
|
|
342
|
+
| `load` | Load memory graph from disk (JSON) |
|
|
343
|
+
|
|
344
|
+
### Claude Desktop config
|
|
345
|
+
|
|
346
|
+
```json
|
|
347
|
+
{
|
|
348
|
+
"mcpServers": {
|
|
349
|
+
"neuroweave-cortex": {
|
|
350
|
+
"command": "nwc-mcp",
|
|
351
|
+
"args": ["--storage", "/path/to/agent_memory.json"]
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### OpenClaw config
|
|
358
|
+
|
|
359
|
+
```json
|
|
360
|
+
{
|
|
361
|
+
"mcpServers": {
|
|
362
|
+
"neuroweave-cortex": {
|
|
363
|
+
"command": "nwc-mcp",
|
|
364
|
+
"args": ["--storage", "/path/to/agent_memory.json"]
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
## REST API Server
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
# Start the REST server
|
|
374
|
+
nwc-server --port 8420
|
|
375
|
+
|
|
376
|
+
# Or via module
|
|
377
|
+
python -m star_graph.server --port 8420
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Endpoints:
|
|
381
|
+
|
|
382
|
+
| Method | Path | Description |
|
|
383
|
+
|--------|------|-------------|
|
|
384
|
+
| GET | `/health` | Health check with anchor/edge counts |
|
|
385
|
+
| GET | `/metrics` | Prometheus-format metrics |
|
|
386
|
+
| GET | `/stats` | Full memory system statistics |
|
|
387
|
+
| POST | `/remember` | Store a memory `{"text": "...", "tags": [...]}` |
|
|
388
|
+
| POST | `/recall` | Retrieve memories `{"query": "...", "max_items": 10}` |
|
|
389
|
+
| POST | `/sleep` | Run sleep consolidation |
|
|
390
|
+
| POST | `/consolidate` | Run micro-consolidation |
|
|
391
|
+
|
|
279
392
|
## Interactive Demo
|
|
280
393
|
|
|
281
394
|
```bash
|
|
@@ -287,6 +400,9 @@ python examples/emergence_demo.py
|
|
|
287
400
|
# sg-query --trace "When did Alice visit Hawaii?"
|
|
288
401
|
# sg-stats --schemas --ghosts
|
|
289
402
|
# sg-sleep --retention 0.15 --edge-prune 0.1
|
|
403
|
+
# nwc-export --output memories/ --organize both
|
|
404
|
+
# nwc-forget <anchor_id> --certificate --reason gdpr_art17
|
|
405
|
+
# nwc-verify certificates/forget-<id>.jws
|
|
290
406
|
```
|
|
291
407
|
|
|
292
408
|
## Benchmarks
|
|
@@ -306,7 +422,7 @@ pytest tests/ -v
|
|
|
306
422
|
pytest tests/ --cov=star_graph --cov-report=term
|
|
307
423
|
```
|
|
308
424
|
|
|
309
|
-
**Status:** 1,989 tests passing,
|
|
425
|
+
**Status:** 1,989 tests passing, 84 modules (v1.0.4-dev).
|
|
310
426
|
|
|
311
427
|
## Roadmap
|
|
312
428
|
|
|
@@ -8,6 +8,7 @@ NWcortex.egg-info/dependency_links.txt
|
|
|
8
8
|
NWcortex.egg-info/entry_points.txt
|
|
9
9
|
NWcortex.egg-info/requires.txt
|
|
10
10
|
NWcortex.egg-info/top_level.txt
|
|
11
|
+
benchmarks/run_benchmarks.py
|
|
11
12
|
examples/ablation_benchmark.py
|
|
12
13
|
examples/emergence_demo.py
|
|
13
14
|
examples/locomo_eval.py
|
|
@@ -22,6 +23,7 @@ star_graph/anchor.py
|
|
|
22
23
|
star_graph/async_manager.py
|
|
23
24
|
star_graph/atom_facts.py
|
|
24
25
|
star_graph/autobiography.py
|
|
26
|
+
star_graph/batch_vectorizer.py
|
|
25
27
|
star_graph/benchmark.py
|
|
26
28
|
star_graph/bm25.py
|
|
27
29
|
star_graph/brain_sphere.py
|
|
@@ -35,8 +37,10 @@ star_graph/competition.py
|
|
|
35
37
|
star_graph/compiler.py
|
|
36
38
|
star_graph/compression.py
|
|
37
39
|
star_graph/config.py
|
|
40
|
+
star_graph/conflict_detection.py
|
|
38
41
|
star_graph/cortex.py
|
|
39
42
|
star_graph/cost_estimator.py
|
|
43
|
+
star_graph/cross_encoder.py
|
|
40
44
|
star_graph/defaults.yaml
|
|
41
45
|
star_graph/domain_router.py
|
|
42
46
|
star_graph/dual_channel.py
|
|
@@ -47,6 +51,7 @@ star_graph/embedding.py
|
|
|
47
51
|
star_graph/episodic_memory.py
|
|
48
52
|
star_graph/evolution.py
|
|
49
53
|
star_graph/exact_cache.py
|
|
54
|
+
star_graph/forget_certificate.py
|
|
50
55
|
star_graph/four_layer.py
|
|
51
56
|
star_graph/gate.py
|
|
52
57
|
star_graph/ghost.py
|
|
@@ -59,8 +64,10 @@ star_graph/layers.py
|
|
|
59
64
|
star_graph/logger.py
|
|
60
65
|
star_graph/manager.py
|
|
61
66
|
star_graph/manager_stats.py
|
|
67
|
+
star_graph/markdown_export.py
|
|
62
68
|
star_graph/math_utils.py
|
|
63
69
|
star_graph/mcp_server.py
|
|
70
|
+
star_graph/memory_revision.py
|
|
64
71
|
star_graph/metrics.py
|
|
65
72
|
star_graph/micro_sleep.py
|
|
66
73
|
star_graph/multimodal.py
|
|
@@ -105,7 +112,27 @@ star_graph/tracing.py
|
|
|
105
112
|
star_graph/versioned_memory.py
|
|
106
113
|
star_graph/working_memory.py
|
|
107
114
|
star_graph/write_gate.py
|
|
115
|
+
star_graph/zero_llm_pipeline.py
|
|
108
116
|
star_graph/consolidation/__init__.py
|
|
117
|
+
star_graph/consolidation/abstraction.py
|
|
118
|
+
star_graph/consolidation/community.py
|
|
119
|
+
star_graph/consolidation/competition.py
|
|
120
|
+
star_graph/consolidation/compression.py
|
|
121
|
+
star_graph/consolidation/conflict_detection.py
|
|
122
|
+
star_graph/consolidation/domain_router.py
|
|
123
|
+
star_graph/consolidation/evolution.py
|
|
124
|
+
star_graph/consolidation/ghost.py
|
|
125
|
+
star_graph/consolidation/hub.py
|
|
126
|
+
star_graph/consolidation/memory_revision.py
|
|
127
|
+
star_graph/consolidation/micro_sleep.py
|
|
128
|
+
star_graph/consolidation/reflection_loop.py
|
|
129
|
+
star_graph/consolidation/self_org.py
|
|
130
|
+
star_graph/consolidation/sleep.py
|
|
131
|
+
star_graph/consolidation/sleep_consolidate.py
|
|
132
|
+
star_graph/consolidation/sleep_nrem.py
|
|
133
|
+
star_graph/consolidation/sleep_rem.py
|
|
134
|
+
star_graph/consolidation/sleep_report.py
|
|
135
|
+
star_graph/consolidation/survival.py
|
|
109
136
|
star_graph/contrib/__init__.py
|
|
110
137
|
star_graph/contrib/benchmark.py
|
|
111
138
|
star_graph/contrib/mcp_server.py
|
|
@@ -113,13 +140,43 @@ star_graph/contrib/snapshot.py
|
|
|
113
140
|
star_graph/contrib/streaming.py
|
|
114
141
|
star_graph/contrib/symbolic_filter.py
|
|
115
142
|
star_graph/cortex_api/__init__.py
|
|
143
|
+
star_graph/cortex_api/async_manager.py
|
|
144
|
+
star_graph/cortex_api/gate.py
|
|
145
|
+
star_graph/cortex_api/manager.py
|
|
146
|
+
star_graph/cortex_api/manager_stats.py
|
|
147
|
+
star_graph/cortex_api/mcp_server.py
|
|
148
|
+
star_graph/cortex_api/runtime.py
|
|
149
|
+
star_graph/cortex_api/runtime_core.py
|
|
150
|
+
star_graph/cortex_api/runtime_lifecycle.py
|
|
151
|
+
star_graph/cortex_api/runtime_stats.py
|
|
152
|
+
star_graph/cortex_api/scheduler.py
|
|
153
|
+
star_graph/cortex_api/server.py
|
|
154
|
+
star_graph/cortex_api/working_memory.py
|
|
155
|
+
star_graph/cortex_api/write_gate.py
|
|
116
156
|
star_graph/embedding_provider/__init__.py
|
|
117
157
|
star_graph/embedding_provider/providers.py
|
|
118
158
|
star_graph/extras/__init__.py
|
|
119
159
|
star_graph/extras/autobiography.py
|
|
120
160
|
star_graph/extras/resonance.py
|
|
121
161
|
star_graph/memory_core/__init__.py
|
|
162
|
+
star_graph/memory_core/anchor.py
|
|
163
|
+
star_graph/memory_core/graph.py
|
|
164
|
+
star_graph/memory_core/index.py
|
|
165
|
+
star_graph/memory_core/sqlite_storage.py
|
|
166
|
+
star_graph/memory_core/storage.py
|
|
167
|
+
star_graph/memory_core/storage_backend.py
|
|
168
|
+
star_graph/memory_core/tier.py
|
|
169
|
+
star_graph/memory_core/tiered.py
|
|
122
170
|
star_graph/retrieval_engine/__init__.py
|
|
171
|
+
star_graph/retrieval_engine/bm25.py
|
|
172
|
+
star_graph/retrieval_engine/cognitive_cache.py
|
|
173
|
+
star_graph/retrieval_engine/cross_encoder.py
|
|
174
|
+
star_graph/retrieval_engine/dual_channel.py
|
|
175
|
+
star_graph/retrieval_engine/exact_cache.py
|
|
176
|
+
star_graph/retrieval_engine/retrieval_budget.py
|
|
177
|
+
star_graph/retrieval_engine/retrieval_core.py
|
|
178
|
+
star_graph/retrieval_engine/retrieval_pipeline.py
|
|
179
|
+
star_graph/retrieval_engine/retriever.py
|
|
123
180
|
tests/test_abstraction.py
|
|
124
181
|
tests/test_abstractive_memory.py
|
|
125
182
|
tests/test_anchor.py
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
[console_scripts]
|
|
2
|
+
nwc-export = star_graph.cli:export_cmd
|
|
3
|
+
nwc-forget = star_graph.cli:forget_cmd
|
|
4
|
+
nwc-mcp = star_graph.mcp_server:entry
|
|
5
|
+
nwc-server = star_graph.server:entry
|
|
6
|
+
nwc-verify = star_graph.cli:verify_cmd
|
|
7
|
+
sg-add = star_graph.cli:add
|
|
8
|
+
sg-query = star_graph.cli:query
|
|
9
|
+
sg-sleep = star_graph.cli:sleep_cmd
|
|
10
|
+
sg-stats = star_graph.cli:stats_cmd
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: NWcortex
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.4
|
|
4
4
|
Summary: NeuroWeave Cortex (NWC) — Graph-first cognitive memory runtime for AI agents. Hippocampal-inspired architecture with domain routing, spreading activation, edge budget management, 4-layer compression, thermal storage, personality modeling, and 8-phase sleep consolidation.
|
|
5
5
|
Author-email: Thatgfsj <thatgfsj@users.noreply.github.com>
|
|
6
6
|
License: MIT
|
|
@@ -24,6 +24,11 @@ Requires-Dist: PyYAML>=6.0
|
|
|
24
24
|
Requires-Dist: scikit-learn>=1.3.0
|
|
25
25
|
Provides-Extra: embeddings
|
|
26
26
|
Requires-Dist: sentence-transformers>=2.2.0; extra == "embeddings"
|
|
27
|
+
Provides-Extra: mcp
|
|
28
|
+
Requires-Dist: mcp>=1.0.0; extra == "mcp"
|
|
29
|
+
Provides-Extra: all
|
|
30
|
+
Requires-Dist: sentence-transformers>=2.2.0; extra == "all"
|
|
31
|
+
Requires-Dist: mcp>=1.0.0; extra == "all"
|
|
27
32
|
Dynamic: license-file
|
|
28
33
|
|
|
29
34
|
# NeuroWeave Cortex (NWC) — Cognitive Memory Runtime
|
|
@@ -46,6 +51,12 @@ Vector databases retrieve. Graph databases traverse. NeuroWeave Cortex runs a **
|
|
|
46
51
|
| Automatic forgetting (survival decay) | no | no | yes |
|
|
47
52
|
| Memory strengthening (rehearsal) | no | no | yes |
|
|
48
53
|
| Conflict detection (contradiction edges) | no | no | yes |
|
|
54
|
+
| Multi-strategy RRF retrieval fusion | no | no | yes |
|
|
55
|
+
| Cross-Encoder reranking | no | no | yes |
|
|
56
|
+
| Explainable reasoning paths | no | no | yes |
|
|
57
|
+
| Memory revision engine (sleep) | no | no | yes |
|
|
58
|
+
| Hot/Warm/Cold memory tiering | no | no | yes |
|
|
59
|
+
| Multimodal (text+image+audio) | no | no | yes |
|
|
49
60
|
| Fuzzy recall ("I think I remember...") | no | no | yes |
|
|
50
61
|
| Emergent abstraction (pattern discovery) | no | no | yes |
|
|
51
62
|
| Temporal context (TimeSpine-indexed) | no | no | yes |
|
|
@@ -92,6 +103,9 @@ print(report)
|
|
|
92
103
|
# Persist
|
|
93
104
|
mgr.save("agent_memory.json")
|
|
94
105
|
mgr.load("agent_memory.json")
|
|
106
|
+
|
|
107
|
+
# Export to editable Markdown (GBrain-aligned)
|
|
108
|
+
mgr.export_markdown("memories/")
|
|
95
109
|
```
|
|
96
110
|
|
|
97
111
|
## Architecture
|
|
@@ -109,12 +123,15 @@ Layer 3: Behavior │ Cortex routing, memory gating, working memory,
|
|
|
109
123
|
│
|
|
110
124
|
Layer 2: Cognitive │ Hub abstraction, cascade recall, TimeSpine temporal index,
|
|
111
125
|
(retriever.py, │ sleep consolidation, evolution, ghost revival,
|
|
112
|
-
sleep.py, │ abstraction, community detection, competition
|
|
113
|
-
evolution.py, │
|
|
114
|
-
ghost.py, │
|
|
126
|
+
sleep.py, │ abstraction, community detection, competition,
|
|
127
|
+
evolution.py, │ conflict detection, memory revision, cross-encoder
|
|
128
|
+
ghost.py, │ "How do memories connect, strengthen, and fade?"
|
|
115
129
|
abstraction.py, │
|
|
116
130
|
community.py, │
|
|
117
131
|
competition.py, │
|
|
132
|
+
conflict_detection.py,│
|
|
133
|
+
memory_revision.py, │
|
|
134
|
+
cross_encoder.py, │
|
|
118
135
|
timespine.py, │
|
|
119
136
|
cascade.py, │
|
|
120
137
|
hub.py) │
|
|
@@ -139,11 +156,14 @@ Layer 1: Storage │ CRUD, persistence, ANN indexing, tiered storage,
|
|
|
139
156
|
| `retrieval_pipeline.py` | 5-layer dimensional descent (L0→L4) with automatic degradation |
|
|
140
157
|
| `scheduler.py` | Context-aware retrieval with memory type selection |
|
|
141
158
|
| `working_memory.py` | Short-term buffer (15-item, 1h TTL) — auto-promotes to long-term |
|
|
142
|
-
| `sleep.py` |
|
|
159
|
+
| `sleep.py` | 10-phase sleep: N1_Replay → N2_Merge → N2b_ConflictDetection → N2c_MemoryRevision → N3_Compression → N3d_SleepRebuild → REM_Emotion → N4_Prune (v1.0.4) |
|
|
143
160
|
| `evolution.py` | Survival-based decay (Ebbinghaus/Power-law/Exponential), belief transitions, interference |
|
|
144
161
|
| `retriever.py` | HybridFusion + OscillationResonance + VectorSimilarity + Personalized PageRank + explainable scores |
|
|
145
162
|
| `dual_channel.py` | System-1 (fast) + System-2 (deep) dual-channel retrieval with auto-trigger |
|
|
146
|
-
| `bm25.py` | Sparse keyword retrieval (BM25) with reciprocal rank fusion for hybrid search |
|
|
163
|
+
| `bm25.py` | Sparse keyword retrieval (BM25) with weighted reciprocal rank fusion for hybrid search |
|
|
164
|
+
| `cross_encoder.py` | Post-retrieval Cross-Encoder reranking (sentence-transformers) for precision improvement |
|
|
165
|
+
| `conflict_detection.py` | Semantic contradiction detection with overwrite/coexist/deprecate resolution strategies |
|
|
166
|
+
| `memory_revision.py` | Sleep-phase memory revision engine — surprise-prioritized, template/LLM re-summarization |
|
|
147
167
|
| `ghost.py` | Latent memory traces with fuzzy recall and contradiction tracking (NegativeGhost) |
|
|
148
168
|
| `abstraction.py` | Emergent category discovery from anchor clusters |
|
|
149
169
|
| `community.py` | Louvain community detection with centroid routing |
|
|
@@ -162,6 +182,11 @@ Layer 1: Storage │ CRUD, persistence, ANN indexing, tiered storage,
|
|
|
162
182
|
| `resonance.py` | Phase-locked oscillation resonance for temporal-coherent retrieval |
|
|
163
183
|
| `streaming.py` | Streaming memory buffer with backpressure |
|
|
164
184
|
| `benchmark.py` | Built-in benchmark suite (5 categories) |
|
|
185
|
+
| `batch_vectorizer.py` | Deferred batch embedding writes (buffer >= 32 / >30s flush) with SQLite WAL crash recovery |
|
|
186
|
+
| `zero_llm_pipeline.py` | 7-stage zero-LLM ingestion: security → embed → dedup → entity → classify → score → link |
|
|
187
|
+
| `multimodal.py` | Cross-modal text/image/audio memory — CLIP image encoding, Whisper/spectrogram audio, unified embedding space |
|
|
188
|
+
| `forget_certificate.py` | Ed25519-signed JWS deletion certificates — GDPR Article 17 provable erasure |
|
|
189
|
+
| `markdown_export.py` | Operator-owned plain-text memory export (GBrain-aligned); timeline + topic Markdown |
|
|
165
190
|
| `config.py` | Centralized YAML config with schema validation, dot-path access, overrides |
|
|
166
191
|
|
|
167
192
|
## Retrieval Benchmarks
|
|
@@ -264,11 +289,14 @@ See `star_graph/defaults.yaml` for all 300+ tunable parameters.
|
|
|
264
289
|
# From PyPI (package name: NWcortex, import as: star_graph)
|
|
265
290
|
pip install NWcortex
|
|
266
291
|
|
|
267
|
-
# With sentence-transformers for semantic embeddings
|
|
292
|
+
# With sentence-transformers for semantic embeddings
|
|
268
293
|
pip install "NWcortex[embeddings]"
|
|
269
294
|
|
|
270
|
-
#
|
|
271
|
-
pip install
|
|
295
|
+
# With MCP server support (for AI agent integration)
|
|
296
|
+
pip install "NWcortex[mcp]"
|
|
297
|
+
|
|
298
|
+
# Everything
|
|
299
|
+
pip install "NWcortex[all]"
|
|
272
300
|
|
|
273
301
|
# Run demo
|
|
274
302
|
python examples/emergence_demo.py
|
|
@@ -276,6 +304,91 @@ python examples/emergence_demo.py
|
|
|
276
304
|
|
|
277
305
|
**Note:** Without `[embeddings]`, the system uses a lightweight TF-IDF fallback for text encoding. Install `sentence-transformers` only if you need semantic-quality embeddings.
|
|
278
306
|
|
|
307
|
+
## MCP Server — AI Agent Integration
|
|
308
|
+
|
|
309
|
+
NeuroWeave Cortex ships with a [Model Context Protocol](https://modelcontextprotocol.io) server. Connect any MCP-compatible AI agent (Claude Desktop, OpenClaw, Cursor, etc.) for persistent cognitive memory across conversations.
|
|
310
|
+
|
|
311
|
+
### Quick start
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
# Install with MCP support
|
|
315
|
+
pip install "NWcortex[mcp]"
|
|
316
|
+
|
|
317
|
+
# Launch the MCP server on stdio
|
|
318
|
+
nwc-mcp
|
|
319
|
+
|
|
320
|
+
# With persistent storage
|
|
321
|
+
nwc-mcp --storage agent_memory.json
|
|
322
|
+
|
|
323
|
+
# Load a previously saved memory graph
|
|
324
|
+
nwc-mcp --load my_memories.json
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
### Tool reference (12 tools)
|
|
328
|
+
|
|
329
|
+
| Tool | Description |
|
|
330
|
+
|------|-------------|
|
|
331
|
+
| `remember` | Store a long-term memory (tags, importance, emotional valence) |
|
|
332
|
+
| `remember_working` | Store in fast ephemeral working-memory buffer (current task context) |
|
|
333
|
+
| `recall` | Context-aware semantic retrieval with task-type routing |
|
|
334
|
+
| `forget` | Remove a memory, creating a ghost trace for potential fuzzy recall |
|
|
335
|
+
| `sleep` | Run 5-phase sleep consolidation — merges, prunes, forms schemas |
|
|
336
|
+
| `consolidate` | Micro-consolidation — incremental, non-blocking |
|
|
337
|
+
| `stats` | Memory system statistics (anchors, edges, ghosts, schemas, cognitive health) |
|
|
338
|
+
| `fuzzy_recall` | Low-confidence recall from ghost traces ("I seem to remember...") |
|
|
339
|
+
| `get_profile` | Inferred user profile from accumulated memories |
|
|
340
|
+
| `evolve` | Memory evolution cycle (decay, boost, conflict resolution) |
|
|
341
|
+
| `save` | Persist memory graph to disk (JSON) |
|
|
342
|
+
| `load` | Load memory graph from disk (JSON) |
|
|
343
|
+
|
|
344
|
+
### Claude Desktop config
|
|
345
|
+
|
|
346
|
+
```json
|
|
347
|
+
{
|
|
348
|
+
"mcpServers": {
|
|
349
|
+
"neuroweave-cortex": {
|
|
350
|
+
"command": "nwc-mcp",
|
|
351
|
+
"args": ["--storage", "/path/to/agent_memory.json"]
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
### OpenClaw config
|
|
358
|
+
|
|
359
|
+
```json
|
|
360
|
+
{
|
|
361
|
+
"mcpServers": {
|
|
362
|
+
"neuroweave-cortex": {
|
|
363
|
+
"command": "nwc-mcp",
|
|
364
|
+
"args": ["--storage", "/path/to/agent_memory.json"]
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
## REST API Server
|
|
371
|
+
|
|
372
|
+
```bash
|
|
373
|
+
# Start the REST server
|
|
374
|
+
nwc-server --port 8420
|
|
375
|
+
|
|
376
|
+
# Or via module
|
|
377
|
+
python -m star_graph.server --port 8420
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
Endpoints:
|
|
381
|
+
|
|
382
|
+
| Method | Path | Description |
|
|
383
|
+
|--------|------|-------------|
|
|
384
|
+
| GET | `/health` | Health check with anchor/edge counts |
|
|
385
|
+
| GET | `/metrics` | Prometheus-format metrics |
|
|
386
|
+
| GET | `/stats` | Full memory system statistics |
|
|
387
|
+
| POST | `/remember` | Store a memory `{"text": "...", "tags": [...]}` |
|
|
388
|
+
| POST | `/recall` | Retrieve memories `{"query": "...", "max_items": 10}` |
|
|
389
|
+
| POST | `/sleep` | Run sleep consolidation |
|
|
390
|
+
| POST | `/consolidate` | Run micro-consolidation |
|
|
391
|
+
|
|
279
392
|
## Interactive Demo
|
|
280
393
|
|
|
281
394
|
```bash
|
|
@@ -287,6 +400,9 @@ python examples/emergence_demo.py
|
|
|
287
400
|
# sg-query --trace "When did Alice visit Hawaii?"
|
|
288
401
|
# sg-stats --schemas --ghosts
|
|
289
402
|
# sg-sleep --retention 0.15 --edge-prune 0.1
|
|
403
|
+
# nwc-export --output memories/ --organize both
|
|
404
|
+
# nwc-forget <anchor_id> --certificate --reason gdpr_art17
|
|
405
|
+
# nwc-verify certificates/forget-<id>.jws
|
|
290
406
|
```
|
|
291
407
|
|
|
292
408
|
## Benchmarks
|
|
@@ -306,7 +422,7 @@ pytest tests/ -v
|
|
|
306
422
|
pytest tests/ --cov=star_graph --cov-report=term
|
|
307
423
|
```
|
|
308
424
|
|
|
309
|
-
**Status:** 1,989 tests passing,
|
|
425
|
+
**Status:** 1,989 tests passing, 84 modules (v1.0.4-dev).
|
|
310
426
|
|
|
311
427
|
## Roadmap
|
|
312
428
|
|