soul-protocol 0.2.3__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.
Files changed (307) hide show
  1. soul_protocol-0.2.3/.claude/CLAUDE.md +16 -0
  2. soul_protocol-0.2.3/.continuerules +16 -0
  3. soul_protocol-0.2.3/.github/CODEOWNERS +18 -0
  4. soul_protocol-0.2.3/.github/PULL_REQUEST_TEMPLATE.md +20 -0
  5. soul_protocol-0.2.3/.github/workflows/ci.yml +53 -0
  6. soul_protocol-0.2.3/.github/workflows/pr-quality-gate.yml +306 -0
  7. soul_protocol-0.2.3/.github/workflows/stale.yml +37 -0
  8. soul_protocol-0.2.3/.gitignore +50 -0
  9. soul_protocol-0.2.3/.mcp.json +15 -0
  10. soul_protocol-0.2.3/.windsurfrules +16 -0
  11. soul_protocol-0.2.3/AGENTS.md +16 -0
  12. soul_protocol-0.2.3/FAQ.md +77 -0
  13. soul_protocol-0.2.3/LICENSE +21 -0
  14. soul_protocol-0.2.3/PKG-INFO +426 -0
  15. soul_protocol-0.2.3/README.md +369 -0
  16. soul_protocol-0.2.3/WHITEPAPER.md +613 -0
  17. soul_protocol-0.2.3/assets/charts/contribution_waterfall.png +0 -0
  18. soul_protocol-0.2.3/assets/charts/tier3_judge_heatmap.png +0 -0
  19. soul_protocol-0.2.3/assets/charts/tier3_multijudge.png +0 -0
  20. soul_protocol-0.2.3/assets/charts/tier4_ablation.png +0 -0
  21. soul_protocol-0.2.3/assets/charts/tier5_mem0.png +0 -0
  22. soul_protocol-0.2.3/assets/generate_charts.py +233 -0
  23. soul_protocol-0.2.3/docs/COMPARISON.md +110 -0
  24. soul_protocol-0.2.3/docs/GAP-ANALYSIS.md +558 -0
  25. soul_protocol-0.2.3/docs/api-reference.md +933 -0
  26. soul_protocol-0.2.3/docs/architecture.md +418 -0
  27. soul_protocol-0.2.3/docs/cli-reference.md +356 -0
  28. soul_protocol-0.2.3/docs/cognitive-engine.md +363 -0
  29. soul_protocol-0.2.3/docs/configuration.md +331 -0
  30. soul_protocol-0.2.3/docs/core-concepts.md +329 -0
  31. soul_protocol-0.2.3/docs/getting-started.md +239 -0
  32. soul_protocol-0.2.3/docs/guide-soul-inject.md +254 -0
  33. soul_protocol-0.2.3/docs/index.md +59 -0
  34. soul_protocol-0.2.3/docs/integrations.md +539 -0
  35. soul_protocol-0.2.3/docs/mcp-server.md +277 -0
  36. soul_protocol-0.2.3/docs/memory-architecture.md +491 -0
  37. soul_protocol-0.2.3/docs/self-model.md +177 -0
  38. soul_protocol-0.2.3/examples/logging_config.py +135 -0
  39. soul_protocol-0.2.3/examples/pocketpaw_integration.py +188 -0
  40. soul_protocol-0.2.3/examples/real_agent.py +375 -0
  41. soul_protocol-0.2.3/examples/soul-agent/README.md +123 -0
  42. soul_protocol-0.2.3/examples/soul-agent/SETUP.md +41 -0
  43. soul_protocol-0.2.3/examples/soul-agent/anaya.yaml +49 -0
  44. soul_protocol-0.2.3/examples/soul-agent/soul_agent.py +379 -0
  45. soul_protocol-0.2.3/examples/test_pocketpaw_integration.py +197 -0
  46. soul_protocol-0.2.3/paper/.gitignore +17 -0
  47. soul_protocol-0.2.3/paper/Makefile +15 -0
  48. soul_protocol-0.2.3/paper/main.pdf +0 -0
  49. soul_protocol-0.2.3/paper/main.tex +600 -0
  50. soul_protocol-0.2.3/paper/neurips_2025.sty +382 -0
  51. soul_protocol-0.2.3/paper/references.bib +136 -0
  52. soul_protocol-0.2.3/pyproject.toml +88 -0
  53. soul_protocol-0.2.3/research/EVAL-FRAMEWORK.md +1 -0
  54. soul_protocol-0.2.3/research/README.md +145 -0
  55. soul_protocol-0.2.3/research/__init__.py +3 -0
  56. soul_protocol-0.2.3/research/__main__.py +4 -0
  57. soul_protocol-0.2.3/research/agents.py +178 -0
  58. soul_protocol-0.2.3/research/analysis.py +538 -0
  59. soul_protocol-0.2.3/research/conditions.py +279 -0
  60. soul_protocol-0.2.3/research/config.py +67 -0
  61. soul_protocol-0.2.3/research/dspy_training/__init__.py +2 -0
  62. soul_protocol-0.2.3/research/dspy_training/generate_dataset.py +266 -0
  63. soul_protocol-0.2.3/research/eval/__init__.py +2 -0
  64. soul_protocol-0.2.3/research/eval/__main__.py +6 -0
  65. soul_protocol-0.2.3/research/eval/corpus/sentiment_labels.json +63 -0
  66. soul_protocol-0.2.3/research/eval/corpus/topic_turns.json +205 -0
  67. soul_protocol-0.2.3/research/eval/dimensions/__init__.py +2 -0
  68. soul_protocol-0.2.3/research/eval/dimensions/d1_memory.py +152 -0
  69. soul_protocol-0.2.3/research/eval/dimensions/d2_emotion.py +549 -0
  70. soul_protocol-0.2.3/research/eval/dimensions/d3_personality.py +320 -0
  71. soul_protocol-0.2.3/research/eval/dimensions/d4_bond.py +401 -0
  72. soul_protocol-0.2.3/research/eval/dimensions/d5_self_model.py +476 -0
  73. soul_protocol-0.2.3/research/eval/dimensions/d6_continuity.py +267 -0
  74. soul_protocol-0.2.3/research/eval/dimensions/d7_portability.py +232 -0
  75. soul_protocol-0.2.3/research/eval/llm_judge.py +502 -0
  76. soul_protocol-0.2.3/research/eval/report.py +296 -0
  77. soul_protocol-0.2.3/research/eval/results/.gitignore +5 -0
  78. soul_protocol-0.2.3/research/eval/results/heuristic_baseline.json +138 -0
  79. soul_protocol-0.2.3/research/eval/results/llm_judge_20260312_193724.json +588 -0
  80. soul_protocol-0.2.3/research/eval/suite.py +272 -0
  81. soul_protocol-0.2.3/research/eval_ui/README.md +66 -0
  82. soul_protocol-0.2.3/research/eval_ui/__init__.py +2 -0
  83. soul_protocol-0.2.3/research/eval_ui/app.py +578 -0
  84. soul_protocol-0.2.3/research/eval_ui/templates/chat.html +733 -0
  85. soul_protocol-0.2.3/research/eval_ui/templates/index.html +143 -0
  86. soul_protocol-0.2.3/research/eval_ui/templates/instructions.html +115 -0
  87. soul_protocol-0.2.3/research/haiku_engine.py +110 -0
  88. soul_protocol-0.2.3/research/litellm_engine.py +86 -0
  89. soul_protocol-0.2.3/research/long_horizon/__init__.py +23 -0
  90. soul_protocol-0.2.3/research/long_horizon/analyze.py +285 -0
  91. soul_protocol-0.2.3/research/long_horizon/runner.py +379 -0
  92. soul_protocol-0.2.3/research/long_horizon/scale_scenarios.py +809 -0
  93. soul_protocol-0.2.3/research/long_horizon/scenarios.py +602 -0
  94. soul_protocol-0.2.3/research/metrics.py +235 -0
  95. soul_protocol-0.2.3/research/quality/__init__.py +5 -0
  96. soul_protocol-0.2.3/research/quality/conditions.py +196 -0
  97. soul_protocol-0.2.3/research/quality/enhanced_runner.py +601 -0
  98. soul_protocol-0.2.3/research/quality/judge.py +462 -0
  99. soul_protocol-0.2.3/research/quality/mem0_benchmark.py +1049 -0
  100. soul_protocol-0.2.3/research/quality/multi_judge.py +230 -0
  101. soul_protocol-0.2.3/research/quality/responder.py +110 -0
  102. soul_protocol-0.2.3/research/quality/run_quality.py +314 -0
  103. soul_protocol-0.2.3/research/quality/scenario_generator.py +1011 -0
  104. soul_protocol-0.2.3/research/quality/test_scenarios.py +718 -0
  105. soul_protocol-0.2.3/research/run.py +229 -0
  106. soul_protocol-0.2.3/research/run_ablation.py +64 -0
  107. soul_protocol-0.2.3/research/run_dspy_optimization.py +512 -0
  108. soul_protocol-0.2.3/research/run_scale_ablation.py +467 -0
  109. soul_protocol-0.2.3/research/run_tier2.py +237 -0
  110. soul_protocol-0.2.3/research/scenarios.py +317 -0
  111. soul_protocol-0.2.3/research/simulator.py +393 -0
  112. soul_protocol-0.2.3/research/test_smoke.py +315 -0
  113. soul_protocol-0.2.3/rfc/RFC-001-IDENTITY-AND-DID.md +192 -0
  114. soul_protocol-0.2.3/rfc/RFC-002-MEMORY-STORE-INTERFACE.md +251 -0
  115. soul_protocol-0.2.3/rfc/RFC-003-COGNITIVE-ENGINE-PROTOCOL.md +254 -0
  116. soul_protocol-0.2.3/rfc/RFC-004-SOUL-FILE-FORMAT.md +261 -0
  117. soul_protocol-0.2.3/rfc/RFC-005-ETERNAL-STORAGE-PROVIDER.md +260 -0
  118. soul_protocol-0.2.3/schemas/Biorhythms.schema.json +24 -0
  119. soul_protocol-0.2.3/schemas/CommunicationStyle.schema.json +27 -0
  120. soul_protocol-0.2.3/schemas/CoreMemory.schema.json +17 -0
  121. soul_protocol-0.2.3/schemas/DNA.schema.json +111 -0
  122. soul_protocol-0.2.3/schemas/EvolutionConfig.schema.json +117 -0
  123. soul_protocol-0.2.3/schemas/GeneralEvent.schema.json +34 -0
  124. soul_protocol-0.2.3/schemas/Identity.schema.json +104 -0
  125. soul_protocol-0.2.3/schemas/Interaction.schema.json +34 -0
  126. soul_protocol-0.2.3/schemas/MemoryEntry.schema.json +165 -0
  127. soul_protocol-0.2.3/schemas/MemorySettings.schema.json +37 -0
  128. soul_protocol-0.2.3/schemas/Mood.schema.json +15 -0
  129. soul_protocol-0.2.3/schemas/Mutation.schema.json +64 -0
  130. soul_protocol-0.2.3/schemas/Personality.schema.json +42 -0
  131. soul_protocol-0.2.3/schemas/README.md +74 -0
  132. soul_protocol-0.2.3/schemas/ReflectionResult.schema.json +32 -0
  133. soul_protocol-0.2.3/schemas/SelfImage.schema.json +24 -0
  134. soul_protocol-0.2.3/schemas/SignificanceScore.schema.json +28 -0
  135. soul_protocol-0.2.3/schemas/SomaticMarker.schema.json +26 -0
  136. soul_protocol-0.2.3/schemas/SoulConfig.schema.json +486 -0
  137. soul_protocol-0.2.3/schemas/SoulManifest.schema.json +69 -0
  138. soul_protocol-0.2.3/schemas/SoulState.schema.json +59 -0
  139. soul_protocol-0.2.3/schemas/soul-protocol.schema.json +876 -0
  140. soul_protocol-0.2.3/scripts/e2e_paw_integration.py +829 -0
  141. soul_protocol-0.2.3/scripts/generate_schemas.py +169 -0
  142. soul_protocol-0.2.3/scripts/simulate.py +5209 -0
  143. soul_protocol-0.2.3/scripts/simulate_memory_evolution.py +233 -0
  144. soul_protocol-0.2.3/scripts/simulate_real_users.py +1096 -0
  145. soul_protocol-0.2.3/spec/SOUL-FORMAT-SPEC.md +1260 -0
  146. soul_protocol-0.2.3/src/soul_protocol/__init__.py +124 -0
  147. soul_protocol-0.2.3/src/soul_protocol/__main__.py +9 -0
  148. soul_protocol-0.2.3/src/soul_protocol/cli/__init__.py +2 -0
  149. soul_protocol-0.2.3/src/soul_protocol/cli/inject.py +198 -0
  150. soul_protocol-0.2.3/src/soul_protocol/cli/main.py +1035 -0
  151. soul_protocol-0.2.3/src/soul_protocol/cli/setup.py +456 -0
  152. soul_protocol-0.2.3/src/soul_protocol/demo.py +462 -0
  153. soul_protocol-0.2.3/src/soul_protocol/mcp/__init__.py +6 -0
  154. soul_protocol-0.2.3/src/soul_protocol/mcp/server.py +695 -0
  155. soul_protocol-0.2.3/src/soul_protocol/runtime/__init__.py +5 -0
  156. soul_protocol-0.2.3/src/soul_protocol/runtime/bond.py +45 -0
  157. soul_protocol-0.2.3/src/soul_protocol/runtime/cognitive/__init__.py +16 -0
  158. soul_protocol-0.2.3/src/soul_protocol/runtime/cognitive/dspy_adapter.py +284 -0
  159. soul_protocol-0.2.3/src/soul_protocol/runtime/cognitive/dspy_modules.py +123 -0
  160. soul_protocol-0.2.3/src/soul_protocol/runtime/cognitive/dspy_optimizer.py +331 -0
  161. soul_protocol-0.2.3/src/soul_protocol/runtime/cognitive/engine.py +654 -0
  162. soul_protocol-0.2.3/src/soul_protocol/runtime/cognitive/prompts.py +105 -0
  163. soul_protocol-0.2.3/src/soul_protocol/runtime/crypto/__init__.py +9 -0
  164. soul_protocol-0.2.3/src/soul_protocol/runtime/crypto/encrypt.py +87 -0
  165. soul_protocol-0.2.3/src/soul_protocol/runtime/dna/__init__.py +9 -0
  166. soul_protocol-0.2.3/src/soul_protocol/runtime/dna/prompt.py +157 -0
  167. soul_protocol-0.2.3/src/soul_protocol/runtime/embeddings/__init__.py +22 -0
  168. soul_protocol-0.2.3/src/soul_protocol/runtime/embeddings/hash_embedder.py +89 -0
  169. soul_protocol-0.2.3/src/soul_protocol/runtime/embeddings/protocol.py +7 -0
  170. soul_protocol-0.2.3/src/soul_protocol/runtime/embeddings/similarity.py +11 -0
  171. soul_protocol-0.2.3/src/soul_protocol/runtime/embeddings/tfidf_embedder.py +137 -0
  172. soul_protocol-0.2.3/src/soul_protocol/runtime/embeddings/vector_strategy.py +142 -0
  173. soul_protocol-0.2.3/src/soul_protocol/runtime/eternal/__init__.py +14 -0
  174. soul_protocol-0.2.3/src/soul_protocol/runtime/eternal/manager.py +132 -0
  175. soul_protocol-0.2.3/src/soul_protocol/runtime/eternal/protocol.py +12 -0
  176. soul_protocol-0.2.3/src/soul_protocol/runtime/eternal/providers/__init__.py +17 -0
  177. soul_protocol-0.2.3/src/soul_protocol/runtime/eternal/providers/local.py +74 -0
  178. soul_protocol-0.2.3/src/soul_protocol/runtime/eternal/providers/mock_arweave.py +77 -0
  179. soul_protocol-0.2.3/src/soul_protocol/runtime/eternal/providers/mock_blockchain.py +82 -0
  180. soul_protocol-0.2.3/src/soul_protocol/runtime/eternal/providers/mock_ipfs.py +69 -0
  181. soul_protocol-0.2.3/src/soul_protocol/runtime/evolution/__init__.py +9 -0
  182. soul_protocol-0.2.3/src/soul_protocol/runtime/evolution/manager.py +219 -0
  183. soul_protocol-0.2.3/src/soul_protocol/runtime/exceptions.py +65 -0
  184. soul_protocol-0.2.3/src/soul_protocol/runtime/export/__init__.py +10 -0
  185. soul_protocol-0.2.3/src/soul_protocol/runtime/export/crypto.py +101 -0
  186. soul_protocol-0.2.3/src/soul_protocol/runtime/export/pack.py +127 -0
  187. soul_protocol-0.2.3/src/soul_protocol/runtime/export/unpack.py +120 -0
  188. soul_protocol-0.2.3/src/soul_protocol/runtime/identity/__init__.py +9 -0
  189. soul_protocol-0.2.3/src/soul_protocol/runtime/identity/did.py +31 -0
  190. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/__init__.py +49 -0
  191. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/activation.py +206 -0
  192. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/archival.py +122 -0
  193. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/attention.py +215 -0
  194. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/compression.py +190 -0
  195. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/core.py +68 -0
  196. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/dedup.py +84 -0
  197. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/episodic.py +239 -0
  198. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/graph.py +357 -0
  199. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/manager.py +1069 -0
  200. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/personality_modulation.py +136 -0
  201. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/procedural.py +103 -0
  202. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/recall.py +129 -0
  203. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/search.py +277 -0
  204. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/self_model.py +544 -0
  205. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/semantic.py +147 -0
  206. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/sentiment.py +466 -0
  207. soul_protocol-0.2.3/src/soul_protocol/runtime/memory/strategy.py +105 -0
  208. soul_protocol-0.2.3/src/soul_protocol/runtime/parsers/__init__.py +2 -0
  209. soul_protocol-0.2.3/src/soul_protocol/runtime/parsers/json_parser.py +26 -0
  210. soul_protocol-0.2.3/src/soul_protocol/runtime/parsers/markdown.py +185 -0
  211. soul_protocol-0.2.3/src/soul_protocol/runtime/parsers/yaml_parser.py +29 -0
  212. soul_protocol-0.2.3/src/soul_protocol/runtime/skills.py +51 -0
  213. soul_protocol-0.2.3/src/soul_protocol/runtime/soul.py +962 -0
  214. soul_protocol-0.2.3/src/soul_protocol/runtime/state/__init__.py +9 -0
  215. soul_protocol-0.2.3/src/soul_protocol/runtime/state/manager.py +186 -0
  216. soul_protocol-0.2.3/src/soul_protocol/runtime/storage/__init__.py +25 -0
  217. soul_protocol-0.2.3/src/soul_protocol/runtime/storage/file.py +265 -0
  218. soul_protocol-0.2.3/src/soul_protocol/runtime/storage/memory_store.py +39 -0
  219. soul_protocol-0.2.3/src/soul_protocol/runtime/storage/protocol.py +35 -0
  220. soul_protocol-0.2.3/src/soul_protocol/runtime/types.py +371 -0
  221. soul_protocol-0.2.3/src/soul_protocol/spec/__init__.py +46 -0
  222. soul_protocol-0.2.3/src/soul_protocol/spec/container.py +119 -0
  223. soul_protocol-0.2.3/src/soul_protocol/spec/embeddings/__init__.py +14 -0
  224. soul_protocol-0.2.3/src/soul_protocol/spec/embeddings/protocol.py +48 -0
  225. soul_protocol-0.2.3/src/soul_protocol/spec/embeddings/similarity.py +67 -0
  226. soul_protocol-0.2.3/src/soul_protocol/spec/eternal/__init__.py +11 -0
  227. soul_protocol-0.2.3/src/soul_protocol/spec/eternal/protocol.py +60 -0
  228. soul_protocol-0.2.3/src/soul_protocol/spec/identity.py +26 -0
  229. soul_protocol-0.2.3/src/soul_protocol/spec/manifest.py +26 -0
  230. soul_protocol-0.2.3/src/soul_protocol/spec/memory.py +126 -0
  231. soul_protocol-0.2.3/src/soul_protocol/spec/soul_file.py +152 -0
  232. soul_protocol-0.2.3/tests/__init__.py +1 -0
  233. soul_protocol-0.2.3/tests/conftest.py +39 -0
  234. soul_protocol-0.2.3/tests/test_archival.py +179 -0
  235. soul_protocol-0.2.3/tests/test_bond.py +107 -0
  236. soul_protocol-0.2.3/tests/test_bug_15_core_memory.py +64 -0
  237. soul_protocol-0.2.3/tests/test_cli/__init__.py +1 -0
  238. soul_protocol-0.2.3/tests/test_cli/test_cli.py +226 -0
  239. soul_protocol-0.2.3/tests/test_cli/test_inject.py +682 -0
  240. soul_protocol-0.2.3/tests/test_cli/test_setup.py +336 -0
  241. soul_protocol-0.2.3/tests/test_cognitive/__init__.py +0 -0
  242. soul_protocol-0.2.3/tests/test_cognitive/test_engine.py +667 -0
  243. soul_protocol-0.2.3/tests/test_cognitive/test_prompts.py +136 -0
  244. soul_protocol-0.2.3/tests/test_compression.py +182 -0
  245. soul_protocol-0.2.3/tests/test_crypto.py +47 -0
  246. soul_protocol-0.2.3/tests/test_demo.py +14 -0
  247. soul_protocol-0.2.3/tests/test_dspy_modules.py +523 -0
  248. soul_protocol-0.2.3/tests/test_e2e_integration.py +621 -0
  249. soul_protocol-0.2.3/tests/test_e2e_new_primitives.py +141 -0
  250. soul_protocol-0.2.3/tests/test_embeddings/__init__.py +2 -0
  251. soul_protocol-0.2.3/tests/test_embeddings/test_e2e_vector_search.py +179 -0
  252. soul_protocol-0.2.3/tests/test_embeddings/test_hash_embedder.py +98 -0
  253. soul_protocol-0.2.3/tests/test_embeddings/test_protocol.py +86 -0
  254. soul_protocol-0.2.3/tests/test_embeddings/test_similarity.py +139 -0
  255. soul_protocol-0.2.3/tests/test_embeddings/test_tfidf_embedder.py +159 -0
  256. soul_protocol-0.2.3/tests/test_embeddings/test_vector_strategy.py +188 -0
  257. soul_protocol-0.2.3/tests/test_encryption.py +308 -0
  258. soul_protocol-0.2.3/tests/test_error_handling.py +226 -0
  259. soul_protocol-0.2.3/tests/test_eternal/__init__.py +2 -0
  260. soul_protocol-0.2.3/tests/test_eternal/test_cli_eternal.py +65 -0
  261. soul_protocol-0.2.3/tests/test_eternal/test_e2e_eternal.py +136 -0
  262. soul_protocol-0.2.3/tests/test_eternal/test_manager.py +157 -0
  263. soul_protocol-0.2.3/tests/test_eternal/test_protocol.py +90 -0
  264. soul_protocol-0.2.3/tests/test_eternal/test_providers.py +183 -0
  265. soul_protocol-0.2.3/tests/test_evolution/__init__.py +1 -0
  266. soul_protocol-0.2.3/tests/test_evolution/test_evolution.py +151 -0
  267. soul_protocol-0.2.3/tests/test_export.py +137 -0
  268. soul_protocol-0.2.3/tests/test_gdpr_deletion.py +437 -0
  269. soul_protocol-0.2.3/tests/test_long_horizon/__init__.py +2 -0
  270. soul_protocol-0.2.3/tests/test_long_horizon/test_analyze.py +324 -0
  271. soul_protocol-0.2.3/tests/test_long_horizon/test_runner.py +274 -0
  272. soul_protocol-0.2.3/tests/test_long_horizon/test_scenarios.py +265 -0
  273. soul_protocol-0.2.3/tests/test_mcp/__init__.py +1 -0
  274. soul_protocol-0.2.3/tests/test_mcp/test_server.py +685 -0
  275. soul_protocol-0.2.3/tests/test_memory/__init__.py +1 -0
  276. soul_protocol-0.2.3/tests/test_memory/test_activation.py +291 -0
  277. soul_protocol-0.2.3/tests/test_memory/test_attention.py +290 -0
  278. soul_protocol-0.2.3/tests/test_memory/test_consolidation.py +527 -0
  279. soul_protocol-0.2.3/tests/test_memory/test_extraction.py +307 -0
  280. soul_protocol-0.2.3/tests/test_memory/test_memory.py +210 -0
  281. soul_protocol-0.2.3/tests/test_memory/test_personality_modulation.py +558 -0
  282. soul_protocol-0.2.3/tests/test_memory/test_search_improvements.py +263 -0
  283. soul_protocol-0.2.3/tests/test_memory/test_self_model.py +633 -0
  284. soul_protocol-0.2.3/tests/test_memory/test_sentiment.py +285 -0
  285. soul_protocol-0.2.3/tests/test_memory/test_sentiment_gaps.py +243 -0
  286. soul_protocol-0.2.3/tests/test_memory/test_strategy.py +276 -0
  287. soul_protocol-0.2.3/tests/test_memory_v2.py +669 -0
  288. soul_protocol-0.2.3/tests/test_models/__init__.py +1 -0
  289. soul_protocol-0.2.3/tests/test_models/test_types.py +109 -0
  290. soul_protocol-0.2.3/tests/test_phase1_fixes.py +260 -0
  291. soul_protocol-0.2.3/tests/test_reincarnation.py +114 -0
  292. soul_protocol-0.2.3/tests/test_schemas.py +178 -0
  293. soul_protocol-0.2.3/tests/test_skills.py +129 -0
  294. soul_protocol-0.2.3/tests/test_soul.py +509 -0
  295. soul_protocol-0.2.3/tests/test_soul_config.py +523 -0
  296. soul_protocol-0.2.3/tests/test_spec/__init__.py +0 -0
  297. soul_protocol-0.2.3/tests/test_spec/test_container.py +119 -0
  298. soul_protocol-0.2.3/tests/test_spec/test_identity.py +65 -0
  299. soul_protocol-0.2.3/tests/test_spec/test_manifest.py +52 -0
  300. soul_protocol-0.2.3/tests/test_spec/test_memory.py +178 -0
  301. soul_protocol-0.2.3/tests/test_spec/test_soul_file.py +138 -0
  302. soul_protocol-0.2.3/tests/test_spec_memory_model.py +234 -0
  303. soul_protocol-0.2.3/tests/test_state/__init__.py +0 -0
  304. soul_protocol-0.2.3/tests/test_state/test_manager.py +215 -0
  305. soul_protocol-0.2.3/tests/test_storage/__init__.py +1 -0
  306. soul_protocol-0.2.3/tests/test_storage/test_storage.py +120 -0
  307. soul_protocol-0.2.3/tests/test_temporal_graph.py +222 -0
