cognitive-core 0.0.2 → 0.1.2

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 (857) hide show
  1. package/.claude/settings.json +88 -0
  2. package/.claude/settings.local.json +11 -0
  3. package/.entire/settings.json +4 -0
  4. package/README.md +563 -107
  5. package/SKILL.md +193 -0
  6. package/dist/agents/index.d.ts +3 -0
  7. package/dist/agents/index.d.ts.map +1 -0
  8. package/dist/agents/index.js +5 -0
  9. package/dist/agents/index.js.map +1 -0
  10. package/dist/agents/mock-provider.d.ts +23 -0
  11. package/dist/agents/mock-provider.d.ts.map +1 -0
  12. package/dist/agents/mock-provider.js +71 -0
  13. package/dist/agents/mock-provider.js.map +1 -0
  14. package/dist/agents/types.d.ts +98 -0
  15. package/dist/agents/types.d.ts.map +1 -0
  16. package/dist/agents/types.js +44 -0
  17. package/dist/agents/types.js.map +1 -0
  18. package/dist/atlas.d.ts +334 -0
  19. package/dist/atlas.d.ts.map +1 -0
  20. package/dist/atlas.js +702 -0
  21. package/dist/atlas.js.map +1 -0
  22. package/dist/bin/cognitive-core.d.ts +18 -0
  23. package/dist/bin/cognitive-core.d.ts.map +1 -0
  24. package/dist/bin/cognitive-core.js +419 -0
  25. package/dist/bin/cognitive-core.js.map +1 -0
  26. package/dist/embeddings/bm25.d.ts +104 -0
  27. package/dist/embeddings/bm25.d.ts.map +1 -0
  28. package/dist/embeddings/bm25.js +264 -0
  29. package/dist/embeddings/bm25.js.map +1 -0
  30. package/dist/embeddings/index.d.ts +12 -0
  31. package/dist/embeddings/index.d.ts.map +1 -0
  32. package/dist/embeddings/index.js +16 -0
  33. package/dist/embeddings/index.js.map +1 -0
  34. package/dist/embeddings/manager.d.ts +112 -0
  35. package/dist/embeddings/manager.d.ts.map +1 -0
  36. package/dist/embeddings/manager.js +215 -0
  37. package/dist/embeddings/manager.js.map +1 -0
  38. package/dist/embeddings/provider.d.ts +101 -0
  39. package/dist/embeddings/provider.d.ts.map +1 -0
  40. package/dist/embeddings/provider.js +235 -0
  41. package/dist/embeddings/provider.js.map +1 -0
  42. package/dist/embeddings/vector-store.d.ts +101 -0
  43. package/dist/embeddings/vector-store.d.ts.map +1 -0
  44. package/dist/embeddings/vector-store.js +256 -0
  45. package/dist/embeddings/vector-store.js.map +1 -0
  46. package/dist/factory.d.ts +193 -0
  47. package/dist/factory.d.ts.map +1 -0
  48. package/dist/factory.js +109 -0
  49. package/dist/factory.js.map +1 -0
  50. package/dist/index.d.ts +32 -453
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +115 -509
  53. package/dist/index.js.map +1 -0
  54. package/dist/learning/analyzer.d.ts +110 -0
  55. package/dist/learning/analyzer.d.ts.map +1 -0
  56. package/dist/learning/analyzer.js +213 -0
  57. package/dist/learning/analyzer.js.map +1 -0
  58. package/dist/learning/effectiveness.d.ts +158 -0
  59. package/dist/learning/effectiveness.d.ts.map +1 -0
  60. package/dist/learning/effectiveness.js +251 -0
  61. package/dist/learning/effectiveness.js.map +1 -0
  62. package/dist/learning/index.d.ts +12 -0
  63. package/dist/learning/index.d.ts.map +1 -0
  64. package/dist/learning/index.js +17 -0
  65. package/dist/learning/index.js.map +1 -0
  66. package/dist/learning/knowledge-extractor.d.ts +56 -0
  67. package/dist/learning/knowledge-extractor.d.ts.map +1 -0
  68. package/dist/learning/knowledge-extractor.js +336 -0
  69. package/dist/learning/knowledge-extractor.js.map +1 -0
  70. package/dist/learning/llm-extractor.d.ts +88 -0
  71. package/dist/learning/llm-extractor.d.ts.map +1 -0
  72. package/dist/learning/llm-extractor.js +372 -0
  73. package/dist/learning/llm-extractor.js.map +1 -0
  74. package/dist/learning/meta-learner.d.ts +87 -0
  75. package/dist/learning/meta-learner.d.ts.map +1 -0
  76. package/dist/learning/meta-learner.js +398 -0
  77. package/dist/learning/meta-learner.js.map +1 -0
  78. package/dist/learning/pipeline.d.ts +89 -0
  79. package/dist/learning/pipeline.d.ts.map +1 -0
  80. package/dist/learning/pipeline.js +236 -0
  81. package/dist/learning/pipeline.js.map +1 -0
  82. package/dist/learning/playbook-extractor.d.ts +113 -0
  83. package/dist/learning/playbook-extractor.d.ts.map +1 -0
  84. package/dist/learning/playbook-extractor.js +523 -0
  85. package/dist/learning/playbook-extractor.js.map +1 -0
  86. package/dist/learning/team-ingester.d.ts +152 -0
  87. package/dist/learning/team-ingester.d.ts.map +1 -0
  88. package/dist/learning/team-ingester.js +333 -0
  89. package/dist/learning/team-ingester.js.map +1 -0
  90. package/dist/learning/team-meta-learner.d.ts +50 -0
  91. package/dist/learning/team-meta-learner.d.ts.map +1 -0
  92. package/dist/learning/team-meta-learner.js +417 -0
  93. package/dist/learning/team-meta-learner.js.map +1 -0
  94. package/dist/learning/team-pipeline.d.ts +76 -0
  95. package/dist/learning/team-pipeline.d.ts.map +1 -0
  96. package/dist/learning/team-pipeline.js +266 -0
  97. package/dist/learning/team-pipeline.js.map +1 -0
  98. package/dist/learning/trajectory-sources/dataclaw.d.ts +41 -0
  99. package/dist/learning/trajectory-sources/dataclaw.d.ts.map +1 -0
  100. package/dist/learning/trajectory-sources/dataclaw.js +330 -0
  101. package/dist/learning/trajectory-sources/dataclaw.js.map +1 -0
  102. package/dist/learning/trajectory-sources/entire.d.ts +28 -0
  103. package/dist/learning/trajectory-sources/entire.d.ts.map +1 -0
  104. package/dist/learning/trajectory-sources/entire.js +182 -0
  105. package/dist/learning/trajectory-sources/entire.js.map +1 -0
  106. package/dist/learning/trajectory-sources/file.d.ts +23 -0
  107. package/dist/learning/trajectory-sources/file.d.ts.map +1 -0
  108. package/dist/learning/trajectory-sources/file.js +101 -0
  109. package/dist/learning/trajectory-sources/file.js.map +1 -0
  110. package/dist/learning/trajectory-sources/huggingface.d.ts +36 -0
  111. package/dist/learning/trajectory-sources/huggingface.d.ts.map +1 -0
  112. package/dist/learning/trajectory-sources/huggingface.js +157 -0
  113. package/dist/learning/trajectory-sources/huggingface.js.map +1 -0
  114. package/dist/learning/trajectory-sources/in-memory.d.ts +21 -0
  115. package/dist/learning/trajectory-sources/in-memory.d.ts.map +1 -0
  116. package/dist/learning/trajectory-sources/in-memory.js +43 -0
  117. package/dist/learning/trajectory-sources/in-memory.js.map +1 -0
  118. package/dist/learning/trajectory-sources/index.d.ts +7 -0
  119. package/dist/learning/trajectory-sources/index.d.ts.map +1 -0
  120. package/dist/learning/trajectory-sources/index.js +7 -0
  121. package/dist/learning/trajectory-sources/index.js.map +1 -0
  122. package/dist/learning/trajectory-sources/pipeline.d.ts +24 -0
  123. package/dist/learning/trajectory-sources/pipeline.d.ts.map +1 -0
  124. package/dist/learning/trajectory-sources/pipeline.js +47 -0
  125. package/dist/learning/trajectory-sources/pipeline.js.map +1 -0
  126. package/dist/learning/usage-inference.d.ts +82 -0
  127. package/dist/learning/usage-inference.d.ts.map +1 -0
  128. package/dist/learning/usage-inference.js +261 -0
  129. package/dist/learning/usage-inference.js.map +1 -0
  130. package/dist/mcp/index.d.ts +6 -0
  131. package/dist/mcp/index.d.ts.map +1 -0
  132. package/dist/mcp/index.js +6 -0
  133. package/dist/mcp/index.js.map +1 -0
  134. package/dist/mcp/playbook-server.d.ts +120 -0
  135. package/dist/mcp/playbook-server.d.ts.map +1 -0
  136. package/dist/mcp/playbook-server.js +427 -0
  137. package/dist/mcp/playbook-server.js.map +1 -0
  138. package/dist/memory/curated-loader.d.ts +62 -0
  139. package/dist/memory/curated-loader.d.ts.map +1 -0
  140. package/dist/memory/curated-loader.js +106 -0
  141. package/dist/memory/curated-loader.js.map +1 -0
  142. package/dist/memory/experience.d.ts +122 -0
  143. package/dist/memory/experience.d.ts.map +1 -0
  144. package/dist/memory/experience.js +392 -0
  145. package/dist/memory/experience.js.map +1 -0
  146. package/dist/memory/graph-layers/base.d.ts +29 -0
  147. package/dist/memory/graph-layers/base.d.ts.map +1 -0
  148. package/dist/memory/graph-layers/base.js +143 -0
  149. package/dist/memory/graph-layers/base.js.map +1 -0
  150. package/dist/memory/graph-layers/causal.d.ts +14 -0
  151. package/dist/memory/graph-layers/causal.d.ts.map +1 -0
  152. package/dist/memory/graph-layers/causal.js +14 -0
  153. package/dist/memory/graph-layers/causal.js.map +1 -0
  154. package/dist/memory/graph-layers/entity.d.ts +14 -0
  155. package/dist/memory/graph-layers/entity.d.ts.map +1 -0
  156. package/dist/memory/graph-layers/entity.js +14 -0
  157. package/dist/memory/graph-layers/entity.js.map +1 -0
  158. package/dist/memory/graph-layers/index.d.ts +6 -0
  159. package/dist/memory/graph-layers/index.d.ts.map +1 -0
  160. package/dist/memory/graph-layers/index.js +6 -0
  161. package/dist/memory/graph-layers/index.js.map +1 -0
  162. package/dist/memory/graph-layers/semantic.d.ts +14 -0
  163. package/dist/memory/graph-layers/semantic.d.ts.map +1 -0
  164. package/dist/memory/graph-layers/semantic.js +14 -0
  165. package/dist/memory/graph-layers/semantic.js.map +1 -0
  166. package/dist/memory/graph-layers/temporal.d.ts +14 -0
  167. package/dist/memory/graph-layers/temporal.d.ts.map +1 -0
  168. package/dist/memory/graph-layers/temporal.js +14 -0
  169. package/dist/memory/graph-layers/temporal.js.map +1 -0
  170. package/dist/memory/index.d.ts +14 -0
  171. package/dist/memory/index.d.ts.map +1 -0
  172. package/dist/memory/index.js +19 -0
  173. package/dist/memory/index.js.map +1 -0
  174. package/dist/memory/knowledge-bank.d.ts +220 -0
  175. package/dist/memory/knowledge-bank.d.ts.map +1 -0
  176. package/dist/memory/knowledge-bank.js +1003 -0
  177. package/dist/memory/knowledge-bank.js.map +1 -0
  178. package/dist/memory/knowledge-defrag.d.ts +49 -0
  179. package/dist/memory/knowledge-defrag.d.ts.map +1 -0
  180. package/dist/memory/knowledge-defrag.js +257 -0
  181. package/dist/memory/knowledge-defrag.js.map +1 -0
  182. package/dist/memory/knowledge-graph.d.ts +41 -0
  183. package/dist/memory/knowledge-graph.d.ts.map +1 -0
  184. package/dist/memory/knowledge-graph.js +273 -0
  185. package/dist/memory/knowledge-graph.js.map +1 -0
  186. package/dist/memory/meta.d.ts +90 -0
  187. package/dist/memory/meta.d.ts.map +1 -0
  188. package/dist/memory/meta.js +362 -0
  189. package/dist/memory/meta.js.map +1 -0
  190. package/dist/memory/playbook.d.ts +133 -0
  191. package/dist/memory/playbook.d.ts.map +1 -0
  192. package/dist/memory/playbook.js +357 -0
  193. package/dist/memory/playbook.js.map +1 -0
  194. package/dist/memory/search-provider.d.ts +31 -0
  195. package/dist/memory/search-provider.d.ts.map +1 -0
  196. package/dist/memory/search-provider.js +2 -0
  197. package/dist/memory/search-provider.js.map +1 -0
  198. package/dist/memory/search-providers/index.d.ts +3 -0
  199. package/dist/memory/search-providers/index.d.ts.map +1 -0
  200. package/dist/memory/search-providers/index.js +3 -0
  201. package/dist/memory/search-providers/index.js.map +1 -0
  202. package/dist/memory/search-providers/minimem.d.ts +43 -0
  203. package/dist/memory/search-providers/minimem.d.ts.map +1 -0
  204. package/dist/memory/search-providers/minimem.js +56 -0
  205. package/dist/memory/search-providers/minimem.js.map +1 -0
  206. package/dist/memory/search-providers/text-similarity.d.ts +15 -0
  207. package/dist/memory/search-providers/text-similarity.d.ts.map +1 -0
  208. package/dist/memory/search-providers/text-similarity.js +21 -0
  209. package/dist/memory/search-providers/text-similarity.js.map +1 -0
  210. package/dist/memory/skill-exporter.d.ts +75 -0
  211. package/dist/memory/skill-exporter.d.ts.map +1 -0
  212. package/dist/memory/skill-exporter.js +248 -0
  213. package/dist/memory/skill-exporter.js.map +1 -0
  214. package/dist/memory/system.d.ts +179 -0
  215. package/dist/memory/system.d.ts.map +1 -0
  216. package/dist/memory/system.js +421 -0
  217. package/dist/memory/system.js.map +1 -0
  218. package/dist/memory/team-experience.d.ts +298 -0
  219. package/dist/memory/team-experience.d.ts.map +1 -0
  220. package/dist/memory/team-experience.js +355 -0
  221. package/dist/memory/team-experience.js.map +1 -0
  222. package/dist/runtime/backends/acp-protocol.d.ts +49 -0
  223. package/dist/runtime/backends/acp-protocol.d.ts.map +1 -0
  224. package/dist/runtime/backends/acp-protocol.js +166 -0
  225. package/dist/runtime/backends/acp-protocol.js.map +1 -0
  226. package/dist/runtime/backends/acp.d.ts +67 -0
  227. package/dist/runtime/backends/acp.d.ts.map +1 -0
  228. package/dist/runtime/backends/acp.js +166 -0
  229. package/dist/runtime/backends/acp.js.map +1 -0
  230. package/dist/runtime/backends/index.d.ts +7 -0
  231. package/dist/runtime/backends/index.d.ts.map +1 -0
  232. package/dist/runtime/backends/index.js +8 -0
  233. package/dist/runtime/backends/index.js.map +1 -0
  234. package/dist/runtime/backends/macro-agent.d.ts +104 -0
  235. package/dist/runtime/backends/macro-agent.d.ts.map +1 -0
  236. package/dist/runtime/backends/macro-agent.js +107 -0
  237. package/dist/runtime/backends/macro-agent.js.map +1 -0
  238. package/dist/runtime/backends/mock.d.ts +67 -0
  239. package/dist/runtime/backends/mock.d.ts.map +1 -0
  240. package/dist/runtime/backends/mock.js +153 -0
  241. package/dist/runtime/backends/mock.js.map +1 -0
  242. package/dist/runtime/backends/subprocess.d.ts +56 -0
  243. package/dist/runtime/backends/subprocess.d.ts.map +1 -0
  244. package/dist/runtime/backends/subprocess.js +260 -0
  245. package/dist/runtime/backends/subprocess.js.map +1 -0
  246. package/dist/runtime/compute-provider.d.ts +87 -0
  247. package/dist/runtime/compute-provider.d.ts.map +1 -0
  248. package/dist/runtime/compute-provider.js +87 -0
  249. package/dist/runtime/compute-provider.js.map +1 -0
  250. package/dist/runtime/flows/learning.d.ts +73 -0
  251. package/dist/runtime/flows/learning.d.ts.map +1 -0
  252. package/dist/runtime/flows/learning.js +116 -0
  253. package/dist/runtime/flows/learning.js.map +1 -0
  254. package/dist/runtime/flows/validation.d.ts +122 -0
  255. package/dist/runtime/flows/validation.d.ts.map +1 -0
  256. package/dist/runtime/flows/validation.js +223 -0
  257. package/dist/runtime/flows/validation.js.map +1 -0
  258. package/dist/runtime/index.d.ts +7 -0
  259. package/dist/runtime/index.d.ts.map +1 -0
  260. package/dist/runtime/index.js +10 -0
  261. package/dist/runtime/index.js.map +1 -0
  262. package/dist/runtime/manager.d.ts +149 -0
  263. package/dist/runtime/manager.d.ts.map +1 -0
  264. package/dist/runtime/manager.js +535 -0
  265. package/dist/runtime/manager.js.map +1 -0
  266. package/dist/runtime/types.d.ts +176 -0
  267. package/dist/runtime/types.d.ts.map +1 -0
  268. package/dist/runtime/types.js +2 -0
  269. package/dist/runtime/types.js.map +1 -0
  270. package/dist/search/evaluator.d.ts +109 -0
  271. package/dist/search/evaluator.d.ts.map +1 -0
  272. package/dist/search/evaluator.js +372 -0
  273. package/dist/search/evaluator.js.map +1 -0
  274. package/dist/search/index.d.ts +8 -0
  275. package/dist/search/index.d.ts.map +1 -0
  276. package/dist/search/index.js +13 -0
  277. package/dist/search/index.js.map +1 -0
  278. package/dist/search/refinement-loop.d.ts +90 -0
  279. package/dist/search/refinement-loop.d.ts.map +1 -0
  280. package/dist/search/refinement-loop.js +316 -0
  281. package/dist/search/refinement-loop.js.map +1 -0
  282. package/dist/search/refinement-types.d.ts +154 -0
  283. package/dist/search/refinement-types.d.ts.map +1 -0
  284. package/dist/search/refinement-types.js +99 -0
  285. package/dist/search/refinement-types.js.map +1 -0
  286. package/dist/search/router.d.ts +61 -0
  287. package/dist/search/router.d.ts.map +1 -0
  288. package/dist/search/router.js +197 -0
  289. package/dist/search/router.js.map +1 -0
  290. package/dist/search/solver.d.ts +75 -0
  291. package/dist/search/solver.d.ts.map +1 -0
  292. package/dist/search/solver.js +216 -0
  293. package/dist/search/solver.js.map +1 -0
  294. package/dist/search/team-router.d.ts +91 -0
  295. package/dist/search/team-router.d.ts.map +1 -0
  296. package/dist/search/team-router.js +315 -0
  297. package/dist/search/team-router.js.map +1 -0
  298. package/dist/search/verification-runner.d.ts +125 -0
  299. package/dist/search/verification-runner.d.ts.map +1 -0
  300. package/dist/search/verification-runner.js +440 -0
  301. package/dist/search/verification-runner.js.map +1 -0
  302. package/dist/session-bank/git-reader.d.ts +39 -0
  303. package/dist/session-bank/git-reader.d.ts.map +1 -0
  304. package/dist/session-bank/git-reader.js +165 -0
  305. package/dist/session-bank/git-reader.js.map +1 -0
  306. package/dist/session-bank/index.d.ts +5 -0
  307. package/dist/session-bank/index.d.ts.map +1 -0
  308. package/dist/session-bank/index.js +4 -0
  309. package/dist/session-bank/index.js.map +1 -0
  310. package/dist/session-bank/parser.d.ts +39 -0
  311. package/dist/session-bank/parser.d.ts.map +1 -0
  312. package/dist/session-bank/parser.js +231 -0
  313. package/dist/session-bank/parser.js.map +1 -0
  314. package/dist/session-bank/session-bank.d.ts +35 -0
  315. package/dist/session-bank/session-bank.d.ts.map +1 -0
  316. package/dist/session-bank/session-bank.js +326 -0
  317. package/dist/session-bank/session-bank.js.map +1 -0
  318. package/dist/session-bank/types.d.ts +129 -0
  319. package/dist/session-bank/types.d.ts.map +1 -0
  320. package/dist/session-bank/types.js +7 -0
  321. package/dist/session-bank/types.js.map +1 -0
  322. package/dist/surfacing/index.d.ts +6 -0
  323. package/dist/surfacing/index.d.ts.map +1 -0
  324. package/dist/surfacing/index.js +5 -0
  325. package/dist/surfacing/index.js.map +1 -0
  326. package/dist/surfacing/publisher.d.ts +22 -0
  327. package/dist/surfacing/publisher.d.ts.map +1 -0
  328. package/dist/surfacing/publisher.js +9 -0
  329. package/dist/surfacing/publisher.js.map +1 -0
  330. package/dist/surfacing/skill-library.d.ts +170 -0
  331. package/dist/surfacing/skill-library.d.ts.map +1 -0
  332. package/dist/surfacing/skill-library.js +455 -0
  333. package/dist/surfacing/skill-library.js.map +1 -0
  334. package/dist/surfacing/skill-publisher.d.ts +43 -0
  335. package/dist/surfacing/skill-publisher.d.ts.map +1 -0
  336. package/dist/surfacing/skill-publisher.js +197 -0
  337. package/dist/surfacing/skill-publisher.js.map +1 -0
  338. package/dist/surfacing/sqlite-storage-adapter.d.ts +42 -0
  339. package/dist/surfacing/sqlite-storage-adapter.d.ts.map +1 -0
  340. package/dist/surfacing/sqlite-storage-adapter.js +207 -0
  341. package/dist/surfacing/sqlite-storage-adapter.js.map +1 -0
  342. package/dist/surfacing/team-skill-library.d.ts +180 -0
  343. package/dist/surfacing/team-skill-library.d.ts.map +1 -0
  344. package/dist/surfacing/team-skill-library.js +384 -0
  345. package/dist/surfacing/team-skill-library.js.map +1 -0
  346. package/dist/types/config.d.ts +2287 -0
  347. package/dist/types/config.d.ts.map +1 -0
  348. package/dist/types/config.js +490 -0
  349. package/dist/types/config.js.map +1 -0
  350. package/dist/types/dataclaw.d.ts +286 -0
  351. package/dist/types/dataclaw.d.ts.map +1 -0
  352. package/dist/types/dataclaw.js +84 -0
  353. package/dist/types/dataclaw.js.map +1 -0
  354. package/dist/types/index.d.ts +16 -0
  355. package/dist/types/index.d.ts.map +1 -0
  356. package/dist/types/index.js +26 -0
  357. package/dist/types/index.js.map +1 -0
  358. package/dist/types/knowledge-graph.d.ts +148 -0
  359. package/dist/types/knowledge-graph.d.ts.map +1 -0
  360. package/dist/types/knowledge-graph.js +40 -0
  361. package/dist/types/knowledge-graph.js.map +1 -0
  362. package/dist/types/knowledge.d.ts +280 -0
  363. package/dist/types/knowledge.d.ts.map +1 -0
  364. package/dist/types/knowledge.js +191 -0
  365. package/dist/types/knowledge.js.map +1 -0
  366. package/dist/types/memory.d.ts +339 -0
  367. package/dist/types/memory.d.ts.map +1 -0
  368. package/dist/types/memory.js +207 -0
  369. package/dist/types/memory.js.map +1 -0
  370. package/dist/types/meta.d.ts +146 -0
  371. package/dist/types/meta.d.ts.map +1 -0
  372. package/dist/types/meta.js +51 -0
  373. package/dist/types/meta.js.map +1 -0
  374. package/dist/types/outcome.d.ts +42 -0
  375. package/dist/types/outcome.d.ts.map +1 -0
  376. package/dist/types/outcome.js +50 -0
  377. package/dist/types/outcome.js.map +1 -0
  378. package/dist/types/playbook.d.ts +119 -0
  379. package/dist/types/playbook.d.ts.map +1 -0
  380. package/dist/types/playbook.js +71 -0
  381. package/dist/types/playbook.js.map +1 -0
  382. package/dist/types/step.d.ts +44 -0
  383. package/dist/types/step.d.ts.map +1 -0
  384. package/dist/types/step.js +32 -0
  385. package/dist/types/step.js.map +1 -0
  386. package/dist/types/task.d.ts +91 -0
  387. package/dist/types/task.d.ts.map +1 -0
  388. package/dist/types/task.js +39 -0
  389. package/dist/types/task.js.map +1 -0
  390. package/dist/types/team-meta.d.ts +160 -0
  391. package/dist/types/team-meta.d.ts.map +1 -0
  392. package/dist/types/team-meta.js +42 -0
  393. package/dist/types/team-meta.js.map +1 -0
  394. package/dist/types/team-playbook.d.ts +276 -0
  395. package/dist/types/team-playbook.d.ts.map +1 -0
  396. package/dist/types/team-playbook.js +85 -0
  397. package/dist/types/team-playbook.js.map +1 -0
  398. package/dist/types/team-trajectory.d.ts +305 -0
  399. package/dist/types/team-trajectory.d.ts.map +1 -0
  400. package/dist/types/team-trajectory.js +304 -0
  401. package/dist/types/team-trajectory.js.map +1 -0
  402. package/dist/types/trajectory-source.d.ts +39 -0
  403. package/dist/types/trajectory-source.d.ts.map +1 -0
  404. package/dist/types/trajectory-source.js +2 -0
  405. package/dist/types/trajectory-source.js.map +1 -0
  406. package/dist/types/trajectory.d.ts +221 -0
  407. package/dist/types/trajectory.d.ts.map +1 -0
  408. package/dist/types/trajectory.js +60 -0
  409. package/dist/types/trajectory.js.map +1 -0
  410. package/dist/utils/frontmatter.d.ts +34 -0
  411. package/dist/utils/frontmatter.d.ts.map +1 -0
  412. package/dist/utils/frontmatter.js +93 -0
  413. package/dist/utils/frontmatter.js.map +1 -0
  414. package/dist/utils/index.d.ts +5 -0
  415. package/dist/utils/index.d.ts.map +1 -0
  416. package/dist/utils/index.js +5 -0
  417. package/dist/utils/index.js.map +1 -0
  418. package/dist/utils/similarity.d.ts +31 -0
  419. package/dist/utils/similarity.d.ts.map +1 -0
  420. package/dist/utils/similarity.js +107 -0
  421. package/dist/utils/similarity.js.map +1 -0
  422. package/dist/utils/storage.d.ts +106 -0
  423. package/dist/utils/storage.d.ts.map +1 -0
  424. package/dist/utils/storage.js +203 -0
  425. package/dist/utils/storage.js.map +1 -0
  426. package/dist/utils/validation.d.ts +129 -0
  427. package/dist/utils/validation.d.ts.map +1 -0
  428. package/dist/utils/validation.js +171 -0
  429. package/dist/utils/validation.js.map +1 -0
  430. package/dist/workspace/index.d.ts +6 -0
  431. package/dist/workspace/index.d.ts.map +1 -0
  432. package/dist/workspace/index.js +11 -0
  433. package/dist/workspace/index.js.map +1 -0
  434. package/dist/workspace/runner.d.ts +50 -0
  435. package/dist/workspace/runner.d.ts.map +1 -0
  436. package/dist/workspace/runner.js +219 -0
  437. package/dist/workspace/runner.js.map +1 -0
  438. package/dist/workspace/skill-converter.d.ts +18 -0
  439. package/dist/workspace/skill-converter.d.ts.map +1 -0
  440. package/dist/workspace/skill-converter.js +257 -0
  441. package/dist/workspace/skill-converter.js.map +1 -0
  442. package/dist/workspace/templates/index.d.ts +11 -0
  443. package/dist/workspace/templates/index.d.ts.map +1 -0
  444. package/dist/workspace/templates/index.js +21 -0
  445. package/dist/workspace/templates/index.js.map +1 -0
  446. package/dist/workspace/templates/knowledge-defrag.d.ts +25 -0
  447. package/dist/workspace/templates/knowledge-defrag.d.ts.map +1 -0
  448. package/dist/workspace/templates/knowledge-defrag.js +154 -0
  449. package/dist/workspace/templates/knowledge-defrag.js.map +1 -0
  450. package/dist/workspace/templates/knowledge-extraction.d.ts +25 -0
  451. package/dist/workspace/templates/knowledge-extraction.d.ts.map +1 -0
  452. package/dist/workspace/templates/knowledge-extraction.js +246 -0
  453. package/dist/workspace/templates/knowledge-extraction.js.map +1 -0
  454. package/dist/workspace/templates/meta-reflection.d.ts +47 -0
  455. package/dist/workspace/templates/meta-reflection.d.ts.map +1 -0
  456. package/dist/workspace/templates/meta-reflection.js +135 -0
  457. package/dist/workspace/templates/meta-reflection.js.map +1 -0
  458. package/dist/workspace/templates/playbook-extraction.d.ts +20 -0
  459. package/dist/workspace/templates/playbook-extraction.d.ts.map +1 -0
  460. package/dist/workspace/templates/playbook-extraction.js +189 -0
  461. package/dist/workspace/templates/playbook-extraction.js.map +1 -0
  462. package/dist/workspace/templates/refinement-analysis.d.ts +31 -0
  463. package/dist/workspace/templates/refinement-analysis.d.ts.map +1 -0
  464. package/dist/workspace/templates/refinement-analysis.js +107 -0
  465. package/dist/workspace/templates/refinement-analysis.js.map +1 -0
  466. package/dist/workspace/templates/solution-evaluation.d.ts +21 -0
  467. package/dist/workspace/templates/solution-evaluation.d.ts.map +1 -0
  468. package/dist/workspace/templates/solution-evaluation.js +131 -0
  469. package/dist/workspace/templates/solution-evaluation.js.map +1 -0
  470. package/dist/workspace/templates/team-playbook-extraction.d.ts +44 -0
  471. package/dist/workspace/templates/team-playbook-extraction.d.ts.map +1 -0
  472. package/dist/workspace/templates/team-playbook-extraction.js +497 -0
  473. package/dist/workspace/templates/team-playbook-extraction.js.map +1 -0
  474. package/dist/workspace/templates/team-trajectory-analysis.d.ts +19 -0
  475. package/dist/workspace/templates/team-trajectory-analysis.d.ts.map +1 -0
  476. package/dist/workspace/templates/team-trajectory-analysis.js +442 -0
  477. package/dist/workspace/templates/team-trajectory-analysis.js.map +1 -0
  478. package/dist/workspace/templates/trajectory-analysis.d.ts +19 -0
  479. package/dist/workspace/templates/trajectory-analysis.d.ts.map +1 -0
  480. package/dist/workspace/templates/trajectory-analysis.js +170 -0
  481. package/dist/workspace/templates/trajectory-analysis.js.map +1 -0
  482. package/dist/workspace/templates/usage-inference.d.ts +19 -0
  483. package/dist/workspace/templates/usage-inference.d.ts.map +1 -0
  484. package/dist/workspace/templates/usage-inference.js +125 -0
  485. package/dist/workspace/templates/usage-inference.js.map +1 -0
  486. package/dist/workspace/types.d.ts +145 -0
  487. package/dist/workspace/types.d.ts.map +1 -0
  488. package/dist/workspace/types.js +17 -0
  489. package/dist/workspace/types.js.map +1 -0
  490. package/docs/DESIGN-agentic-workspace.md +2057 -0
  491. package/docs/DESIGN-semantic-memory-knowledge-bank.md +1789 -0
  492. package/docs/DESIGN-session-bank.md +1134 -0
  493. package/docs/DESIGN-team-extraction-pipeline.md +1369 -0
  494. package/docs/DESIGN-workspace-migration.md +1079 -0
  495. package/docs/PLAN-agentic-workspace-implementation.md +717 -0
  496. package/docs/PLAN-graph-migration.md +299 -0
  497. package/docs/PLAN-session-bank-implementation.md +474 -0
  498. package/docs/PROPOSAL-team-aware-learning.md +1080 -0
  499. package/docs/RESEARCH-semantic-memory-knowledge-structures.md +517 -0
  500. package/docs/RESEARCH-team-trajectory-learning.md +553 -0
  501. package/gaps.md +204 -0
  502. package/package.json +67 -33
  503. package/references/agent-workspace/CLAUDE.md +74 -0
  504. package/references/agent-workspace/README.md +587 -0
  505. package/references/agent-workspace/media/banner.png +0 -0
  506. package/references/agent-workspace/package-lock.json +2061 -0
  507. package/references/agent-workspace/package.json +54 -0
  508. package/references/agent-workspace/src/handle.ts +122 -0
  509. package/references/agent-workspace/src/index.ts +32 -0
  510. package/references/agent-workspace/src/manager.ts +102 -0
  511. package/references/agent-workspace/src/readers/json.ts +71 -0
  512. package/references/agent-workspace/src/readers/markdown.ts +37 -0
  513. package/references/agent-workspace/src/readers/raw.ts +27 -0
  514. package/references/agent-workspace/src/types.ts +68 -0
  515. package/references/agent-workspace/src/validation.ts +93 -0
  516. package/references/agent-workspace/src/writers/json.ts +17 -0
  517. package/references/agent-workspace/src/writers/markdown.ts +27 -0
  518. package/references/agent-workspace/src/writers/raw.ts +22 -0
  519. package/references/agent-workspace/tests/errors.test.ts +652 -0
  520. package/references/agent-workspace/tests/handle.test.ts +144 -0
  521. package/references/agent-workspace/tests/manager.test.ts +124 -0
  522. package/references/agent-workspace/tests/readers.test.ts +205 -0
  523. package/references/agent-workspace/tests/validation.test.ts +196 -0
  524. package/references/agent-workspace/tests/writers.test.ts +108 -0
  525. package/references/agent-workspace/tsconfig.json +20 -0
  526. package/references/agent-workspace/tsup.config.ts +9 -0
  527. package/references/minimem/.claude/settings.json +7 -0
  528. package/references/minimem/.sudocode/issues.jsonl +18 -0
  529. package/references/minimem/.sudocode/specs.jsonl +1 -0
  530. package/references/minimem/CLAUDE.md +310 -0
  531. package/references/minimem/README.md +556 -0
  532. package/references/minimem/claude-plugin/.claude-plugin/plugin.json +10 -0
  533. package/references/minimem/claude-plugin/.mcp.json +7 -0
  534. package/references/minimem/claude-plugin/README.md +158 -0
  535. package/references/minimem/claude-plugin/commands/recall.md +47 -0
  536. package/references/minimem/claude-plugin/commands/remember.md +41 -0
  537. package/references/minimem/claude-plugin/hooks/__tests__/hooks.test.ts +272 -0
  538. package/references/minimem/claude-plugin/hooks/hooks.json +27 -0
  539. package/references/minimem/claude-plugin/hooks/session-end.sh +86 -0
  540. package/references/minimem/claude-plugin/hooks/session-start.sh +85 -0
  541. package/references/minimem/claude-plugin/skills/memory/SKILL.md +108 -0
  542. package/references/minimem/package-lock.json +5373 -0
  543. package/references/minimem/package.json +60 -0
  544. package/references/minimem/scripts/postbuild.js +35 -0
  545. package/references/minimem/src/__tests__/edge-cases.test.ts +371 -0
  546. package/references/minimem/src/__tests__/errors.test.ts +265 -0
  547. package/references/minimem/src/__tests__/helpers.ts +199 -0
  548. package/references/minimem/src/__tests__/internal.test.ts +407 -0
  549. package/references/minimem/src/__tests__/knowledge.test.ts +287 -0
  550. package/references/minimem/src/__tests__/minimem.integration.test.ts +1127 -0
  551. package/references/minimem/src/__tests__/session.test.ts +190 -0
  552. package/references/minimem/src/cli/__tests__/commands.test.ts +759 -0
  553. package/references/minimem/src/cli/commands/__tests__/conflicts.test.ts +141 -0
  554. package/references/minimem/src/cli/commands/append.ts +76 -0
  555. package/references/minimem/src/cli/commands/config.ts +262 -0
  556. package/references/minimem/src/cli/commands/conflicts.ts +413 -0
  557. package/references/minimem/src/cli/commands/daemon.ts +169 -0
  558. package/references/minimem/src/cli/commands/index.ts +12 -0
  559. package/references/minimem/src/cli/commands/init.ts +88 -0
  560. package/references/minimem/src/cli/commands/mcp.ts +177 -0
  561. package/references/minimem/src/cli/commands/push-pull.ts +213 -0
  562. package/references/minimem/src/cli/commands/search.ts +158 -0
  563. package/references/minimem/src/cli/commands/status.ts +84 -0
  564. package/references/minimem/src/cli/commands/sync-init.ts +290 -0
  565. package/references/minimem/src/cli/commands/sync.ts +70 -0
  566. package/references/minimem/src/cli/commands/upsert.ts +197 -0
  567. package/references/minimem/src/cli/config.ts +584 -0
  568. package/references/minimem/src/cli/index.ts +264 -0
  569. package/references/minimem/src/cli/shared.ts +161 -0
  570. package/references/minimem/src/cli/sync/__tests__/central.test.ts +152 -0
  571. package/references/minimem/src/cli/sync/__tests__/conflicts.test.ts +209 -0
  572. package/references/minimem/src/cli/sync/__tests__/daemon.test.ts +118 -0
  573. package/references/minimem/src/cli/sync/__tests__/detection.test.ts +207 -0
  574. package/references/minimem/src/cli/sync/__tests__/integration.test.ts +476 -0
  575. package/references/minimem/src/cli/sync/__tests__/registry.test.ts +363 -0
  576. package/references/minimem/src/cli/sync/__tests__/state.test.ts +255 -0
  577. package/references/minimem/src/cli/sync/__tests__/validation.test.ts +193 -0
  578. package/references/minimem/src/cli/sync/__tests__/watcher.test.ts +178 -0
  579. package/references/minimem/src/cli/sync/central.ts +292 -0
  580. package/references/minimem/src/cli/sync/conflicts.ts +204 -0
  581. package/references/minimem/src/cli/sync/daemon.ts +407 -0
  582. package/references/minimem/src/cli/sync/detection.ts +138 -0
  583. package/references/minimem/src/cli/sync/index.ts +107 -0
  584. package/references/minimem/src/cli/sync/operations.ts +373 -0
  585. package/references/minimem/src/cli/sync/registry.ts +279 -0
  586. package/references/minimem/src/cli/sync/state.ts +355 -0
  587. package/references/minimem/src/cli/sync/validation.ts +206 -0
  588. package/references/minimem/src/cli/sync/watcher.ts +234 -0
  589. package/references/minimem/src/cli/version.ts +34 -0
  590. package/references/minimem/src/core/index.ts +9 -0
  591. package/references/minimem/src/core/indexer.ts +628 -0
  592. package/references/minimem/src/core/searcher.ts +221 -0
  593. package/references/minimem/src/db/schema.ts +183 -0
  594. package/references/minimem/src/db/sqlite-vec.ts +24 -0
  595. package/references/minimem/src/embeddings/__tests__/embeddings.test.ts +431 -0
  596. package/references/minimem/src/embeddings/batch-gemini.ts +392 -0
  597. package/references/minimem/src/embeddings/batch-openai.ts +409 -0
  598. package/references/minimem/src/embeddings/embeddings.ts +434 -0
  599. package/references/minimem/src/index.ts +109 -0
  600. package/references/minimem/src/internal.ts +299 -0
  601. package/references/minimem/src/minimem.ts +1276 -0
  602. package/references/minimem/src/search/__tests__/hybrid.test.ts +247 -0
  603. package/references/minimem/src/search/graph.ts +234 -0
  604. package/references/minimem/src/search/hybrid.ts +151 -0
  605. package/references/minimem/src/search/search.ts +256 -0
  606. package/references/minimem/src/server/__tests__/mcp.test.ts +341 -0
  607. package/references/minimem/src/server/__tests__/tools.test.ts +364 -0
  608. package/references/minimem/src/server/mcp.ts +326 -0
  609. package/references/minimem/src/server/tools.ts +720 -0
  610. package/references/minimem/src/session.ts +460 -0
  611. package/references/minimem/tsconfig.json +19 -0
  612. package/references/minimem/tsup.config.ts +26 -0
  613. package/references/minimem/vitest.config.ts +24 -0
  614. package/references/skill-tree/.claude/settings.json +6 -0
  615. package/references/skill-tree/.sudocode/issues.jsonl +11 -0
  616. package/references/skill-tree/.sudocode/specs.jsonl +1 -0
  617. package/references/skill-tree/CLAUDE.md +150 -0
  618. package/references/skill-tree/README.md +324 -0
  619. package/references/skill-tree/docs/GAPS_v1.md +221 -0
  620. package/references/skill-tree/docs/INTEGRATION_PLAN.md +467 -0
  621. package/references/skill-tree/docs/TODOS.md +91 -0
  622. package/references/skill-tree/docs/anthropic_skill_guide.md +1364 -0
  623. package/references/skill-tree/docs/design/federated-skill-trees.md +524 -0
  624. package/references/skill-tree/docs/design/multi-agent-sync.md +759 -0
  625. package/references/skill-tree/docs/scraper/BRAINSTORM.md +583 -0
  626. package/references/skill-tree/docs/scraper/POC_PLAN.md +420 -0
  627. package/references/skill-tree/docs/scraper/README.md +170 -0
  628. package/references/skill-tree/examples/basic-usage.ts +190 -0
  629. package/references/skill-tree/package-lock.json +1509 -0
  630. package/references/skill-tree/package.json +66 -0
  631. package/references/skill-tree/scraper/README.md +123 -0
  632. package/references/skill-tree/scraper/docs/DESIGN.md +683 -0
  633. package/references/skill-tree/scraper/docs/PLAN.md +336 -0
  634. package/references/skill-tree/scraper/drizzle.config.ts +10 -0
  635. package/references/skill-tree/scraper/package-lock.json +6329 -0
  636. package/references/skill-tree/scraper/package.json +68 -0
  637. package/references/skill-tree/scraper/test/fixtures/invalid-skill/missing-description.md +7 -0
  638. package/references/skill-tree/scraper/test/fixtures/invalid-skill/missing-name.md +7 -0
  639. package/references/skill-tree/scraper/test/fixtures/minimal-skill/SKILL.md +27 -0
  640. package/references/skill-tree/scraper/test/fixtures/skill-json/SKILL.json +21 -0
  641. package/references/skill-tree/scraper/test/fixtures/skill-with-meta/SKILL.md +54 -0
  642. package/references/skill-tree/scraper/test/fixtures/skill-with-meta/_meta.json +24 -0
  643. package/references/skill-tree/scraper/test/fixtures/valid-skill/SKILL.md +93 -0
  644. package/references/skill-tree/scraper/test/fixtures/valid-skill/_meta.json +22 -0
  645. package/references/skill-tree/scraper/tsup.config.ts +14 -0
  646. package/references/skill-tree/scraper/vitest.config.ts +17 -0
  647. package/references/skill-tree/scripts/convert-to-vitest.ts +166 -0
  648. package/references/skill-tree/skills/skill-writer/SKILL.md +339 -0
  649. package/references/skill-tree/skills/skill-writer/references/examples.md +326 -0
  650. package/references/skill-tree/skills/skill-writer/references/patterns.md +210 -0
  651. package/references/skill-tree/skills/skill-writer/references/quality-checklist.md +123 -0
  652. package/references/skill-tree/test/run-all.ts +106 -0
  653. package/references/skill-tree/test/utils.ts +128 -0
  654. package/references/skill-tree/vitest.config.ts +16 -0
  655. package/scripts/migrate-to-playbooks.ts +307 -0
  656. package/src/agents/index.ts +14 -0
  657. package/src/agents/mock-provider.ts +93 -0
  658. package/src/agents/types.ts +137 -0
  659. package/src/atlas.ts +1072 -0
  660. package/src/bin/cognitive-core.ts +470 -0
  661. package/src/embeddings/bm25.ts +337 -0
  662. package/src/embeddings/index.ts +39 -0
  663. package/src/embeddings/manager.ts +288 -0
  664. package/src/embeddings/provider.ts +318 -0
  665. package/src/embeddings/vector-store.ts +353 -0
  666. package/src/factory.ts +263 -0
  667. package/src/index.ts +368 -0
  668. package/src/learning/analyzer.ts +335 -0
  669. package/src/learning/effectiveness.ts +428 -0
  670. package/src/learning/index.ts +93 -0
  671. package/src/learning/knowledge-extractor.ts +470 -0
  672. package/src/learning/meta-learner.ts +570 -0
  673. package/src/learning/pipeline.ts +323 -0
  674. package/src/learning/playbook-extractor.ts +702 -0
  675. package/src/learning/team-ingester.ts +499 -0
  676. package/src/learning/team-meta-learner.ts +558 -0
  677. package/src/learning/team-pipeline.ts +364 -0
  678. package/src/learning/trajectory-sources/dataclaw.ts +403 -0
  679. package/src/learning/trajectory-sources/entire.ts +240 -0
  680. package/src/learning/trajectory-sources/file.ts +136 -0
  681. package/src/learning/trajectory-sources/huggingface.ts +248 -0
  682. package/src/learning/trajectory-sources/in-memory.ts +61 -0
  683. package/src/learning/trajectory-sources/index.ts +15 -0
  684. package/src/learning/trajectory-sources/pipeline.ts +69 -0
  685. package/src/learning/usage-inference.ts +372 -0
  686. package/src/mcp/index.ts +12 -0
  687. package/src/mcp/playbook-server.ts +565 -0
  688. package/src/memory/curated-loader.ts +160 -0
  689. package/src/memory/experience.ts +515 -0
  690. package/src/memory/graph-layers/base.ts +184 -0
  691. package/src/memory/graph-layers/causal.ts +16 -0
  692. package/src/memory/graph-layers/entity.ts +16 -0
  693. package/src/memory/graph-layers/index.ts +5 -0
  694. package/src/memory/graph-layers/semantic.ts +16 -0
  695. package/src/memory/graph-layers/temporal.ts +16 -0
  696. package/src/memory/index.ts +72 -0
  697. package/src/memory/knowledge-bank.ts +1260 -0
  698. package/src/memory/knowledge-defrag.ts +329 -0
  699. package/src/memory/knowledge-graph.ts +361 -0
  700. package/src/memory/meta.ts +506 -0
  701. package/src/memory/playbook.ts +493 -0
  702. package/src/memory/search-provider.ts +35 -0
  703. package/src/memory/search-providers/index.ts +3 -0
  704. package/src/memory/search-providers/minimem.ts +84 -0
  705. package/src/memory/search-providers/text-similarity.ts +35 -0
  706. package/src/memory/skill-exporter.ts +357 -0
  707. package/src/memory/system.ts +604 -0
  708. package/src/memory/team-experience.ts +604 -0
  709. package/src/runtime/backends/acp-protocol.ts +231 -0
  710. package/src/runtime/backends/acp.ts +239 -0
  711. package/src/runtime/backends/index.ts +38 -0
  712. package/src/runtime/backends/macro-agent.ts +177 -0
  713. package/src/runtime/backends/mock.ts +218 -0
  714. package/src/runtime/backends/subprocess.ts +356 -0
  715. package/src/runtime/compute-provider.ts +206 -0
  716. package/src/runtime/flows/learning.ts +183 -0
  717. package/src/runtime/flows/validation.ts +381 -0
  718. package/src/runtime/index.ts +75 -0
  719. package/src/runtime/manager.ts +685 -0
  720. package/src/runtime/types.ts +198 -0
  721. package/src/search/evaluator.ts +499 -0
  722. package/src/search/index.ts +68 -0
  723. package/src/search/refinement-loop.ts +457 -0
  724. package/src/search/refinement-types.ts +159 -0
  725. package/src/search/router.ts +261 -0
  726. package/src/search/solver.ts +303 -0
  727. package/src/search/team-router.ts +459 -0
  728. package/src/search/verification-runner.ts +570 -0
  729. package/src/session-bank/git-reader.ts +190 -0
  730. package/src/session-bank/index.ts +24 -0
  731. package/src/session-bank/parser.ts +366 -0
  732. package/src/session-bank/session-bank.ts +464 -0
  733. package/src/session-bank/types.ts +173 -0
  734. package/src/surfacing/index.ts +29 -0
  735. package/src/surfacing/publisher.ts +23 -0
  736. package/src/surfacing/skill-library.ts +625 -0
  737. package/src/surfacing/skill-publisher.ts +223 -0
  738. package/src/surfacing/sqlite-storage-adapter.ts +301 -0
  739. package/src/surfacing/team-skill-library.ts +610 -0
  740. package/src/types/config.ts +585 -0
  741. package/src/types/dataclaw.ts +99 -0
  742. package/src/types/huggingface-transformers.d.ts +12 -0
  743. package/src/types/index.ts +286 -0
  744. package/src/types/knowledge-graph.ts +246 -0
  745. package/src/types/knowledge.ts +388 -0
  746. package/src/types/memory.ts +270 -0
  747. package/src/types/meta.ts +218 -0
  748. package/src/types/outcome.ts +66 -0
  749. package/src/types/playbook.ts +196 -0
  750. package/src/types/step.ts +40 -0
  751. package/src/types/task.ts +52 -0
  752. package/src/types/team-meta.ts +212 -0
  753. package/src/types/team-playbook.ts +384 -0
  754. package/src/types/team-trajectory.ts +673 -0
  755. package/src/types/trajectory-source.ts +47 -0
  756. package/src/types/trajectory.ts +80 -0
  757. package/src/utils/frontmatter.ts +118 -0
  758. package/src/utils/index.ts +45 -0
  759. package/src/utils/similarity.ts +139 -0
  760. package/src/utils/storage.ts +249 -0
  761. package/src/utils/validation.ts +286 -0
  762. package/src/workspace/index.ts +48 -0
  763. package/src/workspace/runner.ts +281 -0
  764. package/src/workspace/skill-converter.ts +288 -0
  765. package/src/workspace/templates/index.ts +64 -0
  766. package/src/workspace/templates/knowledge-defrag.ts +223 -0
  767. package/src/workspace/templates/knowledge-extraction.ts +337 -0
  768. package/src/workspace/templates/meta-reflection.ts +208 -0
  769. package/src/workspace/templates/playbook-extraction.ts +240 -0
  770. package/src/workspace/templates/refinement-analysis.ts +162 -0
  771. package/src/workspace/templates/solution-evaluation.ts +199 -0
  772. package/src/workspace/templates/team-playbook-extraction.ts +631 -0
  773. package/src/workspace/templates/team-trajectory-analysis.ts +564 -0
  774. package/src/workspace/templates/trajectory-analysis.ts +234 -0
  775. package/src/workspace/templates/usage-inference.ts +163 -0
  776. package/src/workspace/types.ts +233 -0
  777. package/tests/atlas-knowledge.test.ts +165 -0
  778. package/tests/embeddings/bm25.test.ts +130 -0
  779. package/tests/embeddings/manager.test.ts +205 -0
  780. package/tests/gap-fixes.test.ts +1103 -0
  781. package/tests/integration/atlas.test.ts +266 -0
  782. package/tests/integration/dataclaw-e2e.test.ts +559 -0
  783. package/tests/integration/e2e.test.ts +1336 -0
  784. package/tests/integration/entire-e2e.test.ts +187 -0
  785. package/tests/integration/huggingface-e2e.test.ts +627 -0
  786. package/tests/integration/session-bank.test.ts +225 -0
  787. package/tests/integration/skill-tree-wiring.test.ts +152 -0
  788. package/tests/learning/analyzer.test.ts +426 -0
  789. package/tests/learning/dataclaw-trajectory-source.test.ts +642 -0
  790. package/tests/learning/effectiveness.test.ts +542 -0
  791. package/tests/learning/entire-trajectory-source.test.ts +380 -0
  792. package/tests/learning/huggingface-trajectory-source.test.ts +817 -0
  793. package/tests/learning/knowledge-extractor.test.ts +491 -0
  794. package/tests/learning/pipeline.test.ts +176 -0
  795. package/tests/learning/playbook-extractor-provenance.test.ts +114 -0
  796. package/tests/learning/team-ingester.test.ts +349 -0
  797. package/tests/learning/team-meta-learner.test.ts +618 -0
  798. package/tests/learning/team-pipeline.test.ts +334 -0
  799. package/tests/learning/trajectory-sources.test.ts +312 -0
  800. package/tests/learning/usage-inference.test.ts +254 -0
  801. package/tests/mcp/playbook-server.test.ts +252 -0
  802. package/tests/memory/experience.test.ts +198 -0
  803. package/tests/memory/graph-layers/semantic.test.ts +219 -0
  804. package/tests/memory/knowledge-bank-extraction.test.ts +558 -0
  805. package/tests/memory/knowledge-bank.test.ts +705 -0
  806. package/tests/memory/knowledge-defrag.test.ts +366 -0
  807. package/tests/memory/knowledge-evolution.test.ts +563 -0
  808. package/tests/memory/knowledge-graph.test.ts +492 -0
  809. package/tests/memory/knowledge-inbox.test.ts +258 -0
  810. package/tests/memory/knowledge-minimem.test.ts +251 -0
  811. package/tests/memory/playbook.test.ts +338 -0
  812. package/tests/memory/provenance.test.ts +639 -0
  813. package/tests/memory/skill-exporter.test.ts +470 -0
  814. package/tests/memory/system.test.ts +325 -0
  815. package/tests/memory/team-experience.test.ts +411 -0
  816. package/tests/runtime/agent-manager.test.ts +512 -0
  817. package/tests/runtime/compute-provider.test.ts +288 -0
  818. package/tests/runtime/delegate.test.ts +349 -0
  819. package/tests/runtime/macro-agent-backend.test.ts +266 -0
  820. package/tests/runtime/mock-backend.test.ts +248 -0
  821. package/tests/search/refinement-loop.test.ts +468 -0
  822. package/tests/search/refinement.test.ts +267 -0
  823. package/tests/search/router.test.ts +427 -0
  824. package/tests/search/team-router.test.ts +376 -0
  825. package/tests/session-bank/fixtures/multi-tool-session/full.jsonl +12 -0
  826. package/tests/session-bank/fixtures/multi-tool-session/metadata.json +28 -0
  827. package/tests/session-bank/fixtures/root-metadata.json +18 -0
  828. package/tests/session-bank/fixtures/simple-session/full.jsonl +6 -0
  829. package/tests/session-bank/fixtures/simple-session/metadata.json +38 -0
  830. package/tests/session-bank/git-reader.test.ts +232 -0
  831. package/tests/session-bank/parser.test.ts +321 -0
  832. package/tests/session-bank/session-bank.test.ts +546 -0
  833. package/tests/surfacing/skill-library.test.ts +292 -0
  834. package/tests/surfacing/skill-publisher.test.ts +398 -0
  835. package/tests/surfacing/sqlite-storage-adapter.test.ts +218 -0
  836. package/tests/surfacing/team-skill-library.test.ts +444 -0
  837. package/tests/types/outcome.test.ts +147 -0
  838. package/tests/types/step.test.ts +133 -0
  839. package/tests/types/task.test.ts +158 -0
  840. package/tests/types/team-meta.test.ts +147 -0
  841. package/tests/types/team-playbook.test.ts +246 -0
  842. package/tests/types/team-trajectory.test.ts +557 -0
  843. package/tests/types/trajectory.test.ts +253 -0
  844. package/tests/utils/frontmatter.test.ts +208 -0
  845. package/tests/utils/similarity.test.ts +188 -0
  846. package/tests/utils/validation.test.ts +252 -0
  847. package/tests/workspace/full-flow.test.ts +839 -0
  848. package/tests/workspace/manager.test.ts +215 -0
  849. package/tests/workspace/runner.test.ts +330 -0
  850. package/tests/workspace/skill-converter.test.ts +205 -0
  851. package/tests/workspace/templates/knowledge-extraction.test.ts +235 -0
  852. package/tests/workspace/templates/team-playbook-extraction.test.ts +341 -0
  853. package/tests/workspace/templates/team-trajectory-analysis.test.ts +417 -0
  854. package/tsconfig.json +25 -0
  855. package/vitest.config.ts +22 -0
  856. package/dist/index.d.mts +0 -466
  857. package/dist/index.mjs +0 -478