@@ -0,0 +1,16 @@
1
+ # Soul
2
+
3
+ ## Soul (Persistent Memory)
4
+
5
+ This project uses [Soul Protocol](https://github.com/qbtrix/soul-protocol) for persistent AI memory via MCP.
6
+
7
+ **On session start:**
8
+ 1. Call `soul_recall` with the current task context to load relevant memories
9
+ 2. Call `soul_state` to check current mood and energy
10
+
11
+ **During work:**
12
+ - `soul_observe` after key decisions, completed tasks, or important conversations
13
+ - `soul_remember` for facts that should persist across sessions
14
+
15
+ **On session end:**
16
+ - The soul auto-saves on shutdown — no manual save needed
@@ -0,0 +1,16 @@
1
+ # Soul
2
+
3
+ ## Soul (Persistent Memory)
4
+
5
+ This project uses [Soul Protocol](https://github.com/qbtrix/soul-protocol) for persistent AI memory via MCP.
6
+
7
+ **On session start:**
8
+ 1. Call `soul_recall` with the current task context to load relevant memories
9
+ 2. Call `soul_state` to check current mood and energy
10
+
11
+ **During work:**
12
+ - `soul_observe` after key decisions, completed tasks, or important conversations
13
+ - `soul_remember` for facts that should persist across sessions
14
+
15
+ **On session end:**
16
+ - The soul auto-saves on shutdown — no manual save needed
@@ -0,0 +1,18 @@
1
+ # CODEOWNERS — require maintainer review for security-critical paths.
2
+ # Added: 2026-03-05 — Initial CODEOWNERS for soul-protocol.
3
+
4
+ # CI/CD workflows
5
+ .github/ @qbtrix/core
6
+
7
+ # Cryptography and signing
8
+ src/soul_protocol/crypto/ @qbtrix/core
9
+
10
+ # Dependencies
11
+ pyproject.toml @qbtrix/core
12
+ uv.lock @qbtrix/core
13
+
14
+ # Soul file format (security-sensitive — handles identity data)
15
+ src/soul_protocol/soul_file/ @qbtrix/core
16
+
17
+ # CLI entry points
18
+ src/soul_protocol/cli/ @qbtrix/core
@@ -0,0 +1,20 @@
1
+ ## What does this PR do?
2
+
3
+ <!-- Describe the change in 2-3 sentences. Link the issue it fixes. -->
4
+
5
+ Fixes #
6
+
7
+ ## How to test
8
+
9
+ <!-- Steps to verify the change works, or paste test output. -->
10
+
11
+ ```
12
+ uv run pytest tests/ -v
13
+ ```
14
+
15
+ ## Checklist
16
+
17
+ - [ ] Tests pass locally (`uv run pytest tests/`)
18
+ - [ ] Lint passes (`uv run ruff check . && uv run ruff format --check .`)
19
+ - [ ] No secrets or credentials in the diff
20
+ - [ ] PR title follows Conventional Commits (`feat:`, `fix:`, `docs:`, etc.)
@@ -0,0 +1,53 @@
1
+ # CI — lint and test on every PR and push to main.
2
+ # Updated: 2026-03-05 — Lint errors fixed, lint job now blocks PRs.
3
+ name: CI
4
+
5
+ on:
6
+ push:
7
+ branches: [main]
8
+ pull_request:
9
+ branches: [main]
10
+
11
+ permissions:
12
+ contents: read
13
+
14
+ jobs:
15
+ lint:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Install uv
21
+ uses: astral-sh/setup-uv@v4
22
+
23
+ - name: Set up Python
24
+ run: uv python install 3.12
25
+
26
+ - name: Install dependencies
27
+ run: uv sync --extra dev --extra mcp --extra graph --extra vector
28
+
29
+ - name: Ruff check
30
+ run: uv run ruff check .
31
+
32
+ - name: Ruff format check
33
+ run: uv run ruff format --check .
34
+
35
+ test:
36
+ runs-on: ubuntu-latest
37
+ strategy:
38
+ matrix:
39
+ python-version: ["3.11", "3.12", "3.13"]
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+
43
+ - name: Install uv
44
+ uses: astral-sh/setup-uv@v4
45
+
46
+ - name: Set up Python ${{ matrix.python-version }}
47
+ run: uv python install ${{ matrix.python-version }}
48
+
49
+ - name: Install dependencies
50
+ run: uv sync --extra dev --extra mcp --extra graph --extra vector
51
+
52
+ - name: Run tests
53
+ run: uv run pytest tests/ -v
@@ -0,0 +1,306 @@
1
+ # PR quality gate — enforces contribution standards and security checks.
2
+ # Added: 2026-03-05 — Quality gate + security scan for soul-protocol.
3
+ name: PR Quality Gate
4
+
5
+ on:
6
+ pull_request:
7
+ types: [opened, edited, synchronize, reopened]
8
+
9
+ permissions:
10
+ pull-requests: write
11
+ issues: write
12
+ contents: read
13
+
14
+ jobs:
15
+ check-quality:
16
+ runs-on: ubuntu-latest
17
+ if: >-
18
+ github.actor != 'dependabot[bot]' &&
19
+ github.actor != 'renovate[bot]' &&
20
+ github.actor != 'github-actions[bot]'
21
+ steps:
22
+ - name: Check PR quality
23
+ uses: actions/github-script@v7
24
+ with:
25
+ script: |
26
+ const pr = context.payload.pull_request;
27
+ const body = pr.body || '';
28
+ const title = pr.title || '';
29
+ const base = pr.base.ref;
30
+ const additions = pr.additions || 0;
31
+ const deletions = pr.deletions || 0;
32
+ const changedFiles = pr.changed_files || 0;
33
+
34
+ const issues = [];
35
+ const warnings = [];
36
+ const MARKER = '<!-- pr-quality-gate -->';
37
+
38
+ // Check for conventional commit title
39
+ const conventionalRe = /^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?!?:\s.+/;
40
+ if (!conventionalRe.test(title)) {
41
+ issues.push('- PR title does not follow [Conventional Commits](https://www.conventionalcommits.org/) format (e.g. `feat: add recall API`, `fix(memory): handle empty tiers`).');
42
+ }
43
+
44
+ // Linked issue
45
+ const hasIssueRef = /(?:fixes|closes|resolves)\s*#\d+/i.test(body) ||
46
+ /#\d+/.test(body);
47
+ if (!hasIssueRef) {
48
+ issues.push('- No linked issue found. PRs should reference an issue (`Fixes #123`).');
49
+ }
50
+
51
+ // Description quality
52
+ const strippedBody = body
53
+ .replace(/<!--[\s\S]*?-->/g, '')
54
+ .replace(/#+\s*.*/g, '')
55
+ .replace(/- \[ \].*/g, '')
56
+ .replace(/\s/g, '');
57
+ if (strippedBody.length < 50) {
58
+ issues.push('- PR description is too short. Please describe what this PR does and how to test it.');
59
+ }
60
+
61
+ // Testing evidence
62
+ const hasTestEvidence = /terminal|output|screenshot|tested|test result/i.test(body) ||
63
+ /```[\s\S]*```/.test(body);
64
+ if (!hasTestEvidence) {
65
+ issues.push('- No evidence of local testing found. Please include terminal output or screenshots.');
66
+ }
67
+
68
+ // Get changed file list
69
+ const { data: files } = await github.rest.pulls.listFiles({
70
+ owner: context.repo.owner,
71
+ repo: context.repo.repo,
72
+ pull_number: pr.number,
73
+ per_page: 100
74
+ });
75
+ const fileNames = files.map(f => f.filename);
76
+
77
+ // PR size gate
78
+ const totalLines = additions + deletions;
79
+ if (totalLines > 500 || changedFiles > 15) {
80
+ warnings.push(`- Large PR detected (${totalLines} lines across ${changedFiles} files). Consider splitting into smaller PRs.`);
81
+ }
82
+
83
+ // Sensitive file change alerts
84
+ const sensitivePatterns = [
85
+ { pattern: /^\.github\//, label: 'CI/CD workflows' },
86
+ { pattern: /^src\/soul_protocol\/crypto/, label: 'cryptography' },
87
+ { pattern: /^pyproject\.toml$/, label: 'project dependencies' },
88
+ { pattern: /^uv\.lock$/, label: 'lock file' },
89
+ ];
90
+ const touchedSensitive = [];
91
+ for (const { pattern, label } of sensitivePatterns) {
92
+ if (fileNames.some(f => pattern.test(f))) {
93
+ touchedSensitive.push(label);
94
+ }
95
+ }
96
+ if (touchedSensitive.length > 0) {
97
+ warnings.push(`- This PR touches sensitive files (${touchedSensitive.join(', ')}). These paths require maintainer review via CODEOWNERS.`);
98
+ }
99
+
100
+ // Dependency change alert
101
+ const depFiles = fileNames.filter(f => f === 'pyproject.toml' || f === 'uv.lock');
102
+ if (depFiles.length > 0) {
103
+ const depChanges = files.filter(f => depFiles.includes(f.filename));
104
+ const depDetail = depChanges.map(f => `\`${f.filename}\` (+${f.additions}/-${f.deletions})`).join(', ');
105
+ warnings.push(`- Dependency files changed: ${depDetail}. Reviewers: check for added/removed/changed packages.`);
106
+ }
107
+
108
+ // Find existing bot comment
109
+ const { data: comments } = await github.rest.issues.listComments({
110
+ owner: context.repo.owner,
111
+ repo: context.repo.repo,
112
+ issue_number: pr.number,
113
+ });
114
+ const botComment = comments.find(
115
+ c => c.user.type === 'Bot' && c.body.includes(MARKER)
116
+ );
117
+
118
+ if (issues.length > 0 || warnings.length > 0) {
119
+ let message = `${MARKER}\n`;
120
+
121
+ if (issues.length > 0) {
122
+ await github.rest.issues.addLabels({
123
+ owner: context.repo.owner,
124
+ repo: context.repo.repo,
125
+ issue_number: pr.number,
126
+ labels: ['needs-work']
127
+ });
128
+ message += `### Issues (must fix)\n\n${issues.join('\n')}\n\n`;
129
+ }
130
+
131
+ if (warnings.length > 0) {
132
+ message += `### Heads up\n\n${warnings.join('\n')}\n\n`;
133
+ }
134
+
135
+ message += `Please update your PR to address these points.`;
136
+
137
+ if (botComment) {
138
+ await github.rest.issues.updateComment({
139
+ owner: context.repo.owner,
140
+ repo: context.repo.repo,
141
+ comment_id: botComment.id,
142
+ body: message
143
+ });
144
+ } else {
145
+ await github.rest.issues.createComment({
146
+ owner: context.repo.owner,
147
+ repo: context.repo.repo,
148
+ issue_number: pr.number,
149
+ body: message
150
+ });
151
+ }
152
+ } else {
153
+ try {
154
+ await github.rest.issues.removeLabel({
155
+ owner: context.repo.owner,
156
+ repo: context.repo.repo,
157
+ issue_number: pr.number,
158
+ name: 'needs-work'
159
+ });
160
+ } catch (e) { /* label wasn't present */ }
161
+
162
+ if (botComment) {
163
+ await github.rest.issues.updateComment({
164
+ owner: context.repo.owner,
165
+ repo: context.repo.repo,
166
+ comment_id: botComment.id,
167
+ body: `${MARKER}\nAll quality checks passed. Thanks for the clean PR!`
168
+ });
169
+ }
170
+ }
171
+
172
+ security-scan:
173
+ runs-on: ubuntu-latest
174
+ if: >-
175
+ github.actor != 'dependabot[bot]' &&
176
+ github.actor != 'renovate[bot]' &&
177
+ github.actor != 'github-actions[bot]'
178
+ steps:
179
+ - name: Checkout PR code
180
+ uses: actions/checkout@v4
181
+ with:
182
+ fetch-depth: 0
183
+
184
+ - name: Get changed files
185
+ id: changed
186
+ run: |
187
+ FILES=$(gh pr diff ${{ github.event.pull_request.number }} --name-only 2>/dev/null || git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD)
188
+ echo "files<<EOF" >> "$GITHUB_OUTPUT"
189
+ echo "$FILES" >> "$GITHUB_OUTPUT"
190
+ echo "EOF" >> "$GITHUB_OUTPUT"
191
+ env:
192
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
193
+
194
+ - name: Scan for dangerous code patterns
195
+ run: |
196
+ CHANGED_PY=$(echo "${{ steps.changed.outputs.files }}" | grep '\.py$' || true)
197
+ if [ -z "$CHANGED_PY" ]; then
198
+ echo "No Python files changed — skipping security scan."
199
+ exit 0
200
+ fi
201
+
202
+ echo "Scanning changed Python files for dangerous patterns..."
203
+ FOUND=0
204
+ REPORT=""
205
+
206
+ PATTERNS=(
207
+ 'eval\s*\('
208
+ 'exec\s*\('
209
+ 'os\.system\s*\('
210
+ 'subprocess\..*shell\s*=\s*True'
211
+ '__import__\s*\('
212
+ 'pickle\.loads?\s*\('
213
+ 'yaml\.load\s*\([^)]*$'
214
+ 'yaml\.load\s*\([^)]*\)\s*$'
215
+ 'marshal\.loads?\s*\('
216
+ )
217
+
218
+ for file in $CHANGED_PY; do
219
+ if [ ! -f "$file" ]; then
220
+ continue
221
+ fi
222
+ for pattern in "${PATTERNS[@]}"; do
223
+ MATCHES=$(grep -nE "$pattern" "$file" 2>/dev/null || true)
224
+ if [ -n "$MATCHES" ]; then
225
+ FOUND=1
226
+ REPORT+="### $file\n"
227
+ REPORT+='```\n'
228
+ REPORT+="$MATCHES\n"
229
+ REPORT+='```\n\n'
230
+ fi
231
+ done
232
+ done
233
+
234
+ if [ "$FOUND" -eq 1 ]; then
235
+ COMMENT_BODY=$(cat <<'COMMENT_EOF'
236
+ <!-- security-scan -->
237
+ ## Security scan: review needed
238
+
239
+ Potentially dangerous code patterns detected in changed files. A maintainer should verify these are intentional and safe.
240
+
241
+ COMMENT_EOF
242
+ )
243
+ COMMENT_BODY+=$(echo -e "$REPORT")
244
+
245
+ gh pr comment ${{ github.event.pull_request.number }} \
246
+ --body "$COMMENT_BODY" \
247
+ --edit-last 2>/dev/null || \
248
+ gh pr comment ${{ github.event.pull_request.number }} \
249
+ --body "$COMMENT_BODY"
250
+
251
+ echo "::warning::Security patterns found. Review required."
252
+ else
253
+ echo "No dangerous patterns found."
254
+ fi
255
+ env:
256
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
257
+
258
+ - name: Check for secrets in diff
259
+ run: |
260
+ DIFF=$(git diff origin/${{ github.event.pull_request.base.ref }}...HEAD -- . ':!uv.lock' ':!*.lock' 2>/dev/null || true)
261
+ if [ -z "$DIFF" ]; then
262
+ echo "No diff to scan."
263
+ exit 0
264
+ fi
265
+
266
+ FOUND=0
267
+ PATTERNS=(
268
+ 'AKIA[0-9A-Z]{16}'
269
+ 'sk-[a-zA-Z0-9]{20,}'
270
+ 'ghp_[a-zA-Z0-9]{36}'
271
+ 'gho_[a-zA-Z0-9]{36}'
272
+ 'xoxb-[0-9]+-[a-zA-Z0-9]+'
273
+ 'xoxp-[0-9]+-[a-zA-Z0-9]+'
274
+ 'sk_live_[a-zA-Z0-9]+'
275
+ '-----BEGIN (RSA |EC |DSA )?PRIVATE KEY-----'
276
+ )
277
+
278
+ for pattern in "${PATTERNS[@]}"; do
279
+ if echo "$DIFF" | grep -qE "$pattern"; then
280
+ FOUND=1
281
+ echo "::error::Potential secret detected matching pattern: $pattern"
282
+ fi
283
+ done
284
+
285
+ if [ "$FOUND" -eq 1 ]; then
286
+ gh pr comment ${{ github.event.pull_request.number }} \
287
+ --body "<!-- security-scan-secrets -->
288
+ ## Security scan: potential secrets detected
289
+
290
+ This PR diff appears to contain secrets or API keys. Please remove them immediately and rotate any exposed credentials.
291
+
292
+ If these are false positives (e.g., placeholder patterns in tests), a maintainer will verify." \
293
+ --edit-last 2>/dev/null || \
294
+ gh pr comment ${{ github.event.pull_request.number }} \
295
+ --body "<!-- security-scan-secrets -->
296
+ ## Security scan: potential secrets detected
297
+
298
+ This PR diff appears to contain secrets or API keys. Please remove them immediately and rotate any exposed credentials.
299
+
300
+ If these are false positives (e.g., placeholder patterns in tests), a maintainer will verify."
301
+ exit 1
302
+ fi
303
+
304
+ echo "No secrets detected in diff."
305
+ env:
306
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,37 @@
1
+ # Stale bot — auto-close abandoned PRs and issues.
2
+ # Added: 2026-03-05 — Initial stale config for soul-protocol.
3
+ name: Close stale issues and PRs
4
+
5
+ on:
6
+ schedule:
7
+ - cron: '0 6 * * *'
8
+
9
+ permissions:
10
+ issues: write
11
+ pull-requests: write
12
+
13
+ jobs:
14
+ stale:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/stale@v9
18
+ with:
19
+ stale-issue-message: >
20
+ This issue has been automatically marked as stale because it has not had
21
+ activity in the last 30 days. It will be closed in 14 days if no further
22
+ activity occurs. If this is still relevant, please comment or update.
23
+ stale-pr-message: >
24
+ This PR has been automatically marked as stale because it has not had
25
+ activity in the last 14 days. It will be closed in 7 days if no further
26
+ activity occurs. If you're still working on this, please push an update
27
+ or leave a comment.
28
+ close-issue-message: Closing due to inactivity. Feel free to reopen if still relevant.
29
+ close-pr-message: Closing due to inactivity. If you'd like to continue, please open a new PR.
30
+ days-before-issue-stale: 30
31
+ days-before-issue-close: 14
32
+ days-before-pr-stale: 14
33
+ days-before-pr-close: 7
34
+ stale-issue-label: stale
35
+ stale-pr-label: stale
36
+ exempt-issue-labels: 'pinned,good first issue,roadmap'
37
+ exempt-pr-labels: 'pinned'
@@ -0,0 +1,50 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.egg-info/
6
+ dist/
7
+ build/
8
+ *.egg
9
+ .eggs/
10
+
11
+ # Virtual environments
12
+ .venv/
13
+ venv/
14
+ env/
15
+
16
+ # IDE
17
+ .idea/
18
+ .vscode/
19
+ *.swp
20
+ *.swo
21
+ *~
22
+
23
+ # Testing
24
+ .pytest_cache/
25
+ htmlcov/
26
+ .coverage
27
+ .mypy_cache/
28
+
29
+ # OS
30
+ .DS_Store
31
+ Thumbs.db
32
+
33
+ # Environment
34
+ .env
35
+ .env.local
36
+
37
+ # UV
38
+ uv.lock
39
+
40
+ # Soul files and directories (don't commit user souls)
41
+ *.soul
42
+ .soul/
43
+
44
+ # Simulation results
45
+ .results/
46
+ research/results/
47
+
48
+ # Internal docs (not for public repo)
49
+ idocs/
50
+ .claude/worktrees/
@@ -0,0 +1,15 @@
1
+ {
2
+ "mcpServers": {
3
+ "soul": {
4
+ "command": "uvx",
5
+ "args": [
6
+ "--from",
7
+ "soul-protocol[mcp]",
8
+ "soul-mcp"
9
+ ],
10
+ "env": {
11
+ "SOUL_PATH": "/private/var/folders/my/ly3fsydj59qdt_hj56rtc3dr0000gn/T/pytest-of-prakash/pytest-18/test_init_setup_preserves_exis0/.soul/testbot"
12
+ }
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,16 @@
1
+ # Soul
2
+
3
+ ## Soul (Persistent Memory)
4
+
5
+ This project uses [Soul Protocol](https://github.com/qbtrix/soul-protocol) for persistent AI memory via MCP.
6
+
7
+ **On session start:**
8
+ 1. Call `soul_recall` with the current task context to load relevant memories
9
+ 2. Call `soul_state` to check current mood and energy
10
+
11
+ **During work:**
12
+ - `soul_observe` after key decisions, completed tasks, or important conversations
13
+ - `soul_remember` for facts that should persist across sessions
14
+
15
+ **On session end:**
16
+ - The soul auto-saves on shutdown — no manual save needed
@@ -0,0 +1,16 @@
1
+ # Soul
2
+
3
+ ## Soul (Persistent Memory)
4
+
5
+ This project uses [Soul Protocol](https://github.com/qbtrix/soul-protocol) for persistent AI memory via MCP.
6
+
7
+ **On session start:**
8
+ 1. Call `soul_recall` with the current task context to load relevant memories
9
+ 2. Call `soul_state` to check current mood and energy
10
+
11
+ **During work:**
12
+ - `soul_observe` after key decisions, completed tasks, or important conversations
13
+ - `soul_remember` for facts that should persist across sessions
14
+
15
+ **On session end:**
16
+ - The soul auto-saves on shutdown — no manual save needed
@@ -0,0 +1,77 @@
1
+ <!-- FAQ.md — Public-facing frequently asked questions for Soul Protocol.
2
+ Created: 2026-03-08. Adapted from idocs/HARD-QUESTIONS.md with benchmark data
3
+ from LAUNCH-STATUS.md and technical details from WHITEPAPER.md. -->
4
+
5
+ # Frequently Asked Questions
6
+
7
+ ---
8
+
9
+ ### 1. How is this different from Mem0?
10
+
11
+ Mem0 is a vector memory layer. It stores user facts and retrieves them by similarity. Soul Protocol is an identity protocol. It adds significance gating (deciding what's worth remembering), somatic markers (emotional context on every memory), ACT-R activation decay (memories strengthen or fade based on usage), and a self-model that evolves from experience. In head-to-head benchmarks on identical conversations, Soul Protocol scored 8.5 overall vs. Mem0's 6.0, with the largest gap in emotional continuity (9.2 vs. 7.0). The difference isn't retrieval quality -- it's what gets stored alongside the facts. See [docs/COMPARISON.md](docs/COMPARISON.md) for the full matrix.
12
+
13
+ ---
14
+
15
+ ### 2. How is this different from MemGPT/Letta?
16
+
17
+ MemGPT manages context windows -- it pages memory in and out so an LLM can work with more information than fits in a single prompt. Soul Protocol defines who the agent *is*: personality, emotional memory, self-concept, portable identity. They solve different problems at different layers. A MemGPT system could use Soul Protocol for the identity data that gets paged into context. They're complementary, not competitive.
18
+
19
+ ---
20
+
21
+ ### 3. Why not just use vector embeddings?
22
+
23
+ Vector embeddings answer "what text is similar to this query?" That's one part of memory. Human memory also uses recency and frequency (ACT-R power-law decay), emotional salience (Damasio's somatic markers), significance filtering (LIDA -- not everything deserves to be remembered), and self-relevance (memories shape who you think you are). Soul Protocol models all of these. Vector search is pluggable through the `EmbeddingProvider` interface -- the protocol ships HashEmbedder and TFIDFEmbedder, and you can swap in OpenAI, Cohere, or local embeddings. Embeddings find similar things. Psychology determines what matters. You need both.
24
+
25
+ ---
26
+
27
+ ### 4. The heuristic engine sounds like a toy.
28
+
29
+ The heuristic engine (word-list sentiment, formula-based significance, regex fact extraction) is intentionally simple. It's the offline fallback for when you don't have an LLM available, when you're running tests and need deterministic results, when cost matters, or when privacy requires that no text leaves the machine. The `CognitiveEngine` protocol lets you plug in any LLM for real analysis. The architecture is: LLM when available, heuristic when not. The heuristic has a low ceiling but a high floor -- it never crashes, never costs money, never leaks data, and never hallucinates.
30
+
31
+ ---
32
+
33
+ ### 5. What about hallucinated facts?
34
+
35
+ Valid concern. Current mitigations: structured JSON schemas in extraction prompts reduce hallucination, a validation layer rejects unparseable output, the heuristic fallback kicks in when LLM output can't be parsed, and fact deduplication checks token overlap against existing facts (>70% similarity = skip). The system also tracks fact conflict through `superseded_by` chains rather than silently overwriting. Planned additions include confidence scores on extracted facts, source attribution, and user correction mechanisms. The system degrades gracefully -- bad extraction results in a missed fact, not corrupted state.
36
+
37
+ ---
38
+
39
+ ### 6. How does this handle multi-user?
40
+
41
+ Currently, a soul bonds to one entity (the `bonded_to` field). Multi-user is not built yet. The architecture supports it: the entity graph already tracks relationships, `Interaction.metadata` can carry user IDs, and the self-model could track per-user relationship context. The routing logic needs to be added. This is a planned feature, not a current capability.
42
+
43
+ ---
44
+
45
+ ### 7. Can I use this with my LLM? (Claude, GPT, Ollama, local)
46
+
47
+ Yes. The `CognitiveEngine` protocol is a single method: `async def think(self, prompt: str) -> str`. Implement it with any LLM -- Claude, GPT, Gemini, Ollama, a local model, or anything that takes text in and returns text out. The soul handles prompt construction and response parsing internally. Without any engine at all, the `HeuristicEngine` provides deterministic processing with zero API calls. One integration point, three lines of code.
48
+
49
+ ---
50
+
51
+ ### 8. How do .soul files work exactly?
52
+
53
+ A `.soul` file is a ZIP archive. Rename it to `.zip` and open it with any archive tool. Inside: `manifest.json` (version, soul ID, checksums), `soul.json` (identity, personality DNA, evolution config), `state.json` (mood, energy, focus), `dna.md` (human-readable personality blueprint), and a `memory/` directory containing `core.json`, `episodic.json`, `semantic.json`, `procedural.json`, `graph.json`, and `self_model.json`. Everything is JSON. JSON Schemas are auto-generated from the protocol models, so any language with a JSON Schema validator can read and write `.soul` files without the Python SDK.
54
+
55
+ ---
56
+
57
+ ### 9. Is there a TypeScript implementation?
58
+
59
+ Not yet. The protocol spec is 624 lines of Pydantic models designed for porting. JSON Schemas are auto-generated from those models, so you can validate `.soul` files in TypeScript (or any language) today using standard JSON Schema validators. A native TypeScript SDK is on the roadmap. If you want to build one, the spec layer is intentionally small and self-contained.
60
+
61
+ ---
62
+
63
+ ### 10. Why psychology? Isn't this overengineered?
64
+
65
+ The psychology isn't decoration -- it's the mechanism that makes memory selective. Without significance gating (LIDA), every interaction gets stored and you get memory bloat. Without activation decay (ACT-R), old memories never fade and retrieval degrades. Without somatic markers (Damasio), there's no emotional context and the agent can't track how a user's experience *felt*. In our component ablation, removing these components dropped emotional continuity scores from 9.3 to 7.2. The theories aren't complex to implement -- LIDA is a weighted formula, ACT-R is a power law, somatic markers are three floats. The complexity is in knowing which theories to apply, not in the code.
66
+
67
+ ---
68
+
69
+ ### 11. What about privacy/security?
70
+
71
+ The `.soul` file is a local ZIP archive the user controls. No cloud required, no phone-home, no telemetry. The protocol makes zero network calls. When a `CognitiveEngine` uses a cloud LLM, interaction text goes to that provider -- but that's the consumer's choice, not the protocol's. The heuristic engine processes everything locally with zero external calls. Eternal storage (Arweave/IPFS) is opt-in and planned to support user-controlled encryption. The file format is inspectable: rename to `.zip`, read the JSON, verify exactly what's stored.
72
+
73
+ ---
74
+
75
+ ### 12. How do I integrate this into my existing agent?
76
+
77
+ Three steps. First, birth a soul: `soul = await Soul.birth("Name", engine=YourEngine())`. Second, call `soul.observe(Interaction(user_input=..., agent_output=...))` after each exchange -- this runs the full psychology pipeline (sentiment, significance, fact extraction, self-model update). Third, use `soul.to_system_prompt()` to inject the soul's personality and relevant memories into your agent's system prompt, and `soul.recall(query)` to retrieve specific memories. The soul produces identity data. Your agent framework handles everything else. Works with LangChain, LlamaIndex, custom agents, or bare API calls.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 OCEAN Foundation
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.