@@ -0,0 +1,553 @@
1
+ # Research Synthesis: Learning from Multi-Agent Team Trajectories
2
+
3
+ ## Context
4
+
5
+ This document synthesizes recent research (2025+) relevant to the design of team-aware learning in cognitive-core. The core problem: given a **graph of interconnected agent trajectories** from a multi-agent team execution, how do we extract learning signals when (a) the primary analysis mechanism is LLM-based semantic reasoning, and (b) the data can be extremely large and diverse, especially for long-horizon tasks?
6
+
7
+ The research clusters into five themes, each addressing a piece of this problem.
8
+
9
+ ---
10
+
11
+ ## Theme 1: LLM-Based Credit Assignment Across Agents
12
+
13
+ The central question for team learning is credit assignment: when a team succeeds or fails, which agents and which interactions were responsible? Several recent papers demonstrate that LLMs can perform this decomposition through semantic reasoning, without hand-designed reward functions.
14
+
15
+ ### Key Papers
16
+
17
+ **LLM-MCA / LLM-TACA** (AAMAS 2025)
18
+ - Reformulates multi-agent credit assignment as sequence improvement recognition + attribution
19
+ - A centralized LLM reward-critic numerically decomposes environment reward based on individualized agent contributions
20
+ - LLM-TACA extension performs explicit task assignment by passing intermediary goals to each agent
21
+ - Generates trajectory datasets annotated with per-agent reward at each timestep
22
+ - *Relevance*: This is the closest existing work to what our `TeamTrajectoryAnalyzer` needs to do — take a team trajectory graph, use an LLM to assess each member's contribution and each interaction's value
23
+ - Source: https://arxiv.org/abs/2502.16863
24
+
25
+ **RICOL — Retrospective In-Context Learning for Efficient Credit Assignment** (NeurIPS 2025)
26
+ - Uses in-context learning to evaluate actions in a trajectory, converting sparse rewards into dense advantage signals
27
+ - Achieves equivalent accuracy to Monte Carlo rollouts with ~100x fewer environment samples
28
+ - Key finding: retrospective LLM analysis is sample-efficient enough to be practical at scale
29
+ - *Relevance*: Validates that post-hoc LLM-based credit assignment is practical. For our system, this means we can analyze team trajectories after execution rather than requiring online instrumentation
30
+ - Source: https://arxiv.org/abs/2502.19607
31
+
32
+ **Speaking the Language of Teamwork** (Feb 2025)
33
+ - LLM generates dense, agent-specific rewards based on natural language task descriptions and team goals
34
+ - Learns a potential-based reward function over multiple queries, reducing impact of ranking errors
35
+ - Evaluates each agent's contribution to overall task completion using natural language reasoning
36
+ - *Relevance*: The natural-language reward generation aligns with our LLM-based semantic analysis approach — credit is expressed and reasoned about in language, not computed from numeric features
37
+ - Source: https://arxiv.org/abs/2502.03723
38
+
39
+ **CollabUIAgents — Credit Re-Assignment for Multi-Agent Teams** (Feb 2025)
40
+ - Multi-agent RL framework with LLM-based process rewards rather than environment-specific rewards
41
+ - 7B-parameter system achieves results on par with or exceeding strong closed-source models
42
+ - Cross-environment generalizability — learned credit signals transfer across task domains
43
+ - *Relevance*: Suggests that coordination patterns learned from one domain (e.g., web development) can transfer to another (e.g., data pipeline), which is important for team playbook generalization
44
+ - Source: https://arxiv.org/abs/2502.14496
45
+
46
+ **MAGRPO — Multi-Agent Group Relative Policy Optimization** (NeurIPS 2025 Workshop)
47
+ - Models LLM collaboration as a Dec-POMDP (Decentralized Partially Observable MDP)
48
+ - Proposes centralized group-relative advantages for joint optimization with decentralized execution
49
+ - Agents roll out trajectories in groups; relative advantages computed by comparing final rewards within each group
50
+ - *Relevance*: The Dec-POMDP formalization provides theoretical grounding for our team trajectory graph — each agent has partial observability of the team state, and the interaction edges are the communication channel
51
+ - Source: https://arxiv.org/abs/2508.04652
52
+
53
+ ### Synthesis: What This Means for Our Design
54
+
55
+ The literature converges on a clear pattern: **LLMs can serve as the credit assignment function for multi-agent teams, reasoning about contributions in natural language**. This eliminates the need for hand-designed reward functions or environment-specific metrics. The key architectural implication:
56
+
57
+ ```
58
+ TeamTrajectoryAnalyzer does NOT compute credit from metrics alone.
59
+ Instead:
60
+ 1. Structural metrics (latency, message counts, bottlenecks) provide CONTEXT
61
+ 2. An LLM reasons about credit using the metrics + trajectory content
62
+ 3. The LLM produces per-agent and per-interaction attribution scores
63
+ with natural language explanations
64
+ ```
65
+
66
+ The RICOL result (100x sample efficiency of retrospective LLM analysis vs. Monte Carlo) validates that this is practical even for large trajectory datasets.
67
+
68
+ ---
69
+
70
+ ## Theme 2: Trajectory Compression for Scale
71
+
72
+ Long-horizon multi-agent tasks can produce enormous trajectory data. An agent solving a complex task might generate hundreds of steps; a team of 5 agents produces 5x that, plus interaction overhead. LLM-based semantic analysis cannot process all of this raw data. Two complementary strategies emerge from the literature.
73
+
74
+ ### Strategy A: Learned Compression Before Analysis
75
+
76
+ **ACON — Optimizing Context Compression for Long-Horizon Agents** (Oct 2025)
77
+ - Unified framework compressing both environment observations and interaction histories
78
+ - Uses a *compression guideline optimization* pipeline: given paired trajectories where full context succeeds but compressed context fails, a capable LLM analyzes the failure cause and updates compression guidelines in natural language
79
+ - Gradient-free — works with closed-source models
80
+ - Reduces peak tokens by 26-54% while preserving 95%+ accuracy
81
+ - The optimized compressor can be distilled into smaller models
82
+ - *Relevance*: The learned compression guidelines could be specialized for team trajectories — learning what information to preserve at interaction boundaries vs. within individual agent reasoning chains
83
+ - Source: https://arxiv.org/abs/2510.00615
84
+
85
+ **AgentFold — Proactive Context Management** (Oct 2025)
86
+ - Treats context as a "dynamic cognitive workspace" rather than a passive log
87
+ - At each step, agent executes a learned "folding" operation at multiple scales:
88
+ - Granular condensations preserving fine-grained details
89
+ - Deep consolidations abstracting entire multi-step sub-tasks
90
+ - Implements a "perceive-reason-fold-act" loop where context curation is an explicit, learned step
91
+ - A 30B model with folding outperforms 355B and 671B baselines without it
92
+ - *Relevance*: The multi-scale folding maps well to our hierarchy: individual steps can be granularly condensed, entire sub-tasks deeply abstracted, and interaction boundaries kept at full fidelity
93
+ - Source: https://arxiv.org/abs/2510.24699
94
+
95
+ **Context-Folding via Branch/Return** (Oct 2025)
96
+ - Introduces two special actions: `branch` and `return`
97
+ - Agent branches into a sub-trajectory for a subtask; upon `return`, intermediate steps collapse into a self-chosen summary
98
+ - FoldPO: an RL framework with process rewards for learning when/how to fold
99
+ - With a 32K active token budget and max 10 branches (theoretical 327K tokens), achieves strong results on SWE-Bench Verified
100
+ - Active context is 10x smaller than baselines
101
+ - *Relevance*: The branch/return mechanism directly mirrors how sub-tasks within a team trajectory could be recursively summarized. The RL-trained folding policy learns which parts are critical vs. safely abstractable
102
+ - Source: https://huggingface.co/papers/2510.11967
103
+
104
+ **AgentDiet — Trajectory Reduction** (Sep 2025)
105
+ - Through manual inspection of top-performing agent trajectories, found that *token waste is pervasive*
106
+ - Categorized three typical waste scenarios where tokens can be removed or compressed
107
+ - Achieves comparable performance (-1.0% to +2.0%) with significant step reduction (57.2 to 43.9 average steps)
108
+ - **Key finding: removing low-quality context can actually *improve* performance**
109
+ - *Relevance*: Validates aggressive compression. Much of what agents produce is noise — removing it before team-level analysis is not just acceptable, it's beneficial
110
+ - Source: https://arxiv.org/abs/2509.23586
111
+
112
+ **PAACE — Plan-Aware Automated Agent Context Engineering** (Dec 2025)
113
+ - Introduces next-k-task relevance modeling: compression is aware of upcoming tasks, not just past history
114
+ - Plan-structure analysis determines what to preserve based on the agent's plan
115
+ - Function-preserving compression ensures compressed context retains functional equivalence
116
+ - *Relevance*: For team trajectories, compression should be plan-aware at two levels: each agent's individual plan, and the team's overall coordination plan. Information relevant to cross-agent interactions should be preserved even if it's low-relevance within a single agent's trajectory
117
+ - Source: https://arxiv.org/abs/2512.16970
118
+
119
+ **The Complexity Trap** (Aug 2025)
120
+ - Challenges the assumption that sophisticated semantic compression always beats simpler methods
121
+ - Finds that LLM-based summarization can cause "trajectory elongation" — agents persist on unproductive paths because summaries lose important failure signals
122
+ - Simple observation masking can be equally effective in many cases
123
+ - Summary-generation costs 5-7% of per-instance cost
124
+ - *Relevance*: Cautionary finding. For our compression pipeline, simpler methods (e.g., dropping verbose tool output, truncating repeated patterns) should be tried before LLM-based summarization. Hybrid approach is likely optimal
125
+ - Source: https://arxiv.org/abs/2508.21433
126
+
127
+ ### Strategy B: Identify Critical Steps, Ignore the Rest
128
+
129
+ **Verified Critical Step Optimization (CSO)** (Feb 2026)
130
+ - Identifies verified critical steps where alternative actions demonstrably flip task outcomes
131
+ - **Only 16% of trajectory steps are critical**
132
+ - An 8B model trained on just critical steps matches GPT-4.1 on GAIA and XBench-DeepSearch
133
+ - *Relevance*: We don't need to analyze entire team trajectories — we need to find the ~16% of steps and interactions that actually determined the outcome. This dramatically reduces the scope of expensive LLM analysis
134
+ - Source: https://arxiv.org/abs/2602.03412
135
+
136
+ **AgentPRM — Process Reward Models for Agents** (Nov 2025)
137
+ - Constructs process reward models that evaluate each step based on:
138
+ - **Promise**: proximity to goal (forward-looking)
139
+ - **Progress**: incremental contribution (backward-looking)
140
+ - Captures sequential dependencies between decisions
141
+ - Unlike reasoning PRMs that score correctness, agent PRMs evaluate contribution and progress
142
+ - *Relevance*: Could be applied per-step within each agent's trajectory and per-interaction across the team graph. The promise/progress dual scoring is particularly useful for interaction edges: "did this delegation bring the team closer to the goal?"
143
+ - Source: https://arxiv.org/abs/2511.08325
144
+
145
+ **MT-GRPO — Turn-Level Credit Assignment** (May 2025)
146
+ - Fine-grained turn-level credit assignment for multi-turn agent training
147
+ - Designs turn-level verifiable rewards for both intermediate and final turns
148
+ - Avoids merging signals into a single sparse trajectory-level reward
149
+ - *Relevance*: Validates dense per-step rewards over sparse per-trajectory rewards. Our team analyzer should produce per-interaction credit, not just per-agent credit
150
+ - Source: https://arxiv.org/abs/2505.11821
151
+
152
+ **iStar — Implicit Step Rewards** (Sep 2025)
153
+ - Jointly optimizes an implicit PRM with the policy model via a trajectory-based DPO objective
154
+ - No additional rollouts or explicit step labels needed
155
+ - General credit-assignment strategy integrating with standard RL algorithms
156
+ - *Relevance*: A potential approach for learning per-step rewards without manual annotation — the reward model learns implicitly from trajectory outcome comparisons
157
+ - Source: https://arxiv.org/abs/2509.19199
158
+
159
+ ### Synthesis: What This Means for Our Design
160
+
161
+ The literature strongly supports a **two-phase approach to handling scale**:
162
+
163
+ 1. **Compress first**: Use plan-aware compression (PAACE) or learned folding (AgentFold, Context-Folding) to reduce individual trajectories before team-level analysis. Preserve interaction boundary steps in full while folding internal reasoning. AgentDiet validates that aggressive compression is safe.
164
+
165
+ 2. **Find critical moments**: CSO's finding that only ~16% of steps matter is powerful. Before expensive LLM analysis, identify critical steps (those where outcomes diverge) and critical interactions (those that changed the trajectory of downstream agents). Focus semantic analysis on these.
166
+
167
+ Together, these reduce the data an LLM needs to analyze by roughly 10x (compression) × 5x (critical step filtering) = **~50x reduction** before semantic analysis begins.
168
+
169
+ ```
170
+ Raw team trajectory: ~5 agents × ~100 steps × ~500 tokens/step = 250K tokens
171
+ After per-agent compression (10x): ~25K tokens
172
+ After critical step filtering (~16%): ~4K tokens
173
+ → LLM semantic analysis operates on ~4K tokens, not 250K
174
+ ```
175
+
176
+ ---
177
+
178
+ ## Theme 3: Graph-Based Trajectory Analysis
179
+
180
+ Our team trajectory is a graph of interconnected individual trajectories. Several papers explore graph-based representations of agent execution data.
181
+
182
+ ### Key Papers
183
+
184
+ **From Experience to Strategy: Trainable Graph Memory** (Nov 2025)
185
+ - Abstracts raw trajectories into structured decision paths in a state machine
186
+ - Distills state-machine paths into high-level, human-interpretable "meta-cognitions"
187
+ - Uses RL-based weight optimization to estimate empirical utility of each meta-cognition based on reward feedback
188
+ - Dynamically integrates optimized strategies via meta-cognitive prompting
189
+ - *Relevance*: The state-machine abstraction over trajectories could represent our team interaction graph. Each agent's trajectory becomes a set of states, and interactions between agents become transitions in a team-level state machine. The meta-cognition distillation maps to our team playbook extraction
190
+ - Source: https://arxiv.org/abs/2511.07800
191
+
192
+ **Reasoning LLM Behavior Analysis via Graph Perspective** (May 2025)
193
+ - Traces reasoning processes from a graph perspective
194
+ - Goes beyond the token level to focus on semantic organization: clusters raw reasoning tokens into coherent logic steps and maps their inter-dependencies as a directed graph
195
+ - Enables structural analysis of reasoning quality through graph metrics (connectivity, branching factor, cycle detection)
196
+ - *Relevance*: The methodology — cluster raw steps into semantic units, then analyze the dependency graph — is directly applicable to team trajectory analysis. Individual agent steps cluster into subtasks, and the interaction graph connects subtasks across agents
197
+ - Source: https://arxiv.org/abs/2505.13890
198
+
199
+ **AgentArmor — Structured Graph Abstraction of Execution Traces** (Nov 2025)
200
+ - Abstracts runtime execution traces into Program Dependence Graphs (PDGs) incorporating:
201
+ - Control dependencies (what triggered what)
202
+ - Data dependencies (what data flowed where)
203
+ - Data flow edges (the content that moved between components)
204
+ - Hooks into agent runtime to capture traces, then generates PDGs
205
+ - *Relevance*: The PDG abstraction — capturing both control and data dependencies — maps well to our interaction graph. A delegation is a control dependency; the delegated task content is a data dependency. This dual-edge representation is richer than our current single-edge `AgentInteraction` type
206
+ - Source: https://arxiv.org/abs/2508.01249
207
+
208
+ **Semantic Dynamics Analysis** (Feb 2026)
209
+ - Proposes the *Structural Context Model* for formally analyzing LLM agents from the perspective of context structure
210
+ - Introduces *Semantic Dynamics Analysis* — a method for analyzing functional roles and relative contributions of different context parts
211
+ - Facilitates identification and abstraction of reusable context patterns
212
+ - Up to 32 percentage points improvement in success rate when reusable patterns are applied
213
+ - *Relevance*: The semantic dynamics framework could analyze roles and contributions of different segments within our team trajectory graph — identifying which agent communications, reasoning steps, or actions are most functionally significant
214
+ - Source: https://arxiv.org/abs/2602.08276
215
+
216
+ ### Synthesis: What This Means for Our Design
217
+
218
+ The graph-based analysis literature suggests our interaction graph should capture **two types of edges**, not one:
219
+
220
+ 1. **Control edges**: "Agent A triggered Agent B to do X" (delegations, signals, escalations)
221
+ 2. **Data edges**: "Agent A passed information Y to Agent B" (message content, task descriptions, results)
222
+
223
+ This dual-edge representation enables richer analysis:
224
+ - Control-only edges with no data = empty delegation (agent was told to act but given no useful context)
225
+ - Data-only edges with no control = passive information sharing (useful context was available but didn't trigger action)
226
+ - Both = well-structured coordination
227
+
228
+ The state-machine abstraction from "Experience to Strategy" is particularly compelling: rather than analyzing the raw interaction graph, we could first abstract it into a team-level state machine where states represent coordination phases (planning, parallel execution, integration, verification) and transitions represent phase changes triggered by interactions.
229
+
230
+ ---
231
+
232
+ ## Theme 4: Experience Distillation into Reusable Knowledge
233
+
234
+ Once we've analyzed team trajectories and assigned credit, we need to extract reusable coordination patterns — the team playbooks. Several papers address how to distill raw execution experience into abstract, reusable knowledge.
235
+
236
+ ### Key Papers
237
+
238
+ **EvolveR — Self-Evolving Agents through Experience-Driven Lifecycle** (Oct 2025)
239
+ - Two-stage lifecycle:
240
+ 1. *Offline Self-Distillation*: Trajectories are synthesized into a structured repository of abstract, reusable strategic principles via semantic deduplication, integration, and quality control guided by dynamic metrics
241
+ 2. *Online Interaction*: Agent retrieves distilled principles to guide decision-making
242
+ - Contrasts with agents that discard experiences or retrieve raw un-distilled trajectories
243
+ - Key insight: **raw trajectory retrieval is inferior to distilled principle retrieval** — abstraction improves both retrieval quality and downstream performance
244
+ - *Relevance*: Directly applicable. Our team playbook extraction pipeline should follow the same pattern: distill team trajectory batches into abstract coordination principles, not just store and retrieve raw team trajectories
245
+ - Source: https://arxiv.org/abs/2510.16079
246
+
247
+ **Lessons Learned — Multi-Agent Framework for Learning and Improvement** (IBM, NeurIPS 2025)
248
+ - Agents learn from each other's successes and failures through a "lesson" mechanism
249
+ - Three-phase process: lesson solicitation → banking → selection
250
+ - A "lesson" is knowledge produced by one agent and passed to others — abstract enough to be reusable, concrete enough to be actionable
251
+ - Team of small LLMs with lessons outperforms much larger single LLMs and other multi-LLM collaboration methods
252
+ - *Relevance*: The lesson abstraction level — between raw trajectory data and high-level principles — is a useful intermediate representation. Our system could extract "team lessons" from trajectory analysis before distilling them into playbooks
253
+ - Source: IBM Research
254
+
255
+ **Memento — Fine-tuning Agents without Fine-tuning LLMs** (Aug 2025)
256
+ - Memory-augmented MDP with a neural case-selection policy
257
+ - Stores past trajectories as episodic memory in a growing Case Bank
258
+ - Planner retrieves relevant cases and selects execution plans; results are stored back, creating a feedback loop
259
+ - Achieves 87.88% Pass@3 on GAIA without any gradient updates to the LLM
260
+ - *Relevance*: The Case Bank architecture could store team-level execution patterns. The key insight: you don't need to fine-tune models to learn from experience — retrieval from a well-curated case bank is sufficient
261
+ - Source: https://arxiv.org/abs/2508.16153
262
+
263
+ **ELL — Experience-Driven Lifelong Learning** (Aug 2025)
264
+ - Meta-cognitive learning architecture that explicitly reflects on successes and failures across task trajectories
265
+ - Extracts actionable lessons and integrates them into future behavior via in-context learning or knowledge distillation
266
+ - Introduces a benchmark for lifelong learning evaluation
267
+ - *Relevance*: The meta-cognitive reflection process — explicitly asking "what worked, what didn't, and why" — is the core of our team playbook refinement loop
268
+ - Source: https://arxiv.org/abs/2508.19005
269
+
270
+ **Structured Agent Distillation** (May 2025)
271
+ - Segments trajectories into `{[REASON]}` and `{[ACT]}` spans, applying segment-specific losses
272
+ - Unlike standard token-level distillation, this preserves both reasoning fidelity and action consistency
273
+ - Outperforms token-level and imitation learning baselines
274
+ - *Relevance*: The segment-specific treatment could be extended to team trajectories with three segment types: reasoning spans, action spans, and **coordination spans** (inter-agent communication). Each type may need different distillation/extraction logic
275
+ - Source: https://arxiv.org/abs/2505.13820
276
+
277
+ ### Synthesis: What This Means for Our Design
278
+
279
+ The distillation literature suggests a **three-level knowledge hierarchy**:
280
+
281
+ ```
282
+ Level 1: Raw team trajectory graph
283
+ ↓ (compression + critical step identification)
284
+ Level 2: Team lessons — concrete, contextualized insights
285
+ e.g., "In this web auth task, delegating OAuth implementation to a
286
+ specialist while the planner handled routing reduced total time by 40%"
287
+ ↓ (abstraction + deduplication across multiple team executions)
288
+ Level 3: Team playbooks — abstract, reusable coordination patterns
289
+ e.g., "For tasks requiring specialist knowledge, delegate to a
290
+ domain-expert executor rather than having the planner attempt it directly.
291
+ Correlated with 35% efficiency improvement across 8 team executions."
292
+ ```
293
+
294
+ EvolveR's key finding — that distilled principles outperform raw trajectory retrieval — argues strongly for investing in the Level 2 → Level 3 abstraction step rather than just storing and retrieving raw team experiences. The Lessons Learned framework from IBM provides a concrete mechanism for the Level 1 → Level 2 step: structured solicitation of lessons from each team member's perspective, then banking them for cross-team reuse.
295
+
296
+ ---
297
+
298
+ ## Theme 5: Hierarchical Summarization for Long-Horizon Tasks
299
+
300
+ Long-horizon team tasks require multi-level summarization — individual steps within a sub-task, sub-tasks within an agent's trajectory, agent trajectories within the team execution.
301
+
302
+ ### Key Papers
303
+
304
+ **HiAgent — Hierarchical Working Memory Management** (ACL 2025)
305
+ - Uses subgoals as memory chunks to manage working memory hierarchically
306
+ - Agents formulate subgoals before actions and proactively replace previous subgoals with summarized observations
307
+ - Only retains action-observation pairs relevant to the current subgoal
308
+ - Achieves 2x success rate increase and 3.8 fewer average steps
309
+ - *Relevance*: The subgoal-based hierarchical chunking provides a natural summarization boundary for team trajectories. Each agent's subgoal hierarchy forms a tree; the team trajectory is a forest of these trees connected by interaction edges
310
+ - Source: https://aclanthology.org/2025.acl-long.1575/
311
+
312
+ **Focus — Active Context Compression** (Jan 2026)
313
+ - Agent actively prunes its own history during a single task
314
+ - Preserves learnings in a structured "knowledge block"
315
+ - Creates a "sawtooth" context pattern: context grows during exploration and collapses during consolidation
316
+ - 22.7% net token savings despite summary generation overhead
317
+ - *Relevance*: The sawtooth pattern and knowledge block abstraction could be applied per-agent before merging at the team level. Each agent's "knowledge block" at the end of a consolidation phase becomes a natural unit for team-level analysis
318
+ - Source: https://arxiv.org/abs/2601.07190
319
+
320
+ **ReSum — Context Summarization for Long-Horizon Search** (Sep 2025)
321
+ - Converts growing interaction histories into compact "reasoning states" via periodic summarization
322
+ - Proposes ReSum-GRPO: GRPO with segmented trajectory training and advantage broadcasting
323
+ - With 1K training samples, achieves strong results on BrowseComp
324
+ - *Relevance*: The "reasoning state" concept could serve as the unit of exchange in our team trajectory graph — at interaction boundaries, each agent's current state is captured as a compact reasoning state rather than the full history
325
+ - Source: https://arxiv.org/abs/2509.13313
326
+
327
+ **U-Fold — Dynamic Intent-Aware Context Folding** (Jan 2026)
328
+ - Extends context folding to handle evolving intents
329
+ - Unlike methods that periodically summarize and discard history, U-Fold retains full history and dynamically extracts intent-relevant data on demand
330
+ - Avoids information loss from premature summarization
331
+ - *Relevance*: For team-level analysis, the "intent" changes depending on what learning signal we're extracting (credit assignment vs. pattern extraction vs. anti-pattern detection). U-Fold's approach suggests keeping the full trajectory available and extracting intent-specific views rather than committing to a single compression
332
+ - Source: https://arxiv.org/abs/2601.18285
333
+
334
+ ### Synthesis: What This Means for Our Design
335
+
336
+ The hierarchical summarization literature points to a **multi-resolution representation** of team trajectories:
337
+
338
+ ```
339
+ Resolution 1 (full): Complete step-by-step data for each agent
340
+ → Used for: detailed debugging, fine-grained credit assignment
341
+ → Stored: raw trajectory files
342
+
343
+ Resolution 2 (subgoal): Agent trajectories chunked by subgoal, with
344
+ internal steps summarized into knowledge blocks
345
+ → Used for: interaction analysis, coordination pattern extraction
346
+ → Stored: compressed trajectory with subgoal boundaries
347
+
348
+ Resolution 3 (agent summary): Each agent's trajectory collapsed into
349
+ a reasoning state — goals, key decisions, outcome
350
+ → Used for: team-level credit assignment, playbook extraction
351
+ → Stored: team trajectory summary
352
+
353
+ Resolution 4 (team summary): Entire team execution as a narrative —
354
+ who did what, how they coordinated, what worked/failed
355
+ → Used for: team playbook matching, meta-learning
356
+ → Stored: team experience record
357
+ ```
358
+
359
+ U-Fold's insight is important: rather than committing to one resolution upfront, keep the full data and extract the appropriate resolution on demand based on the analysis intent. This means our storage strategy should preserve the full trajectories, with compressed views generated lazily during analysis.
360
+
361
+ ---
362
+
363
+ ## Proposed Knowledge Extraction Pipeline
364
+
365
+ Drawing from all five themes, the team trajectory knowledge extraction pipeline:
366
+
367
+ ```
368
+ ┌──────────────────────────────────────────────────────────────────┐
369
+ │ PHASE 1: INGEST + TAG │
370
+ │ │
371
+ │ Input: Raw team trajectory graph │
372
+ │ - Individual trajectories with runtime interaction tags │
373
+ │ - Interaction edges built from matching interactionId tags │
374
+ │ │
375
+ │ Output: TeamTrajectory with validated interaction graph │
376
+ │ │
377
+ │ Informed by: Runtime tagging (our design) │
378
+ └──────────────────────────┬───────────────────────────────────────┘
379
+
380
+
381
+ ┌──────────────────────────────────────────────────────────────────┐
382
+ │ PHASE 2: COMPRESS │
383
+ │ │
384
+ │ Per-agent trajectory compression: │
385
+ │ - Fold internal reasoning into subgoal-level summaries │
386
+ │ (HiAgent, AgentFold, Context-Folding) │
387
+ │ - Preserve interaction boundary steps at full fidelity │
388
+ │ - Remove token waste: verbose tool output, repeated attempts │
389
+ │ (AgentDiet) │
390
+ │ - Plan-aware: preserve info relevant to upcoming interactions │
391
+ │ (PAACE) │
392
+ │ │
393
+ │ Target: ~10x reduction in per-agent trajectory size │
394
+ │ │
395
+ │ Caution: Simple methods first (The Complexity Trap). │
396
+ │ LLM-based summarization only where structural methods fail. │
397
+ └──────────────────────────┬───────────────────────────────────────┘
398
+
399
+
400
+ ┌──────────────────────────────────────────────────────────────────┐
401
+ │ PHASE 3: IDENTIFY CRITICAL MOMENTS │
402
+ │ │
403
+ │ Critical step identification: │
404
+ │ - CSO-style: find steps where alternative actions would have │
405
+ │ flipped the outcome (~16% of steps) │
406
+ │ - AgentPRM-style: score each step on promise + progress │
407
+ │ │
408
+ │ Critical interaction identification: │
409
+ │ - Which interactions changed downstream agent behavior? │
410
+ │ - Which delegations led to successful/failed subtasks? │
411
+ │ - Which signals triggered meaningful state changes? │
412
+ │ - Which messages were redundant/unnecessary? │
413
+ │ │
414
+ │ Target: Focus downstream LLM analysis on ~16% of steps │
415
+ │ and the interaction edges connecting them │
416
+ └──────────────────────────┬───────────────────────────────────────┘
417
+
418
+
419
+ ┌──────────────────────────────────────────────────────────────────┐
420
+ │ PHASE 4: LLM-BASED SEMANTIC ANALYSIS │
421
+ │ │
422
+ │ Now operating on compressed, focused data (~50x smaller): │
423
+ │ │
424
+ │ 4a. Per-agent credit assignment (RICOL-style) │
425
+ │ - Retrospective analysis of each agent's trajectory │
426
+ │ - Dense per-step attribution with natural language reasoning │
427
+ │ │
428
+ │ 4b. Per-interaction credit assignment (LLM-MCA-style) │
429
+ │ - For each interaction edge: was it helpful, neutral, harmful? │
430
+ │ - Cross-trajectory causal analysis │
431
+ │ - Natural language explanation of interaction value │
432
+ │ │
433
+ │ 4c. Team-level outcome analysis │
434
+ │ - Holistic assessment: what coordination patterns drove the │
435
+ │ outcome? │
436
+ │ - Comparison to expected patterns (from team.yaml) │
437
+ │ - Identification of emergent coordination (not declared but │
438
+ │ observed) │
439
+ │ │
440
+ │ Output: Annotated team trajectory with credit scores + │
441
+ │ natural language analysis │
442
+ └──────────────────────────┬───────────────────────────────────────┘
443
+
444
+
445
+ ┌──────────────────────────────────────────────────────────────────┐
446
+ │ PHASE 5: EXTRACT LESSONS (Level 2 knowledge) │
447
+ │ │
448
+ │ From the annotated trajectory, extract concrete lessons │
449
+ │ (Lessons Learned framework, IBM): │
450
+ │ │
451
+ │ - What coordination patterns worked? Why? │
452
+ │ - What coordination patterns failed? Why? │
453
+ │ - Were there unexpected interactions (emergent coordination)? │
454
+ │ - What would the team do differently? │
455
+ │ - Per-role lessons: what did each role learn? │
456
+ │ │
457
+ │ Output: TeamLessons — contextualized, concrete insights │
458
+ │ attached to specific trajectory evidence │
459
+ └──────────────────────────┬───────────────────────────────────────┘
460
+
461
+
462
+ ┌──────────────────────────────────────────────────────────────────┐
463
+ │ PHASE 6: DISTILL PLAYBOOKS (Level 3 knowledge) │
464
+ │ │
465
+ │ Across batches of team lessons (5+ team executions): │
466
+ │ │
467
+ │ 6a. Abstract into principles (EvolveR-style) │
468
+ │ - Semantic deduplication across team lessons │
469
+ │ - Integration of recurring patterns into abstract principles │
470
+ │ - Quality control via success/failure correlation │
471
+ │ │
472
+ │ 6b. Extract interaction graph patterns │
473
+ │ - Common subgraph motifs across successful teams │
474
+ │ - Anti-pattern subgraphs from failed teams │
475
+ │ - Role interaction templates │
476
+ │ │
477
+ │ 6c. Build/update team playbooks │
478
+ │ - Composition guidance (roles, topology, spawn rules) │
479
+ │ - Coordination guidance (channels, interaction patterns, │
480
+ │ delegation strategy) │
481
+ │ - Verification criteria (success/failure indicators) │
482
+ │ │
483
+ │ 6d. State-machine abstraction (Experience to Strategy) │
484
+ │ - Abstract interaction graph into coordination phases │
485
+ │ - Encode phase transitions as meta-cognitive strategies │
486
+ │ │
487
+ │ Output: TeamPlaybooks — abstract, reusable coordination patterns │
488
+ └──────────────────────────────────────────────────────────────────┘
489
+ ```
490
+
491
+ ### Scale Estimates
492
+
493
+ For a typical long-horizon team task:
494
+
495
+ | Stage | Data Size | Reduction |
496
+ |-------|-----------|-----------|
497
+ | Raw team trajectory | ~250K tokens (5 agents × 100 steps × 500 tok/step) | — |
498
+ | After Phase 2 (compression) | ~25K tokens | 10x |
499
+ | After Phase 3 (critical steps) | ~4K tokens | 6x |
500
+ | Phase 4 LLM analysis input | ~4K tokens + ~2K prompt | — |
501
+ | Phase 5 lessons output | ~1K tokens per lesson, ~5 lessons | — |
502
+ | Phase 6 playbook output | ~2K tokens per playbook | — |
503
+
504
+ This makes LLM-based semantic analysis tractable even for long-horizon multi-agent tasks. The LLM sees ~4K tokens of focused, high-signal data rather than ~250K tokens of raw trajectories.
505
+
506
+ ---
507
+
508
+ ## Key References
509
+
510
+ ### Credit Assignment
511
+ - LLM-MCA / LLM-TACA (AAMAS 2025) — https://arxiv.org/abs/2502.16863
512
+ - RICOL (NeurIPS 2025) — https://arxiv.org/abs/2502.19607
513
+ - Speaking the Language of Teamwork (Feb 2025) — https://arxiv.org/abs/2502.03723
514
+ - CollabUIAgents (Feb 2025) — https://arxiv.org/abs/2502.14496
515
+ - MAGRPO (NeurIPS 2025 Workshop) — https://arxiv.org/abs/2508.04652
516
+
517
+ ### Trajectory Compression
518
+ - ACON (Oct 2025) — https://arxiv.org/abs/2510.00615
519
+ - AgentFold (Oct 2025) — https://arxiv.org/abs/2510.24699
520
+ - Context-Folding (Oct 2025) — https://huggingface.co/papers/2510.11967
521
+ - AgentDiet (Sep 2025) — https://arxiv.org/abs/2509.23586
522
+ - PAACE (Dec 2025) — https://arxiv.org/abs/2512.16970
523
+ - The Complexity Trap (Aug 2025) — https://arxiv.org/abs/2508.21433
524
+
525
+ ### Critical Step Identification
526
+ - Verified Critical Step Optimization (Feb 2026) — https://arxiv.org/abs/2602.03412
527
+ - AgentPRM (Nov 2025) — https://arxiv.org/abs/2511.08325
528
+ - MT-GRPO (May 2025) — https://arxiv.org/abs/2505.11821
529
+ - iStar (Sep 2025) — https://arxiv.org/abs/2509.19199
530
+
531
+ ### Graph-Based Analysis
532
+ - From Experience to Strategy (Nov 2025) — https://arxiv.org/abs/2511.07800
533
+ - Reasoning via Graph Perspective (May 2025) — https://arxiv.org/abs/2505.13890
534
+ - AgentArmor (Nov 2025) — https://arxiv.org/abs/2508.01249
535
+ - Semantic Dynamics Analysis (Feb 2026) — https://arxiv.org/abs/2602.08276
536
+
537
+ ### Experience Distillation
538
+ - EvolveR (Oct 2025) — https://arxiv.org/abs/2510.16079
539
+ - Lessons Learned (IBM, NeurIPS 2025)
540
+ - Memento (Aug 2025) — https://arxiv.org/abs/2508.16153
541
+ - ELL (Aug 2025) — https://arxiv.org/abs/2508.19005
542
+ - Structured Agent Distillation (May 2025) — https://arxiv.org/abs/2505.13820
543
+
544
+ ### Hierarchical Summarization
545
+ - HiAgent (ACL 2025) — https://aclanthology.org/2025.acl-long.1575/
546
+ - Focus (Jan 2026) — https://arxiv.org/abs/2601.07190
547
+ - ReSum (Sep 2025) — https://arxiv.org/abs/2509.13313
548
+ - U-Fold (Jan 2026) — https://arxiv.org/abs/2601.18285
549
+
550
+ ### Surveys
551
+ - Self-Evolving AI Agents (Aug 2025) — https://arxiv.org/abs/2508.07407
552
+ - Multi-Agent Collaboration Mechanisms (Jan 2025) — https://arxiv.org/abs/2501.06322
553
+ - Process Reward Models (Oct 2025) — https://arxiv.org/abs/2510.08049