@andre.li/memoark 0.3.1 → 0.3.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 (497) hide show
  1. package/README.en.md +388 -69
  2. package/README.md +674 -309
  3. package/README.zh-CN.md +816 -0
  4. package/bin/memoark.mjs +7 -2
  5. package/dist/adapters/store.d.ts.map +1 -1
  6. package/dist/adapters/store.js +6 -5
  7. package/dist/adapters/store.js.map +1 -1
  8. package/dist/cli-helpers.d.ts +12 -0
  9. package/dist/cli-helpers.d.ts.map +1 -0
  10. package/dist/cli-helpers.js +11 -0
  11. package/dist/cli-helpers.js.map +1 -0
  12. package/dist/cli.js +682 -126
  13. package/dist/cli.js.map +1 -1
  14. package/dist/collectors/feishu/chat-name-resolver.d.ts +33 -0
  15. package/dist/collectors/feishu/chat-name-resolver.d.ts.map +1 -0
  16. package/dist/collectors/feishu/chat-name-resolver.js +63 -0
  17. package/dist/collectors/feishu/chat-name-resolver.js.map +1 -0
  18. package/dist/collectors/feishu/collector.d.ts +4 -0
  19. package/dist/collectors/feishu/collector.d.ts.map +1 -1
  20. package/dist/collectors/feishu/collector.js +27 -4
  21. package/dist/collectors/feishu/collector.js.map +1 -1
  22. package/dist/collectors/feishu/docs/blocks.d.ts +25 -0
  23. package/dist/collectors/feishu/docs/blocks.d.ts.map +1 -0
  24. package/dist/collectors/feishu/docs/blocks.js +34 -0
  25. package/dist/collectors/feishu/docs/blocks.js.map +1 -0
  26. package/dist/collectors/feishu/docs/candidate.d.ts +17 -0
  27. package/dist/collectors/feishu/docs/candidate.d.ts.map +1 -0
  28. package/dist/collectors/feishu/docs/candidate.js +36 -0
  29. package/dist/collectors/feishu/docs/candidate.js.map +1 -0
  30. package/dist/collectors/feishu/docs/config.d.ts +41 -0
  31. package/dist/collectors/feishu/docs/config.d.ts.map +1 -0
  32. package/dist/collectors/feishu/docs/config.js +30 -0
  33. package/dist/collectors/feishu/docs/config.js.map +1 -0
  34. package/dist/collectors/feishu/docs/decision.d.ts +14 -0
  35. package/dist/collectors/feishu/docs/decision.d.ts.map +1 -0
  36. package/dist/collectors/feishu/docs/decision.js +43 -0
  37. package/dist/collectors/feishu/docs/decision.js.map +1 -0
  38. package/dist/collectors/feishu/docs/full-builder.d.ts +17 -0
  39. package/dist/collectors/feishu/docs/full-builder.d.ts.map +1 -0
  40. package/dist/collectors/feishu/docs/full-builder.js +136 -0
  41. package/dist/collectors/feishu/docs/full-builder.js.map +1 -0
  42. package/dist/collectors/feishu/docs/hash.d.ts +8 -0
  43. package/dist/collectors/feishu/docs/hash.d.ts.map +1 -0
  44. package/dist/collectors/feishu/docs/hash.js +15 -0
  45. package/dist/collectors/feishu/docs/hash.js.map +1 -0
  46. package/dist/collectors/feishu/docs/ingest.d.ts +54 -0
  47. package/dist/collectors/feishu/docs/ingest.d.ts.map +1 -0
  48. package/dist/collectors/feishu/docs/ingest.js +120 -0
  49. package/dist/collectors/feishu/docs/ingest.js.map +1 -0
  50. package/dist/collectors/feishu/docs/llm-json.d.ts +13 -0
  51. package/dist/collectors/feishu/docs/llm-json.d.ts.map +1 -0
  52. package/dist/collectors/feishu/docs/llm-json.js +40 -0
  53. package/dist/collectors/feishu/docs/llm-json.js.map +1 -0
  54. package/dist/collectors/feishu/docs/pointer-builder.d.ts +7 -0
  55. package/dist/collectors/feishu/docs/pointer-builder.d.ts.map +1 -0
  56. package/dist/collectors/feishu/docs/pointer-builder.js +11 -0
  57. package/dist/collectors/feishu/docs/pointer-builder.js.map +1 -0
  58. package/dist/collectors/feishu/docs/render.d.ts +8 -0
  59. package/dist/collectors/feishu/docs/render.d.ts.map +1 -0
  60. package/dist/collectors/feishu/docs/render.js +105 -0
  61. package/dist/collectors/feishu/docs/render.js.map +1 -0
  62. package/dist/collectors/feishu/docs/run.d.ts +37 -0
  63. package/dist/collectors/feishu/docs/run.d.ts.map +1 -0
  64. package/dist/collectors/feishu/docs/run.js +143 -0
  65. package/dist/collectors/feishu/docs/run.js.map +1 -0
  66. package/dist/collectors/feishu/docs/status.d.ts +16 -0
  67. package/dist/collectors/feishu/docs/status.d.ts.map +1 -0
  68. package/dist/collectors/feishu/docs/status.js +24 -0
  69. package/dist/collectors/feishu/docs/status.js.map +1 -0
  70. package/dist/collectors/feishu/docs/store-writer.d.ts +32 -0
  71. package/dist/collectors/feishu/docs/store-writer.d.ts.map +1 -0
  72. package/dist/collectors/feishu/docs/store-writer.js +71 -0
  73. package/dist/collectors/feishu/docs/store-writer.js.map +1 -0
  74. package/dist/collectors/feishu/docs/toc.d.ts +3 -0
  75. package/dist/collectors/feishu/docs/toc.d.ts.map +1 -0
  76. package/dist/collectors/feishu/docs/toc.js +19 -0
  77. package/dist/collectors/feishu/docs/toc.js.map +1 -0
  78. package/dist/collectors/feishu/docs/triggers.d.ts +7 -0
  79. package/dist/collectors/feishu/docs/triggers.d.ts.map +1 -0
  80. package/dist/collectors/feishu/docs/triggers.js +31 -0
  81. package/dist/collectors/feishu/docs/triggers.js.map +1 -0
  82. package/dist/collectors/feishu/docs/types.d.ts +109 -0
  83. package/dist/collectors/feishu/docs/types.d.ts.map +1 -0
  84. package/dist/collectors/feishu/docs/types.js +2 -0
  85. package/dist/collectors/feishu/docs/types.js.map +1 -0
  86. package/dist/collectors/feishu/docs/upgrade-queue.d.ts +19 -0
  87. package/dist/collectors/feishu/docs/upgrade-queue.d.ts.map +1 -0
  88. package/dist/collectors/feishu/docs/upgrade-queue.js +36 -0
  89. package/dist/collectors/feishu/docs/upgrade-queue.js.map +1 -0
  90. package/dist/collectors/feishu/docs/url-parser.d.ts +3 -0
  91. package/dist/collectors/feishu/docs/url-parser.d.ts.map +1 -0
  92. package/dist/collectors/feishu/docs/url-parser.js +39 -0
  93. package/dist/collectors/feishu/docs/url-parser.js.map +1 -0
  94. package/dist/collectors/feishu/docs/walkers.d.ts +24 -0
  95. package/dist/collectors/feishu/docs/walkers.d.ts.map +1 -0
  96. package/dist/collectors/feishu/docs/walkers.js +90 -0
  97. package/dist/collectors/feishu/docs/walkers.js.map +1 -0
  98. package/dist/collectors/feishu/docs/wiki-resolver.d.ts +15 -0
  99. package/dist/collectors/feishu/docs/wiki-resolver.d.ts.map +1 -0
  100. package/dist/collectors/feishu/docs/wiki-resolver.js +24 -0
  101. package/dist/collectors/feishu/docs/wiki-resolver.js.map +1 -0
  102. package/dist/collectors/feishu/lark-cli-client.d.ts +12 -0
  103. package/dist/collectors/feishu/lark-cli-client.d.ts.map +1 -1
  104. package/dist/collectors/feishu/lark-cli-client.js +37 -2
  105. package/dist/collectors/feishu/lark-cli-client.js.map +1 -1
  106. package/dist/collectors/feishu/lark-cli-identity-backend.d.ts +28 -0
  107. package/dist/collectors/feishu/lark-cli-identity-backend.d.ts.map +1 -0
  108. package/dist/collectors/feishu/lark-cli-identity-backend.js +110 -0
  109. package/dist/collectors/feishu/lark-cli-identity-backend.js.map +1 -0
  110. package/dist/collectors/feishu/self-open-id.d.ts +20 -0
  111. package/dist/collectors/feishu/self-open-id.d.ts.map +1 -0
  112. package/dist/collectors/feishu/self-open-id.js +31 -0
  113. package/dist/collectors/feishu/self-open-id.js.map +1 -0
  114. package/dist/collectors/feishu/sources/dm.d.ts.map +1 -1
  115. package/dist/collectors/feishu/sources/dm.js +4 -0
  116. package/dist/collectors/feishu/sources/dm.js.map +1 -1
  117. package/dist/collectors/feishu/sources/mail.d.ts.map +1 -1
  118. package/dist/collectors/feishu/sources/mail.js +18 -20
  119. package/dist/collectors/feishu/sources/mail.js.map +1 -1
  120. package/dist/collectors/feishu/sources/messages.d.ts +2 -0
  121. package/dist/collectors/feishu/sources/messages.d.ts.map +1 -1
  122. package/dist/collectors/feishu/sources/messages.js +28 -1
  123. package/dist/collectors/feishu/sources/messages.js.map +1 -1
  124. package/dist/collectors/feishu/types.d.ts +37 -3
  125. package/dist/collectors/feishu/types.d.ts.map +1 -1
  126. package/dist/collectors/feishu/types.js.map +1 -1
  127. package/dist/config-center/connection-checks.d.ts.map +1 -1
  128. package/dist/config-center/connection-checks.js +1 -1
  129. package/dist/config-center/connection-checks.js.map +1 -1
  130. package/dist/config-center/schema.d.ts.map +1 -1
  131. package/dist/config-center/schema.js +77 -0
  132. package/dist/config-center/schema.js.map +1 -1
  133. package/dist/consolidator/consolidator.d.ts +13 -1
  134. package/dist/consolidator/consolidator.d.ts.map +1 -1
  135. package/dist/consolidator/consolidator.js +12 -2
  136. package/dist/consolidator/consolidator.js.map +1 -1
  137. package/dist/core/canonicalize.js +5 -1
  138. package/dist/core/canonicalize.js.map +1 -1
  139. package/dist/core/config.d.ts +52 -9
  140. package/dist/core/config.d.ts.map +1 -1
  141. package/dist/core/config.js +86 -24
  142. package/dist/core/config.js.map +1 -1
  143. package/dist/core/env-validation.d.ts +9 -0
  144. package/dist/core/env-validation.d.ts.map +1 -0
  145. package/dist/core/env-validation.js +94 -0
  146. package/dist/core/env-validation.js.map +1 -0
  147. package/dist/core/identity-resolver.d.ts +24 -3
  148. package/dist/core/identity-resolver.d.ts.map +1 -1
  149. package/dist/core/identity-resolver.js +147 -2
  150. package/dist/core/identity-resolver.js.map +1 -1
  151. package/dist/core/person-identity.d.ts +124 -0
  152. package/dist/core/person-identity.d.ts.map +1 -0
  153. package/dist/core/person-identity.js +342 -0
  154. package/dist/core/person-identity.js.map +1 -0
  155. package/dist/core/person-slug.d.ts +21 -0
  156. package/dist/core/person-slug.d.ts.map +1 -0
  157. package/dist/core/person-slug.js +93 -0
  158. package/dist/core/person-slug.js.map +1 -0
  159. package/dist/core/pipeline-factory.d.ts +1 -1
  160. package/dist/core/pipeline-factory.d.ts.map +1 -1
  161. package/dist/core/pipeline-factory.js +8 -3
  162. package/dist/core/pipeline-factory.js.map +1 -1
  163. package/dist/core/pipeline.d.ts +16 -0
  164. package/dist/core/pipeline.d.ts.map +1 -1
  165. package/dist/core/pipeline.js +49 -1
  166. package/dist/core/pipeline.js.map +1 -1
  167. package/dist/core/resource-loader.d.ts +2 -0
  168. package/dist/core/resource-loader.d.ts.map +1 -0
  169. package/dist/core/resource-loader.js +12 -0
  170. package/dist/core/resource-loader.js.map +1 -0
  171. package/dist/core/schemas.d.ts +2981 -309
  172. package/dist/core/schemas.d.ts.map +1 -1
  173. package/dist/core/schemas.js +27 -0
  174. package/dist/core/schemas.js.map +1 -1
  175. package/dist/core/signal-scoring.d.ts.map +1 -1
  176. package/dist/core/signal-scoring.js +5 -1
  177. package/dist/core/signal-scoring.js.map +1 -1
  178. package/dist/core/source-ref.d.ts +4 -0
  179. package/dist/core/source-ref.d.ts.map +1 -0
  180. package/dist/core/source-ref.js +24 -0
  181. package/dist/core/source-ref.js.map +1 -0
  182. package/dist/core/state.d.ts +1 -1
  183. package/dist/core/state.d.ts.map +1 -1
  184. package/dist/core/state.js +3 -2
  185. package/dist/core/state.js.map +1 -1
  186. package/dist/core/types.d.ts +34 -6
  187. package/dist/core/types.d.ts.map +1 -1
  188. package/dist/daemon/reload-manager.d.ts +27 -0
  189. package/dist/daemon/reload-manager.d.ts.map +1 -0
  190. package/dist/daemon/reload-manager.js +67 -0
  191. package/dist/daemon/reload-manager.js.map +1 -0
  192. package/dist/daemon/scheduler.d.ts +9 -1
  193. package/dist/daemon/scheduler.d.ts.map +1 -1
  194. package/dist/daemon/scheduler.js +113 -38
  195. package/dist/daemon/scheduler.js.map +1 -1
  196. package/dist/daemon/serve-runtime.d.ts +31 -0
  197. package/dist/daemon/serve-runtime.d.ts.map +1 -0
  198. package/dist/daemon/serve-runtime.js +230 -0
  199. package/dist/daemon/serve-runtime.js.map +1 -0
  200. package/dist/embedded-assets.generated.d.ts.map +1 -1
  201. package/dist/embedded-assets.generated.js +3 -3
  202. package/dist/embedded-assets.generated.js.map +1 -1
  203. package/dist/extractors/playbook-extractor.d.ts +35 -0
  204. package/dist/extractors/playbook-extractor.d.ts.map +1 -0
  205. package/dist/extractors/playbook-extractor.js +98 -0
  206. package/dist/extractors/playbook-extractor.js.map +1 -0
  207. package/dist/extractors/prompts/examples/agent-session.md +257 -0
  208. package/dist/extractors/prompts/signal-extract.md +199 -0
  209. package/dist/extractors/prompts/system.md +45 -0
  210. package/dist/extractors/signal-extractor.d.ts +2 -1
  211. package/dist/extractors/signal-extractor.d.ts.map +1 -1
  212. package/dist/extractors/signal-extractor.js +99 -7
  213. package/dist/extractors/signal-extractor.js.map +1 -1
  214. package/dist/hooks/handlers.d.ts +21 -0
  215. package/dist/hooks/handlers.d.ts.map +1 -0
  216. package/dist/hooks/handlers.js +22 -0
  217. package/dist/hooks/handlers.js.map +1 -0
  218. package/dist/hooks/inject.d.ts +7 -0
  219. package/dist/hooks/inject.d.ts.map +1 -0
  220. package/dist/hooks/inject.js +18 -0
  221. package/dist/hooks/inject.js.map +1 -0
  222. package/dist/hooks/install.d.ts +14 -0
  223. package/dist/hooks/install.d.ts.map +1 -0
  224. package/dist/hooks/install.js +34 -0
  225. package/dist/hooks/install.js.map +1 -0
  226. package/dist/hooks/output.d.ts +19 -0
  227. package/dist/hooks/output.d.ts.map +1 -0
  228. package/dist/hooks/output.js +13 -0
  229. package/dist/hooks/output.js.map +1 -0
  230. package/dist/hooks/recall-client.d.ts +25 -0
  231. package/dist/hooks/recall-client.d.ts.map +1 -0
  232. package/dist/hooks/recall-client.js +56 -0
  233. package/dist/hooks/recall-client.js.map +1 -0
  234. package/dist/hooks/run-event.d.ts +13 -0
  235. package/dist/hooks/run-event.d.ts.map +1 -0
  236. package/dist/hooks/run-event.js +20 -0
  237. package/dist/hooks/run-event.js.map +1 -0
  238. package/dist/hooks/settings-edit.d.ts +10 -0
  239. package/dist/hooks/settings-edit.d.ts.map +1 -0
  240. package/dist/hooks/settings-edit.js +44 -0
  241. package/dist/hooks/settings-edit.js.map +1 -0
  242. package/dist/hooks/writeback.d.ts +12 -0
  243. package/dist/hooks/writeback.d.ts.map +1 -0
  244. package/dist/hooks/writeback.js +48 -0
  245. package/dist/hooks/writeback.js.map +1 -0
  246. package/dist/install/clients/claude-code.d.ts +3 -0
  247. package/dist/install/clients/claude-code.d.ts.map +1 -0
  248. package/dist/install/clients/claude-code.js +30 -0
  249. package/dist/install/clients/claude-code.js.map +1 -0
  250. package/dist/install/clients/claude-desktop.d.ts +3 -0
  251. package/dist/install/clients/claude-desktop.d.ts.map +1 -0
  252. package/dist/install/clients/claude-desktop.js +31 -0
  253. package/dist/install/clients/claude-desktop.js.map +1 -0
  254. package/dist/install/clients/codex.d.ts +3 -0
  255. package/dist/install/clients/codex.d.ts.map +1 -0
  256. package/dist/install/clients/codex.js +32 -0
  257. package/dist/install/clients/codex.js.map +1 -0
  258. package/dist/install/clients/cursor.d.ts +3 -0
  259. package/dist/install/clients/cursor.d.ts.map +1 -0
  260. package/dist/install/clients/cursor.js +35 -0
  261. package/dist/install/clients/cursor.js.map +1 -0
  262. package/dist/install/clients/hermes.d.ts +3 -0
  263. package/dist/install/clients/hermes.d.ts.map +1 -0
  264. package/dist/install/clients/hermes.js +35 -0
  265. package/dist/install/clients/hermes.js.map +1 -0
  266. package/dist/install/clients/index.d.ts +4 -0
  267. package/dist/install/clients/index.d.ts.map +1 -0
  268. package/dist/install/clients/index.js +18 -0
  269. package/dist/install/clients/index.js.map +1 -0
  270. package/dist/install/clients/windsurf.d.ts +3 -0
  271. package/dist/install/clients/windsurf.d.ts.map +1 -0
  272. package/dist/install/clients/windsurf.js +32 -0
  273. package/dist/install/clients/windsurf.js.map +1 -0
  274. package/dist/install/command.d.ts +14 -0
  275. package/dist/install/command.d.ts.map +1 -0
  276. package/dist/install/command.js +34 -0
  277. package/dist/install/command.js.map +1 -0
  278. package/dist/install/directive.d.ts +7 -0
  279. package/dist/install/directive.d.ts.map +1 -0
  280. package/dist/install/directive.js +31 -0
  281. package/dist/install/directive.js.map +1 -0
  282. package/dist/install/index.d.ts +26 -0
  283. package/dist/install/index.d.ts.map +1 -0
  284. package/dist/install/index.js +117 -0
  285. package/dist/install/index.js.map +1 -0
  286. package/dist/install/json-config.d.ts +11 -0
  287. package/dist/install/json-config.d.ts.map +1 -0
  288. package/dist/install/json-config.js +39 -0
  289. package/dist/install/json-config.js.map +1 -0
  290. package/dist/install/marked-block.d.ts +11 -0
  291. package/dist/install/marked-block.d.ts.map +1 -0
  292. package/dist/install/marked-block.js +34 -0
  293. package/dist/install/marked-block.js.map +1 -0
  294. package/dist/install/skill.d.ts +4 -0
  295. package/dist/install/skill.d.ts.map +1 -0
  296. package/dist/install/skill.js +61 -0
  297. package/dist/install/skill.js.map +1 -0
  298. package/dist/install/toml-config.d.ts +4 -0
  299. package/dist/install/toml-config.d.ts.map +1 -0
  300. package/dist/install/toml-config.js +51 -0
  301. package/dist/install/toml-config.js.map +1 -0
  302. package/dist/install/types.d.ts +37 -0
  303. package/dist/install/types.d.ts.map +1 -0
  304. package/dist/install/types.js +4 -0
  305. package/dist/install/types.js.map +1 -0
  306. package/dist/install/yaml-config.d.ts +4 -0
  307. package/dist/install/yaml-config.d.ts.map +1 -0
  308. package/dist/install/yaml-config.js +18 -0
  309. package/dist/install/yaml-config.js.map +1 -0
  310. package/dist/processors/privacy.d.ts +4 -1
  311. package/dist/processors/privacy.d.ts.map +1 -1
  312. package/dist/processors/privacy.js +5 -3
  313. package/dist/processors/privacy.js.map +1 -1
  314. package/dist/profile/accumulate.d.ts +28 -0
  315. package/dist/profile/accumulate.d.ts.map +1 -0
  316. package/dist/profile/accumulate.js +48 -0
  317. package/dist/profile/accumulate.js.map +1 -0
  318. package/dist/profile/behavior.d.ts +32 -0
  319. package/dist/profile/behavior.d.ts.map +1 -0
  320. package/dist/profile/behavior.js +122 -0
  321. package/dist/profile/behavior.js.map +1 -0
  322. package/dist/profile/four-color.d.ts +12 -0
  323. package/dist/profile/four-color.d.ts.map +1 -0
  324. package/dist/profile/four-color.js +39 -0
  325. package/dist/profile/four-color.js.map +1 -0
  326. package/dist/profile/profile-synth.d.ts +27 -0
  327. package/dist/profile/profile-synth.d.ts.map +1 -0
  328. package/dist/profile/profile-synth.js +174 -0
  329. package/dist/profile/profile-synth.js.map +1 -0
  330. package/dist/profile/types.d.ts +84 -0
  331. package/dist/profile/types.d.ts.map +1 -0
  332. package/dist/profile/types.js +11 -0
  333. package/dist/profile/types.js.map +1 -0
  334. package/dist/server/api.d.ts +8 -2
  335. package/dist/server/api.d.ts.map +1 -1
  336. package/dist/server/api.js +69 -34
  337. package/dist/server/api.js.map +1 -1
  338. package/dist/server/backfill-routes.d.ts.map +1 -1
  339. package/dist/server/backfill-routes.js +14 -1
  340. package/dist/server/backfill-routes.js.map +1 -1
  341. package/dist/server/chat-name-refresh-job.d.ts +33 -0
  342. package/dist/server/chat-name-refresh-job.d.ts.map +1 -0
  343. package/dist/server/chat-name-refresh-job.js +120 -0
  344. package/dist/server/chat-name-refresh-job.js.map +1 -0
  345. package/dist/server/chat-name-routes.d.ts +13 -0
  346. package/dist/server/chat-name-routes.d.ts.map +1 -0
  347. package/dist/server/chat-name-routes.js +81 -0
  348. package/dist/server/chat-name-routes.js.map +1 -0
  349. package/dist/server/config-routes.d.ts +2 -0
  350. package/dist/server/config-routes.d.ts.map +1 -1
  351. package/dist/server/config-routes.js +2 -1
  352. package/dist/server/config-routes.js.map +1 -1
  353. package/dist/server/mcp-http.d.ts +26 -0
  354. package/dist/server/mcp-http.d.ts.map +1 -0
  355. package/dist/server/mcp-http.js +102 -0
  356. package/dist/server/mcp-http.js.map +1 -0
  357. package/dist/server/mcp.d.ts +191 -25
  358. package/dist/server/mcp.d.ts.map +1 -1
  359. package/dist/server/mcp.js +1111 -68
  360. package/dist/server/mcp.js.map +1 -1
  361. package/dist/server/open-browser.d.ts +3 -0
  362. package/dist/server/open-browser.d.ts.map +1 -0
  363. package/dist/server/open-browser.js +12 -0
  364. package/dist/server/open-browser.js.map +1 -0
  365. package/dist/server/runtime.d.ts +13 -0
  366. package/dist/server/runtime.d.ts.map +1 -0
  367. package/dist/server/runtime.js +27 -0
  368. package/dist/server/runtime.js.map +1 -0
  369. package/dist/server/setup-server.d.ts.map +1 -1
  370. package/dist/server/setup-server.js +8 -11
  371. package/dist/server/setup-server.js.map +1 -1
  372. package/dist/setup/connection-tests.d.ts +1 -1
  373. package/dist/setup/connection-tests.d.ts.map +1 -1
  374. package/dist/setup/connection-tests.js +4 -2
  375. package/dist/setup/connection-tests.js.map +1 -1
  376. package/dist/setup/generate-config.d.ts.map +1 -1
  377. package/dist/setup/generate-config.js +31 -1
  378. package/dist/setup/generate-config.js.map +1 -1
  379. package/dist/setup/init-wizard.d.ts +1 -0
  380. package/dist/setup/init-wizard.d.ts.map +1 -1
  381. package/dist/setup/init-wizard.js +38 -21
  382. package/dist/setup/init-wizard.js.map +1 -1
  383. package/dist/setup/validate-config.d.ts +5 -1
  384. package/dist/setup/validate-config.d.ts.map +1 -1
  385. package/dist/setup/validate-config.js +18 -0
  386. package/dist/setup/validate-config.js.map +1 -1
  387. package/dist/store/data-dir-lock.d.ts +15 -0
  388. package/dist/store/data-dir-lock.d.ts.map +1 -0
  389. package/dist/store/data-dir-lock.js +96 -0
  390. package/dist/store/data-dir-lock.js.map +1 -0
  391. package/dist/store/database.d.ts +2 -0
  392. package/dist/store/database.d.ts.map +1 -1
  393. package/dist/store/database.js +23 -10
  394. package/dist/store/database.js.map +1 -1
  395. package/dist/store/graph.d.ts +22 -0
  396. package/dist/store/graph.d.ts.map +1 -1
  397. package/dist/store/graph.js +97 -7
  398. package/dist/store/graph.js.map +1 -1
  399. package/dist/store/migrations/index.d.ts.map +1 -1
  400. package/dist/store/migrations/index.js +52 -0
  401. package/dist/store/migrations/index.js.map +1 -1
  402. package/dist/store/pages.d.ts +7 -0
  403. package/dist/store/pages.d.ts.map +1 -1
  404. package/dist/store/pages.js +56 -1
  405. package/dist/store/pages.js.map +1 -1
  406. package/dist/store/person-behavior.d.ts +28 -0
  407. package/dist/store/person-behavior.d.ts.map +1 -0
  408. package/dist/store/person-behavior.js +127 -0
  409. package/dist/store/person-behavior.js.map +1 -0
  410. package/dist/store/pglite-assets.d.ts +15 -0
  411. package/dist/store/pglite-assets.d.ts.map +1 -0
  412. package/dist/store/pglite-assets.js +47 -0
  413. package/dist/store/pglite-assets.js.map +1 -0
  414. package/dist/store/query-rewrite.d.ts +28 -0
  415. package/dist/store/query-rewrite.d.ts.map +1 -0
  416. package/dist/store/query-rewrite.js +97 -0
  417. package/dist/store/query-rewrite.js.map +1 -0
  418. package/dist/store/schema.sql +107 -0
  419. package/dist/store/search.d.ts +36 -8
  420. package/dist/store/search.d.ts.map +1 -1
  421. package/dist/store/search.js +188 -76
  422. package/dist/store/search.js.map +1 -1
  423. package/dist/store/tags.d.ts.map +1 -1
  424. package/dist/store/tags.js +6 -2
  425. package/dist/store/tags.js.map +1 -1
  426. package/dist/store/timeline.d.ts +13 -1
  427. package/dist/store/timeline.d.ts.map +1 -1
  428. package/dist/store/timeline.js +134 -4
  429. package/dist/store/timeline.js.map +1 -1
  430. package/dist/store/trgm-search.d.ts +13 -0
  431. package/dist/store/trgm-search.d.ts.map +1 -0
  432. package/dist/store/trgm-search.js +53 -0
  433. package/dist/store/trgm-search.js.map +1 -0
  434. package/dist/store/wikilink.d.ts +17 -0
  435. package/dist/store/wikilink.d.ts.map +1 -0
  436. package/dist/store/wikilink.js +58 -0
  437. package/dist/store/wikilink.js.map +1 -0
  438. package/dist/sync/obsidian.d.ts.map +1 -1
  439. package/dist/sync/obsidian.js +5 -1
  440. package/dist/sync/obsidian.js.map +1 -1
  441. package/dist/synth/cache.d.ts +17 -0
  442. package/dist/synth/cache.d.ts.map +1 -0
  443. package/dist/synth/cache.js +67 -0
  444. package/dist/synth/cache.js.map +1 -0
  445. package/dist/synth/citations.d.ts +12 -0
  446. package/dist/synth/citations.d.ts.map +1 -0
  447. package/dist/synth/citations.js +28 -0
  448. package/dist/synth/citations.js.map +1 -0
  449. package/dist/synth/context.d.ts +10 -0
  450. package/dist/synth/context.d.ts.map +1 -0
  451. package/dist/synth/context.js +67 -0
  452. package/dist/synth/context.js.map +1 -0
  453. package/dist/synth/engine.d.ts +16 -0
  454. package/dist/synth/engine.d.ts.map +1 -0
  455. package/dist/synth/engine.js +111 -0
  456. package/dist/synth/engine.js.map +1 -0
  457. package/dist/synth/gaps.d.ts +17 -0
  458. package/dist/synth/gaps.d.ts.map +1 -0
  459. package/dist/synth/gaps.js +57 -0
  460. package/dist/synth/gaps.js.map +1 -0
  461. package/dist/synth/index.d.ts +6 -0
  462. package/dist/synth/index.d.ts.map +1 -0
  463. package/dist/synth/index.js +6 -0
  464. package/dist/synth/index.js.map +1 -0
  465. package/dist/synth/intent.d.ts +6 -0
  466. package/dist/synth/intent.d.ts.map +1 -0
  467. package/dist/synth/intent.js +13 -0
  468. package/dist/synth/intent.js.map +1 -0
  469. package/dist/synth/intents/daily-report.d.ts +7 -0
  470. package/dist/synth/intents/daily-report.d.ts.map +1 -0
  471. package/dist/synth/intents/daily-report.js +37 -0
  472. package/dist/synth/intents/daily-report.js.map +1 -0
  473. package/dist/synth/intents/index.d.ts +2 -0
  474. package/dist/synth/intents/index.d.ts.map +1 -0
  475. package/dist/synth/intents/index.js +12 -0
  476. package/dist/synth/intents/index.js.map +1 -0
  477. package/dist/synth/intents/person-strategy.d.ts +40 -0
  478. package/dist/synth/intents/person-strategy.d.ts.map +1 -0
  479. package/dist/synth/intents/person-strategy.js +66 -0
  480. package/dist/synth/intents/person-strategy.js.map +1 -0
  481. package/dist/synth/intents/recall.d.ts +8 -0
  482. package/dist/synth/intents/recall.d.ts.map +1 -0
  483. package/dist/synth/intents/recall.js +26 -0
  484. package/dist/synth/intents/recall.js.map +1 -0
  485. package/dist/synth/intents/troubleshoot.d.ts +11 -0
  486. package/dist/synth/intents/troubleshoot.d.ts.map +1 -0
  487. package/dist/synth/intents/troubleshoot.js +66 -0
  488. package/dist/synth/intents/troubleshoot.js.map +1 -0
  489. package/dist/synth/scope.d.ts +13 -0
  490. package/dist/synth/scope.d.ts.map +1 -0
  491. package/dist/synth/scope.js +139 -0
  492. package/dist/synth/scope.js.map +1 -0
  493. package/dist/synth/types.d.ts +117 -0
  494. package/dist/synth/types.d.ts.map +1 -0
  495. package/dist/synth/types.js +2 -0
  496. package/dist/synth/types.js.map +1 -0
  497. package/package.json +18 -6
package/README.md CHANGED
@@ -1,284 +1,410 @@
1
1
  <p align="center">
2
2
  <h1 align="center">Memoark</h1>
3
- <p align="center"><strong>把你的飞书工作与 AI Agent 会话,沉淀成一份私有、本地的核心记忆,让你的 Agent 真正懂你。</strong></p>
3
+ <p align="center"><em>You are the sum of your working relationships.</em></p>
4
+ <p align="center"><strong>A local-first memory system for your work — turning your DMs, group chats, emails, docs, and meetings into a private personal memory, so your AI agents truly know you.</strong></p>
4
5
  </p>
5
6
 
6
7
  <p align="center">
7
- 简体中文 | <a href="README.en.md">English</a>
8
+ <a href="README.md">简体中文</a> | English
8
9
  </p>
9
10
 
10
11
  <p align="center">
11
12
  <a href="LICENSE"><img alt="License: Apache 2.0" src="https://img.shields.io/badge/License-Apache_2.0-blue.svg"></a>
13
+ <a href="https://www.npmjs.com/package/@andre.li/memoark"><img alt="npm" src="https://img.shields.io/npm/v/@andre.li/memoark?color=cb3837&logo=npm"></a>
12
14
  <img alt="Runtime: Bun" src="https://img.shields.io/badge/runtime-Bun-black">
13
15
  <img alt="Language: TypeScript" src="https://img.shields.io/badge/lang-TypeScript-3178c6">
14
- <img alt="Tests: 800+" src="https://img.shields.io/badge/tests-800%2B-success">
16
+ <img alt="Tests: 1000+" src="https://img.shields.io/badge/tests-1000%2B-success">
15
17
  </p>
16
18
 
17
19
  <p align="center">
18
- <img src="docs/assets/web-ui-graph.jpeg" alt="Memoark 知识图谱 —— 实体、决策、任务、知识在你的工作中相互连接" width="850">
20
+ <a href="#quick-start">Quick Start</a>
21
+ <a href="#features">Features</a> •
22
+ <a href="#use-cases">Use Cases</a> •
23
+ <a href="#architecture">Architecture</a> •
24
+ <a href="#cli-reference">CLI Reference</a> •
25
+ <a href="#roadmap">Roadmap</a>
26
+ </p>
27
+
28
+ <p align="center">
29
+ <img src="https://raw.githubusercontent.com/AndreLYL/memoark/main/docs/assets/web-ui-graph.jpeg" alt="Memoark knowledge graph — entities, decisions, tasks, and knowledge connected across your work" width="850">
19
30
  <br>
20
- <em>把你的工作变成一张活的知识图谱 —— 人、决策、任务、知识,全部连起来。</em>
31
+ <em>Your work, as a living knowledge graph — people, decisions, tasks, and knowledge, connected.</em>
21
32
  </p>
22
33
 
34
+ <!-- TODO(demo): replace with an 8-12s demo GIF — ask Memoark a question inside Claude Code
35
+ and watch the agent recall a Feishu meeting decision + linked task over MCP.
36
+ Research shows a GIF of "the product actually working" is the single highest-converting
37
+ element in a README. -->
38
+
23
39
  ---
24
40
 
25
- ## 痛点
41
+ ## The Problem
26
42
 
27
- 你的工作记忆有两个家,而你的 AI Agent 一个都够不着。
43
+ Your work memory has two homes, and your AI agents can't reach either.
28
44
 
29
- - **飞书**承载你的工作关系网私信、群聊、邮件、会议、任务。这是你*在做什么*、*和谁一起做*。
30
- - **AI Agent**(Claude CodeCodexOpenClaw)承载你的构建过程每次编程会话里的决策、发现和踩过的坑。
45
+ - **Feishu (Lark)** holds your working relationships DMs, group chats, emails, meetings, tasks. This is *what* you work on and *who* you work with.
46
+ - **AI agents** (Claude Code, Codex, OpenClaw) hold your building process the decisions, discoveries, and dead-ends from every coding session.
31
47
 
32
- 但每次打开新的 Agent 会话,它都一无所知。你得重新解释你是谁、项目是什么、上周决定了什么、为什么。上下文明明*就在某处*埋在你再也不会翻的聊天记录和会话日志里。
48
+ But every time you open a new agent session, it knows nothing. You re-explain who you are, what the project is, what was decided last week, and why. The context is *somewhere* buried in chat logs and session transcripts you'll never scroll through again.
33
49
 
34
- **你不是记忆力差,你是信息碎片化而你的 Agent 每天都在为此买单。**
50
+ **You don't have a memory problem. You have a fragmentation problem and your agents pay for it every day.**
35
51
 
36
- ## 解决方案
52
+ ## The Solution
37
53
 
38
- Memoark 是一个**本地优先的个人记忆系统**,建立在两条同等重要的输入流之上 —— 你的**飞书工作**和你的 **AI Agent 会话**。它把两者提取成结构化信号(实体、决策、任务、发现、知识、关系),汇入你自己机器上一个统一、可搜索的知识图谱,再通过 **MCP** 把这份记忆喂回给任何 Agent。
54
+ Memoark is a **local-first personal memory system built for the Chinese workplace**. Work in China happens inside Feishu, DingTalk, and WeCom — Memoark pulls the DMs, group chats, emails, meetings, and docs out of these tools, together with your AI-agent sessions, and extracts them into structured signals (entities, decisions, tasks, discoveries, knowledge, relationships) — into one searchable knowledge graph on your own machine, then serves that memory back to any agent over **MCP**.
39
55
 
40
- 结果是:你的 Agent 既**写入**又**读取**同一份记忆 —— Claude Code、Codex 以及任何 MCP 客户端,终于*懂你和你的工作*。
56
+ > The MVP focuses on full **Feishu** capture; **DingTalk, WeCom**, and more Chinese workplace tools are on the roadmap (below).
57
+
58
+ The result: your agents both **write to** and **read from** the same memory — so Claude Code, Codex, and any MCP client finally *know you and your work*.
41
59
 
42
60
  ```
43
- 飞书工作流 AI Agent 会话
44
- (私信 / 群聊 / 邮件 (Claude Code / Codex
45
- 会议 / 任务) / OpenClaw)
61
+ Feishu work AI-agent sessions
62
+ (DMs / groups / email (Claude Code / Codex
63
+ meetings / tasks) / OpenClaw)
46
64
  │ │
47
65
  └───────────────┬───────────────┘
48
- 采集 + 抽取(本地)
66
+ collect + extract (local)
49
67
  ┌──────────────────┐
50
- 你的核心记忆 实体 · 决策 · 任务
51
- (PGLite, 本地) 知识 · 时间线 · 图谱
68
+ Your core memory entities · decisions · tasks
69
+ (PGLite, local) knowledge · timeline · graph
52
70
  └────────┬─────────┘
53
71
  ▼ MCP
54
- 你的 Agent 懂你
72
+ Your agents know you
55
73
 
56
- └──── Agent 用得越多,记忆越懂你 ───┘
74
+ └──── the more agents work, the better it knows you ───┘
57
75
  ```
58
76
 
59
- > "我昨天在飞书和同事讨论了一个方案,今天在 Claude Code 里实现了一部分,下周还有个评审会。"
77
+ > "I discussed a proposal with a colleague on Feishu yesterday, implemented part of it in Claude Code today, and have a review meeting next week."
60
78
  >
61
- > Memoark 自动把这三件事串起来 —— 跨平台、跨时间 —— 并在你需要时把完整脉络交给 Agent。
79
+ > Memoark connects these three events automatically — across platforms, across time — and hands the whole thread to your agent on demand.
62
80
 
63
- ## 核心特性
81
+ ## Three Pillars
64
82
 
65
- **🛰️ 飞书全量采集**
66
- 你的工作在飞书里。Memoark 覆盖 **7 个源** —— 私信、群聊、邮件、日历、文档、任务、消息搜索 —— 把你的工作关系网变成结构化记忆。
83
+ **🔒 Local-first, truly private**
84
+ Your data never leaves your machine. PGLite embedded database stores everything, optional local embeddings via Ollama, zero cloud dependency. Dual-track privacy redaction (reversible / irreversible) scrubs sensitive data before it's written.
67
85
 
68
- **🤖 Agent 懂你(MCP)**
69
- Memoark 作为任何 MCP Agent 的记忆层 —— Claude Code、Cursor、Windsurf。**17 个内置工具**让 Agent 查询你的历史、读取实体页面、写回新知识。Agent 既是记忆的生产者,也是消费者。
86
+ **🕸️ An entity knowledge graph, not a pile of vector chunks**
87
+ Signals are anchored to entities (people, projects, tools) and linked in a directed graph. You get answers *with context* — who, why, and what it relates to — instead of isolated similar-text fragments.
70
88
 
71
- **🔒 私密 & 本地优先**
72
- 数据永远不离开你的机器。PGLite 嵌入式数据库,可选 Ollama 本地向量嵌入,无云依赖。
89
+ **🤖 MCP-native + Feishu capture**
90
+ **29 built-in MCP tools** let any agent both query and write back to your memory. Full Feishu capture (7 sources) turns your real work — requirements, proposals, team decisions — into a first-class data source, something neither pure RAG nor note apps can do.
73
91
 
74
- **🧠 AI 驱动信号提取**
75
- LLM 驱动的 Pipeline 从原始对话中提取 7 类结构化信号:实体、时间线、决策、任务、发现、知识、关系。
92
+ ## Features
76
93
 
77
- **🔍 混合语义搜索**
78
- 全文搜索(tsvector)+ 向量检索(pgvector),通过 RRF(Reciprocal Rank Fusion)融合排序。支持自然语言提问。
94
+ **🛰️ Full Feishu (Lark) Capture**
95
+ Your work lives in Feishu. Memoark collects across **7 sources** — DMs, group chats, email, calendar, docs, tasks, and message search — turning your working relationships into structured memory. Doc capture produces upgradable "summary cards" (DocSource v2).
79
96
 
80
- **🕸️ 知识图谱 + Web UI**
81
- 看见人、项目、决策之间的关联。内置 Web UI 提供 Dashboard、时间线、力导向知识图谱和搜索。
97
+ **🤖 Agents That Know You (MCP)**
98
+ Use Memoark as the memory layer for any MCP agent — Claude Code, Cursor, Claude Desktop, Windsurf. **29 built-in tools** let your agent query your history, read entity pages, and write new knowledge back. Agents are both producers and consumers of your memory.
82
99
 
83
- **🔌 REST API**
84
- 基于 Hono HTTP API,暴露所有存储操作。
100
+ **🧠 AI-Powered Signal Extraction**
101
+ An LLM pipeline extracts 7 types of structured signals from raw conversations: entities, timeline events, decisions, tasks, discoveries, knowledge, and relationships.
85
102
 
86
- ## 使用场景
103
+ **🔍 Hybrid Semantic Search**
104
+ Full-text search (tsvector, multilingual) + vector retrieval fused with Reciprocal Rank Fusion (RRF). Ask in natural language — powered by PGLite FTS + pgvector.
87
105
 
88
- **几秒钟让 Agent 接手一个项目**
89
- 打开 Claude Code 会话,问一句 *"memoark 这个项目现在进展如何?"* —— Agent 直接从你的记忆里拉出聚合的决策、待办任务和最近时间线,无需你重新解释。
106
+ **♻️ Memory Consolidation (Dream Cycle)**
107
+ A background consolidator automatically runs tier rotation (hot → warm → cold), repairs dead links, and infers preferences — so your memory organizes itself over time.
90
108
 
91
- **回忆某人、某件事**
92
- *"我上周和同事聊了什么?"* —— Memoark 把飞书私信、会议、后续任务串成一个答案。
109
+ **⏰ Resident Daemon + Scheduled Capture**
110
+ A built-in daemon collects from your sources on a schedule, with run history and alerts, keeping your memory continuously fresh.
93
111
 
94
- **自动生成的工作日志**
95
- 像翻日记一样浏览你的时间线 —— 你做了什么决策、交付了什么、跨了哪些平台,全部自动写好。
112
+ **🔗 Obsidian Bidirectional Sync**
113
+ Export your memory pages to an Obsidian vault (Markdown), edit them, and import them back.
96
114
 
97
- ## 为什么选 Memoark
115
+ **🕸️ Knowledge Graph + Web UI**
116
+ See the connections between people, projects, and decisions. Browse a built-in web UI with dashboard, timeline, force-directed graph, and search.
98
117
 
99
- | | Memoark | 纯 RAG / 向量检索 | 笔记工具(Obsidian / Notion) | GBrain | OpenHuman |
118
+ **🔌 REST API**
119
+ Full Hono-powered HTTP API for all store operations. Integrate with any client.
120
+
121
+ ## Works With
122
+
123
+ Memoark is a standard MCP stdio server and plugs into any MCP client:
124
+
125
+ **Claude Code** · **Cursor** · **Claude Desktop** · **Windsurf** · and any MCP-compatible agent.
126
+
127
+ ## Feature Inventory
128
+
129
+ The full capability list (✅ = shipped and included in the package).
130
+
131
+ ### 📥 Data Collection
132
+ - ✅ Feishu group chats (OpenAPI chat/message)
133
+ - ✅ Feishu DMs / recent chats (lark-cli `message_search`, user mode)
134
+ - ✅ Feishu email
135
+ - ✅ Feishu calendar events
136
+ - ✅ Feishu tasks
137
+ - ✅ Feishu doc summary cards (DocSource v2: pointer card → upgraded full card on trigger)
138
+ - ✅ Claude Code sessions (`~/.claude/projects/`)
139
+ - ✅ Codex CLI sessions (`~/.codex/`)
140
+ - ✅ OpenClaw Hermes multi-agent sessions (`~/.openclaw/agents/`, auto sub-agent discovery)
141
+ - ✅ Incremental collection: per-source cursor + content-hash dedup
142
+ - ✅ Historical backfill: coverage stats, start / cancel / reset
143
+
144
+ ### 🧠 Signal Extraction Pipeline
145
+ - ✅ Collect → Dedup → Block Builder → Noise Filter → Signal Extractor → Privacy
146
+ - ✅ Two-layer noise filtering: L1 rules + L2 LLM scoring
147
+ - ✅ 7 structured signal types: entities, timeline, decisions, tasks, discoveries, knowledge, relationships
148
+ - ✅ LLM providers: OpenAI / Anthropic (plus a mock for testing)
149
+ - ✅ Signal scoring and entity extraction
150
+ - ✅ JSON / Markdown output formats
151
+ - ✅ Output adapters: store (PGLite) / file / gbrain / stdout
152
+ - ✅ Provenance: every signal traces back to its source message
153
+
154
+ ### 🔒 Privacy & Security
155
+ - ✅ Redaction before write; data stays fully local
156
+ - ✅ Dual-track modes: reversible / irreversible
157
+ - ✅ Built-in redaction: phone, ID card, bank card, with custom replacement token
158
+ - ✅ API keys always masked in the config center
159
+
160
+ ### 🗄️ Storage & Retrieval
161
+ - ✅ PGLite embedded PostgreSQL (in-process, zero external deps)
162
+ - ✅ pgvector vector search
163
+ - ✅ tsvector full-text search (simple tokenizer, multilingual)
164
+ - ✅ RRF hybrid search (FTS + vector fusion) with compiled_truth / backlink boosts
165
+ - ✅ Recursive chunking (300 words / 50-word overlap), embedding reuse + stale detection
166
+ - ✅ Embeddings: OpenAI / Ollama (local)
167
+
168
+ ### 🕸️ Knowledge Graph
169
+ - ✅ Directed link graph with link types and context
170
+ - ✅ BFS traversal (controllable depth / direction)
171
+ - ✅ Backlinks
172
+ - ✅ Entity anchoring: signals attach to people / projects / tools
173
+ - ✅ Entity profile aggregation (signals + timeline)
174
+
175
+ ### 👤 Person Identity
176
+ - ✅ Identity resolution and canonicalization
177
+ - ✅ Alias / handle linking (Feishu open_id, email, name, nickname, slug)
178
+ - ✅ Strong / weak link strength
179
+ - ✅ Person merge (re-points links / timeline / tags / aliases)
180
+ - ✅ Recanonicalize slug (fix a wrong canonicalization)
181
+
182
+ ### ♻️ Memory Lifecycle & Daemon
183
+ - ✅ Memory consolidation (dream cycle): hot → warm → cold tier rotation
184
+ - ✅ Dead-link repair
185
+ - ✅ Preference inference (learns preferences from history)
186
+ - ✅ Resident daemon: scheduled per-source capture, scheduling, run history, alerts
187
+
188
+ ### 🔗 Sync & Interop
189
+ - ✅ Obsidian bidirectional sync (export vault / import back)
190
+ - ✅ MCP stdio server (29 tools)
191
+ - ✅ REST API (Hono — pages / search / graph / tags / timeline / embed / extract / provenance / event stream)
192
+
193
+ ### 🖥️ Web UI (React + Vite)
194
+ - ✅ Dashboard overview
195
+ - ✅ Timeline view (feed)
196
+ - ✅ Force-directed knowledge graph
197
+ - ✅ Search interface
198
+ - ✅ Entity / page detail
199
+ - ✅ In-browser config editing + guided setup wizard
200
+
201
+ ### ⚙️ Configuration & Onboarding
202
+ - ✅ Interactive config center (full-screen TUI, React + ink)
203
+ - ✅ Linear Q&A wizard fallback (`--no-tui`) / fully automatic (`--auto`)
204
+ - ✅ Auto-detection: runtime, API keys, existing data sources
205
+ - ✅ Hardware assessment → recommends local / remote embeddings
206
+ - ✅ Live connection checks (LLM / embedding API key and connectivity)
207
+ - ✅ `memoark doctor` environment diagnostics
208
+
209
+ ## Use Cases
210
+
211
+ > Memoark answers not "what do I know" but "**what should I do**" — every scenario returns a cited, traceable action, not a pile of chunks.
212
+
213
+ **🌟 Know how to talk to someone before you meet them (Hero)**
214
+ *"I'm meeting Director Zhang tomorrow to negotiate a renewal price increase — what should I keep in mind?"* — `prep_for_person` **passively infers** a communication profile from your real interactions (direct vs. indirect, data-driven vs. relationship-driven, landmines), tailors advice to this goal, and flags gaps (*"nothing new about Zhang in 18 days — the profile may be stale"*). Zero questionnaire; the profile never leaves your machine.
215
+
216
+ **📋 Generate a cross-channel daily report in one line**
217
+ *"Help me write today's daily report"* — `daily_report` aggregates today's signals scattered across DMs, group chats, email, Feishu Minutes notes, and calendar into 7 sections: decisions / in-progress / my tasks / awaiting-reply·@mentions / relationship updates / tomorrow's reminders. Action items in meeting notes that name you land in "my tasks" automatically.
218
+
219
+ **🔧 Troubleshoot by the playbook**
220
+ *"Why won't the ADAS engage?"* — `troubleshoot` walks the playbook's diagnostic chain (`precedes`) to give ordered steps and explain what each result means. Playbooks can be authored by hand or auto-extracted (as drafts) from your troubleshooting conversations.
221
+
222
+ **⚡ Onboard your agent to a project in seconds**
223
+ *"What's the current state of the memoark project?"* — `get_session_context` pulls the aggregated decisions, open tasks, and recent timeline straight from memory, no re-explaining.
224
+
225
+ **🔎 Recall a person or a thread**
226
+ *"What did I discuss with this colleague last week?"* — stitches Feishu DMs, the meeting, and the follow-up task into one cited answer.
227
+
228
+ ## Why Memoark
229
+
230
+ | | Memoark | Pure RAG / vector search | Note apps (Obsidian / Notion) | GBrain | OpenHuman |
100
231
  |---|:---:|:---:|:---:|:---:|:---:|
101
- | 本地优先 & 私密 | ✅ | 视情况 | 视情况 | ✅ | ✅ |
102
- | 开源 | ✅ | 不一定 | 部分 | 部分 | ✅ |
103
- | 飞书工作采集(私信/群聊/邮件/会议/任务) | ✅ | ❌ | 手动 | ❌ | ❌ |
104
- | AI Agent 会话作为数据源 | ✅ | ❌ | ❌ | ✅ | ✅ |
105
- | Agent 原生:通过 MCP 既读**又**写 | ✅ | ❌ | ❌ | ✅ | 部分 |
106
- | 实体 + 关系知识图谱 | ✅ | ❌ | 手动 | ✅ | 部分 |
107
- | 结构化信号提取(不只是分块) | ✅ | ❌ | ❌ | ✅ | ✅ |
108
- | 精简的 MCP 工具面(17 个,而非 40+) | ✅ | 不适用 | 不适用 | ❌(40+) | 不一定 |
232
+ | Local-first & private | ✅ | depends | depends | ✅ | ✅ |
233
+ | Open source | ✅ | varies | partial | partial | ✅ |
234
+ | Feishu work capture (DM/group/email/meeting/task) | ✅ | ❌ | manual | ❌ | ❌ |
235
+ | AI-agent sessions as a source | ✅ | ❌ | ❌ | ✅ | ✅ |
236
+ | Agent-native: read **and** write over MCP | ✅ | ❌ | ❌ | ✅ | partial |
237
+ | Entity + relationship knowledge graph | ✅ | ❌ | manual | ✅ | partial |
238
+ | Structured signal extraction (not just chunks) | ✅ | ❌ | ❌ | ✅ | ✅ |
239
+ | Memory consolidation + scheduled-capture daemon | ✅ | | | partial | partial |
240
+
241
+ > Pure RAG gives you vectors but no entities or relationships, so answers lack context. Note apps are powerful but rely on manual upkeep. Memoark keeps it local and agent-native — with Feishu work as a first-class source.
242
+
243
+ ## Quick Start
244
+
245
+ ### Prerequisites
246
+
247
+ - [Node.js](https://nodejs.org) >= 18 (for the `npx` / `npm` install)
248
+ - (Optional) [Ollama](https://ollama.ai) for local embeddings
249
+
250
+ ### One-step launch (recommended)
251
+
252
+ ```bash
253
+ # Run without installing — no config? it auto-launches the setup wizard,
254
+ # then starts the server and opens your browser
255
+ npx @andre.li/memoark start
256
+
257
+ # Running with no subcommand is equivalent to `start`
258
+ npx @andre.li/memoark
259
+ ```
109
260
 
110
- > RAG 只有向量、没有实体和关系,回答缺乏上下文;笔记工具强大但依赖手动维护;GBrain 能力强但偏重、MCP 工具过多。Memoark 保持本地、精简、Agent 原生 —— 并把飞书工作作为一等数据源。
261
+ `memoark start` is the single-step path: if there's no `memoark.yaml`, it opens the browser setup wizard first, then starts the HTTP server and auto-opens your browser.
111
262
 
112
- ## 快速开始
263
+ > The npm package is `@andre.li/memoark` (scoped), but the command is still `memoark`.
113
264
 
114
- ### 前置条件
265
+ ### Ports at a glance
115
266
 
116
- - [Node.js](https://nodejs.org) >= 18(用 `npx` / `npm` 安装时)
117
- - (可选)[Ollama](https://ollama.ai) 本地嵌入
267
+ | Service | Default port | Address |
268
+ |---------|--------------|---------|
269
+ | HTTP API + Web UI | `3927` | `http://localhost:3927` |
270
+ | MCP Streamable HTTP (`--mcp-http`) | `3928` | `http://localhost:3928/mcp` |
118
271
 
119
- ### 安装(推荐:npm
272
+ ### Install (recommended: npm)
120
273
 
121
274
  ```bash
122
- # 免安装直接运行
275
+ # Run without installing
123
276
  npx @andre.li/memoark --help
124
277
 
125
- # 或全局安装,得到 memoark 命令
278
+ # Or install globally to get the `memoark` command
126
279
  npm install -g @andre.li/memoark
127
280
  ```
128
281
 
129
- > npm 包名为 `@andre.li/memoark`(作用域包),但命令名仍是 `memoark`。
130
-
131
- ### 从源码安装(开发)
282
+ ### Install from source (development)
132
283
 
133
284
  ```bash
134
285
  git clone https://github.com/AndreLYL/memoark.git
135
286
  cd memoark
136
287
  bun install
137
- npm link # 注册 memoark 全局命令
288
+ npm link # registers the `memoark` command globally
138
289
  ```
139
290
 
140
- ### 初始化配置
291
+ ### Initialize Configuration
141
292
 
142
- `memoark init` 启动一个**交互式配置中心**(基于 React + ink 的全屏 TUI),让你零手写地生成 / 编辑 `memoark.yaml`:
293
+ `memoark init` launches an **interactive configuration center** — a full-screen TUI (built with React + ink) that lets you generate and edit `memoark.yaml` without hand-writing YAML:
143
294
 
144
295
  ```bash
145
296
  memoark init
146
297
  ```
147
298
 
148
- **配置中心特性:**
149
- - 📋 **分区编辑**:OverviewLLMEmbedding、数据源、隐私、分块(Block Builder)等分区
150
- - ⌨️ **键盘操作**:↑/↓ Tab 切换字段,Enter 编辑,Ctrl+S 保存,q / Esc 退出(有改动会自动保存)
151
- - 🔌 **实时连接测试**:编辑 LLM / Embedding 时自动校验 API key 与连通性
152
- - 💡 **智能推荐**:根据本机硬件推荐本地(Ollama)或远程(OpenAI)Embedding
153
- - 🔒 **密钥脱敏**:API key 始终掩码显示
154
- - 🧭 **自动检测**:识别已有数据源(Claude CodeCodexHermes)并注册 `memoark` 命令
299
+ **Config center features:**
300
+ - 📋 **Sectioned editing**: Overview, LLM, Embedding, Sources, Privacy, Block Builder, and more
301
+ - ⌨️ **Keyboard-driven**: ↑/↓ or Tab to move between fields, Enter to edit, Ctrl+S to save, q / Esc to quit (auto-saves if dirty)
302
+ - 🔌 **Live connection checks**: validates your LLM / embedding API key and connectivity as you edit
303
+ - 💡 **Smart recommendations**: suggests local (Ollama) vs remote (OpenAI) embedding based on your hardware
304
+ - 🔒 **Secret masking**: API keys are always shown masked
305
+ - 🧭 **Auto-detection**: finds existing data sources (Claude Code, Codex, Hermes) and registers the `memoark` command
155
306
 
156
- **运行模式:**
307
+ **Run modes:**
157
308
 
158
- | 命令 / 环境 | 行为 |
309
+ | Command / environment | Behavior |
159
310
  |---|---|
160
- | `memoark init`(TTY 终端下) | 全屏 TUI 配置中心 |
161
- | `memoark init --no-tui` | 逐项问答式向导(线性 fallback |
162
- | `memoark init --auto` | 全自动,无提示,用检测到的默认值生成 |
163
- | `memoark init --force` | 覆盖已有配置 |
164
- | `MEMOARK_NO_TUI=1` | 强制禁用 TUI(非 TTY 环境也会自动 fallback) |
311
+ | `memoark init` (in a TTY) | Full-screen TUI config center |
312
+ | `memoark init --no-tui` | Linear question-and-answer wizard (fallback) |
313
+ | `memoark init --auto` | Fully automatic, no prompts, uses detected defaults |
314
+ | `memoark init --force` | Overwrite an existing configuration |
315
+ | `MEMOARK_NO_TUI=1` | Force-disable the TUI (also auto-falls back in non-TTY environments) |
165
316
 
166
- > `memoark config init` `memoark init` 等价。飞书等少数高级配置目前需直接编辑 `memoark.yaml`(见下方飞书章节)。
317
+ > `memoark config init` is equivalent to `memoark init`. A few advanced settings (e.g. Feishu) currently need to be edited directly in `memoark.yaml` (see [Configuration](#configuration)).
167
318
 
168
- ### 检查环境
319
+ ### Check Environment
169
320
 
170
321
  ```bash
171
322
  memoark doctor
172
323
  ```
173
324
 
174
- ### 运行提取
325
+ ### Run Your First Extraction
175
326
 
176
327
  ```bash
177
- # Claude Code 提取
178
- memoark extract --source claude-code
328
+ # Extract from Feishu (your work source)
329
+ memoark extract --source feishu --since 3d
179
330
 
180
- # Codex 提取
181
- memoark extract --source codex
331
+ # Extract from Claude Code
332
+ memoark extract --source claude-code
182
333
 
183
- # 从所有启用的数据源提取
334
+ # Extract from all enabled sources
184
335
  memoark extract --source all
185
336
 
186
- # 干跑模式(不调用 LLM,仅扫描数据量)
337
+ # Dry run (no LLM calls, just scan data volume)
187
338
  memoark extract --source claude-code --dry-run
188
339
  ```
189
340
 
190
- ### 飞书私聊/群聊提取
191
-
192
- 飞书消息有两条不同路径:
341
+ > Feishu requires a one-time `lark-cli` user login and a `feishu` block in `memoark.yaml`. See [Configuration](#configuration) for the full Feishu setup, including DM vs. group capture paths.
193
342
 
194
- - `sources.feishu.sources.messages` 使用 OpenAPI chat/message 接口,适合明确群聊 `chat_id` 或自动发现到的群聊。
195
- - `sources.feishu.sources.message_search` 使用 `lark-cli im +messages-search`,适合 user-mode 下搜索最近私聊和群聊。私聊机器人对话通常需要这条路径,否则最近三天会明显少数据。
343
+ ### Search Your Memory
196
344
 
197
- 本地需要先完成 lark-cli 的飞书用户态登录,并在 `memoark.yaml` 打开 `message_search`:
198
-
199
- ```yaml
200
- llm:
201
- provider: openai
202
- model: gpt-4.1-mini
203
- api_key: ${TOKENFREE_API_KEY}
345
+ ```bash
346
+ # Hybrid search (FTS + vector)
347
+ memoark search "auth middleware decision"
204
348
 
205
- sources:
206
- feishu:
207
- enabled: true
208
- auth_mode: user
209
- app_id: ${FEISHU_APP_ID}
210
- app_secret: ${FEISHU_APP_SECRET}
211
- sources:
212
- messages:
213
- enabled: true
214
- chat_ids: []
215
- lookback_days: 3
216
- message_search:
217
- enabled: true
218
- chat_types:
219
- - p2p
220
- # - group
221
- lookback_days: 3
222
- page_size: 50
349
+ # FTS-only search
350
+ memoark search "JWT token" --mode fts
223
351
  ```
224
352
 
225
- 然后运行:
353
+ ### Start the Server
226
354
 
227
355
  ```bash
228
- bun src/cli.ts extract --source feishu --adapter store --since 3d
229
- ```
356
+ # HTTP API + Web UI (default http://localhost:3927) — auto-opens your browser
357
+ memoark serve
230
358
 
231
- `--dry-run` 只验证采集数量,不写数据库、不提交 cursor:
359
+ # Skip the auto-open (e.g. on a remote/headless host)
360
+ memoark serve --no-open
232
361
 
233
- ```bash
234
- bun src/cli.ts extract --source feishu --adapter store --since 3d --dry-run
235
- ```
362
+ # MCP stdio (local direct connect for AI agents — Claude Code, Cursor, etc.; no browser)
363
+ memoark serve --mcp
236
364
 
237
- ### 增量状态与重建
365
+ # MCP Streamable HTTP (remote / multi-client, default http://localhost:3928/mcp; no browser)
366
+ memoark serve --mcp-http
367
+ ```
238
368
 
239
- Memoark 的增量状态分两层:
369
+ > Without a `memoark.yaml`, `serve` tells you to run `memoark start` for one-step setup + launch, or `memoark init --web` to configure first.
240
370
 
241
- - 数据库:默认在 `~/.memoark/data`,保存提取后的页面、chunk、关系和时间线。
242
- - 运行状态:当前仓库的 `.memoark/cursors.yaml` 和 `.memoark/dedup.jsonl`,分别保存源 cursor 和消息去重 hash。
371
+ ### Connect Your Agent (MCP)
243
372
 
244
- 正常增量运行不要手动删这些文件。需要删除某个源的过期提取结果并重跑时,用内置命令,它会先备份数据库和 `.memoark`:
373
+ **One command (recommended)**: `memoark install` writes the MCP config plus a tiny memory directive into your AI client (**global by default**, across all projects). Supports **Claude Code · Claude Desktop · Cursor · Codex · Windsurf**:
245
374
 
246
375
  ```bash
247
- # 先预览会删除多少内容
248
- bun src/cli.ts store purge-source feishu
249
-
250
- # 确认后清理飞书结果、飞书 cursor,并重置旧格式 dedup
251
- bun src/cli.ts store purge-source feishu --yes
252
-
253
- # 再跑最近三天
254
- bun src/cli.ts extract --source feishu --adapter store --since 3d
376
+ memoark install # detect installed clients and wire them up
377
+ memoark install --agent claude-code # target a single client
378
+ memoark install --dry-run # preview file changes, write nothing
379
+ memoark uninstall # clean removal (idempotent)
255
380
  ```
256
381
 
257
- 旧版 `dedup.jsonl` 只记录 hash,没有记录来源平台,所以彻底重跑飞书时默认会备份后清空整个 dedup。后续增量会重新建立去重状态。
382
+ Reopen the client and you're set — ask "what did X tell me last week?" or "where is this project at?" and the agent will **proactively query Memoark** per the injected directive (cheap-first: `search` keyword lookup at zero cost, escalating to `query`/`recall` only if thin) instead of guessing.
258
383
 
259
- ### 搜索记忆
384
+ > Claude Desktop has no rules file, so it relies on the MCP server's `instructions` field. You can also configure things manually below.
260
385
 
261
- ```bash
262
- # 混合搜索(全文 + 向量)
263
- memoark search "认证中间件决策"
386
+ **Automatic recall on Claude Code (optional · hooks)**: go further on Claude Code so memory arrives with zero effort:
264
387
 
265
- # 仅全文搜索
266
- memoark search "JWT token" --mode fts
388
+ ```bash
389
+ memoark hooks install # SessionStart + UserPromptSubmit read hooks (on by default)
390
+ memoark hooks install --write-back # also enable end-of-session auto write-back (opt-in)
391
+ memoark hooks uninstall # remove
267
392
  ```
268
393
 
269
- ### 启动服务器
394
+ - **SessionStart**: injects an "active projects / decisions / open tasks / key people" digest at the start of each session (the always-on core).
395
+ - **UserPromptSubmit**: a **zero-cost FTS** probe before each prompt; injects only on a hit (≤3 items, ≤3000 chars, appended after the user message to preserve prompt cache).
396
+ - **SessionEnd** (`--write-back`, off by default): asynchronous incremental extraction back into memory, so it compounds.
270
397
 
271
- ```bash
272
- # HTTP API(默认端口 3927)
273
- memoark serve
398
+ > Read hooks default on (local, cheap); write-back is explicit `--write-back` (cost + privacy, opt-in). Other clients have no lifecycle hooks and rely on the instruction layer above for model-initiated recall.
274
399
 
275
- # MCP stdio(AI Agent 集成 Claude Code、Cursor 等)
276
- memoark serve --mcp
277
- ```
400
+ **Let the agent install itself**: for agents that can read a URL, just say "onboard me to Memoark following [`MEMOARK_FOR_AGENTS.md`](MEMOARK_FOR_AGENTS.md)" and it runs the commands above and self-checks. For **OpenClaw / Hermes**, use `memoark install --agent hermes` (writes `mcp_servers` into `config.yaml` + drops the `memoark` skill; run `/reload-mcp` in-session to apply); or scaffold the skill alone with `memoark skill scaffold --dir ~/.hermes/skills`.
278
401
 
279
- ### 接入你的 Agent(MCP
402
+ Memoark offers two MCP transports — pick by scenario:
280
403
 
281
- 让任何 MCP 客户端指向 Memoark,即可读写你的记忆。以 Claude Code 为例:
404
+ - **stdio (`--mcp`)** local direct connect; the agent spawns `memoark` as a subprocess. Zero network setup; best for a single client on one machine.
405
+ - **Streamable HTTP (`--mcp-http`)** — over HTTP (default `3928`); use it for remote access or sharing one memory across multiple clients.
406
+
407
+ Point any MCP client at Memoark so it can read and write your memory. For Claude Code (stdio, local direct connect):
282
408
 
283
409
  ```json
284
410
  {
@@ -291,156 +417,337 @@ memoark serve --mcp
291
417
  }
292
418
  ```
293
419
 
294
- 然后就可以让 Agent *"在我的记忆里搜一下 auth 重构的决策"* *"项目 X 还有哪些未完成任务?"* —— 它会从你的本地记忆作答。
420
+ Then ask your agent things like *"search my memory for the auth refactor decision"* or *"what tasks are still open on project X?"* it answers from your local memory.
295
421
 
296
- ### 浏览 Web UI
422
+ ### Browse the Web UI
297
423
 
298
424
  ```bash
299
425
  cd web
300
426
  bun install
301
- bun run dev # Dashboard、时间线、知识图谱、搜索
302
- ```
303
-
304
- ## 架构
305
-
306
- ```
307
- ┌─────────────────────────────────────────────────────────────────┐
308
- │ 数据源 │
309
- │ Claude Code │ Codex │ Hermes │ 飞书 │ 微信 │
310
- └───────┬───────┴────┬────┴────┬─────┴────┬───┴────┬──────────────┘
311
- └────────────┴────────┴──────────┴────────┘
312
-
313
- ┌─────────▼──────────┐
314
- │ 信号提取 Pipeline │
315
- │ │
316
- │ 采集 → 去重 │
317
- │ → 分块 → 噪声过滤 │
318
- │ → 信号提取 → 脱敏 │
319
- └─────────┬──────────┘
320
-
321
- ┌─────────▼──────────┐
322
- │ 存储层 │
323
- │ │
324
- │ PGLite + pgvector │
325
- │ (嵌入式 PG) │
326
- └─────────┬──────────┘
327
-
328
- ┌───────────────┼───────────────┐
329
- │ │ │
330
- ┌────────▼──────┐ ┌─────▼──────┐ ┌──────▼───────┐
331
- │ CLI │ │ MCP │ │ REST API │
332
- │ 管理 & 提取 │ │ 服务器 │ │ (Hono) │
333
- └────────────────┘ └────────────┘ └──────────────┘
427
+ bun run dev # dashboard, timeline, knowledge graph, search
334
428
  ```
335
429
 
336
- ### 信号类型
430
+ ## Architecture
337
431
 
338
- | 信号类型 | 说明 | 示例 |
339
- |---------|------|------|
340
- | **实体** | 人物、项目、工具、概念 | `project/memoark`, `tool/claude-code` |
341
- | **时间线** | 关键事件及时间戳 | "2026-05-19: 完成多平台采集器重构" |
342
- | **决策** | 架构选型、技术决策及其理由 | "选择 PGLite 作为嵌入式 PostgreSQL 方案" |
343
- | **任务** | 待办事项及状态追踪 | `[open] 实现 token 自动刷新` |
344
- | **发现** | 技术洞察、bug 根因、edge case | "UUID v4 不可按字典序排序" |
345
- | **知识** | 可复用的事实性知识 | "PGLite 通过 WASM 在进程内运行完整 Postgres" |
346
- | **关系** | 实体间的依赖、引用、协作 | `project/memoark --[depends_on]--> tool/pglite` |
432
+ Memoark is **5 vertical data-flow layers + 3 cross-cutting concerns**. Data flows top-down: sources are collected, extracted into signals, stored as local memory, then read/written through the bottom interfaces. **Person identity**, **consolidation**, and **scheduling** cut across the stack.
347
433
 
348
- ### 存储层
434
+ <p align="center">
435
+ <img src="https://raw.githubusercontent.com/AndreLYL/memoark/main/docs/assets/architecture.png" alt="Memoark architecture — 5 vertical layers + 3 cross-cutting concerns" width="920">
436
+ </p>
349
437
 
350
- | 组件 | 说明 |
351
- |------|------|
352
- | **PageStore** | Wiki 风格页面,YAML frontmatter,CRUD |
353
- | **ChunkStore** | 递归文本分块(300 词,50 词重叠),嵌入复用 |
354
- | **SearchEngine** | tsvector 全文搜索 + pgvector 向量搜索,RRF 融合排序 |
355
- | **GraphStore** | 有向链接图,BFS 遍历,链接类型过滤,反向链接 |
356
- | **TagStore** | 页面标签,冲突安全 upsert |
357
- | **TimelineStore** | 按时间排序的条目,去重 |
358
- | **EmbeddingService** | OpenAI / Ollama 批量嵌入,过期 chunk 检测 |
438
+ <details>
439
+ <summary>📐 View the editable Mermaid source</summary>
440
+
441
+ ```mermaid
442
+ flowchart TB
443
+ subgraph L1["① Config & Onboarding"]
444
+ cfg["TUI config center · Web UI config · memoark.yaml<br/>auto-detect · hardware assessment · connection checks"]
445
+ end
446
+ subgraph L2["② Collection"]
447
+ feishu["Feishu: DMs · groups · email · calendar · tasks · message search · docs"]
448
+ agent["AI-agent sessions: Claude Code · Codex · Hermes"]
449
+ inc["Incremental (cursor + dedup) · historical Backfill"]
450
+ planned1["Planned: DingTalk · WeCom · local documents"]:::planned
451
+ end
452
+ subgraph L3["③ Extraction Pipeline"]
453
+ pipe["Block Builder → Noise Filter (rules+LLM) → Signal Extractor (OpenAI/Anthropic)<br/>→ entity extraction → scoring → privacy redaction → 7 signal types"]
454
+ end
455
+ subgraph L4["④ Memory Store"]
456
+ store["PGLite + pgvector<br/>Page · Chunk · Tag · Timeline · Graph<br/>hybrid search (FTS + vector + RRF)"]
457
+ end
458
+ subgraph L5["⑤ Interfaces & Consumption"]
459
+ cli["CLI"]
460
+ mcp["MCP (29 tools)"]
461
+ rest["REST API"]
462
+ web["Web UI (read-only)"]
463
+ obs["Obsidian bidirectional sync"]
464
+ end
465
+
466
+ L1 --> L2 --> L3 --> L4 --> L5
467
+
468
+ subgraph X["Cross-cutting concerns"]
469
+ id["🧬 Person Identity<br/>merge same person across platforms"]
470
+ cons["♻️ Consolidation / Dream Cycle<br/>tier rotation · dead-link repair · preference inference"]
471
+ sched["⏰ Scheduling / AutoFetch<br/>scheduled capture · run history · alerts"]
472
+ end
473
+
474
+ id -.-> L2
475
+ id -.-> L4
476
+ cons -.-> L4
477
+ sched -.-> L2
478
+
479
+ classDef planned stroke-dasharray: 5 5,fill:#f6f6f6,color:#888;
480
+ ```
359
481
 
360
- ## CLI 命令
482
+ </details>
483
+
484
+ ### Layer Breakdown
485
+
486
+ | Layer | Responsibility |
487
+ |-------|----------------|
488
+ | **① Config & Onboarding** | TUI config center (React + ink), Web UI config, hand-edited `memoark.yaml`; auto-detect runtime / API keys / sources, hardware-aware embedding recommendation, live connection checks |
489
+ | **② Collection** | Feishu (DMs / groups / email / calendar / tasks / message search / docs), AI-agent sessions (Claude Code / Codex / Hermes); incremental capture (per-source cursor + content dedup), historical Backfill. **Planned**: DingTalk, WeCom, local documents |
490
+ | **③ Extraction Pipeline** | Block Builder → Noise Filter (L1 rules + L2 LLM) → Signal Extractor (OpenAI / Anthropic) → entity extraction → scoring → privacy redaction; emits 7 signal types via output adapters (store / file / gbrain / stdout) |
491
+ | **④ Memory Store** | PGLite (in-process embedded PostgreSQL) + pgvector; Page / Chunk / Tag / Timeline / Graph stores; hybrid search (tsvector FTS + vector + RRF) |
492
+ | **⑤ Interfaces & Consumption** | CLI, MCP Server (29 tools — agent read / write / maintain), REST API (Hono), Web UI (search / view / graph / timeline, **read-only today**), Obsidian bidirectional sync |
493
+
494
+ **Cross-cutting concerns (span layers, not standalone pipeline stages):**
495
+
496
+ - **🧬 Person Identity** — spans Collection ↔ Store: recognize and merge the same person across platforms (Feishu open_id, email, nickname), alias linking, canonicalization. The foundation of "the sum of your social relations".
497
+ - **♻️ Consolidation (Dream Cycle)** — background pass over the store: hot → warm → cold rotation, dead-link repair, preference inference.
498
+ - **⏰ Scheduling / AutoFetch** — background driver of Collection: scheduled capture, run history, alerts. *(Runs inside `serve` today; standalone daemon + autostart is on the roadmap.)*
499
+
500
+ > Runs on macOS / Linux / Windows · one-command install (npm / npx) · local-first, self-hosted, zero cloud dependency.
501
+
502
+ ### Signal Extraction Pipeline
503
+
504
+ | Stage | Description |
505
+ |-------|-------------|
506
+ | **Collector** | Fetches raw messages from configured data sources |
507
+ | **Dedup** | Eliminates duplicates via content hashing |
508
+ | **Block Builder** | Groups messages into conversation blocks by time and topic |
509
+ | **Noise Filter** | Scores block significance using rules (L1) + LLM (L2) |
510
+ | **Signal Extractor** | LLM-powered extraction of entities, decisions, tasks, discoveries, knowledge, timeline, links |
511
+ | **Privacy Processor** | Dual-track redaction — reversible or irreversible |
512
+
513
+ ### Extracted Signal Types
514
+
515
+ | Signal | Description | Example |
516
+ |--------|-------------|---------|
517
+ | **Entities** | People, projects, tools, concepts | `project/memoark`, `tool/claude-code` |
518
+ | **Timeline** | Key events with timestamps | "2026-05-19: Completed multi-platform collector refactoring" |
519
+ | **Decisions** | Technical choices with reasoning | "Chose PGLite for embedded PostgreSQL with vector support" |
520
+ | **Tasks** | Action items with status | `[open] Implement token auto-refresh` |
521
+ | **Discoveries** | Insights, root causes, edge cases | "UUID v4 is not lexicographically sortable" |
522
+ | **Knowledge** | Reusable facts with provenance | "PGLite runs full Postgres in-process via WASM" |
523
+ | **Links** | Relationships between entities | `project/memoark --[depends_on]--> tool/pglite` |
524
+
525
+ ### Storage Layer
526
+
527
+ | Component | Description |
528
+ |-----------|-------------|
529
+ | **PageStore** | CRUD for wiki-style pages with YAML frontmatter |
530
+ | **ChunkStore** | Recursive text chunking (300 words, 50-word overlap) with embedding reuse |
531
+ | **SearchEngine** | FTS via `tsvector` + vector cosine via `pgvector`, fused with RRF scoring |
532
+ | **GraphStore** | Directed link graph with BFS traversal, link types, backlinks |
533
+ | **TagStore** | Page tagging with conflict-safe upserts |
534
+ | **TimelineStore** | Chronological entries per page with dedup |
535
+ | **EmbeddingService** | Batch embedding via OpenAI or Ollama, stale-chunk detection |
536
+
537
+ ## MCP Tools
538
+
539
+ Memoark's MCP server exposes **29 tools** spanning retrieval, synthesis, page CRUD, graph, tags, timeline, identity, and Feishu doc ingestion. Prefer the high-level tools first:
540
+
541
+ | Category | Tools |
542
+ |----------|-------|
543
+ | **Retrieval (high-level)** | `query`, `get_session_context`, `get_entity_profile`, `list_signals_by_entity` |
544
+ | **Synthesis** | `synthesize`, `recall` (cited, gap-aware composed answers with inline `[n]`), `prep_for_person` (person communication profile → goal-conditioned strategy; passively inferred, no questionnaire, local-first, ethics-guardrailed), `daily_report` (cross-channel 7-section daily report), `troubleshoot` (one-shot diagnosis along a playbook chain) |
545
+ | **Search** | `search` |
546
+ | **Pages / content** | `get_page`, `put_page`, `list_pages`, `get_chunks` |
547
+ | **Graph** | `add_link`, `remove_link`, `get_links`, `get_backlinks`, `traverse_graph` |
548
+ | **Tags** | `add_tag`, `remove_tag`, `get_tags` |
549
+ | **Timeline** | `add_timeline_entry`, `get_timeline` |
550
+ | **Identity (people)** | `link_person_alias`, `list_person_handles`, `remove_person_alias`, `merge_persons`, `recanonicalize_person` |
551
+ | **Feishu docs** | `ingest_feishu_doc` |
552
+ | **Health** | `get_health` |
553
+
554
+ ## CLI Reference
555
+
556
+ | Command | Description |
557
+ |---------|-------------|
558
+ | `memoark start` | One-step launch: setup if needed, then serve + auto-open browser (bare `memoark` is equivalent) |
559
+ | `memoark init` | Interactive config center to generate / edit `memoark.yaml` (`--auto` / `--no-tui` / `--force` / `--web`) |
560
+ | `memoark extract` | Extract signals from a data source |
561
+ | `memoark search <query>` | Search memory (hybrid / `--mode fts`) |
562
+ | `memoark embed` | Generate embeddings for stale chunks |
563
+ | `memoark serve` | Start HTTP API (auto-opens browser, `--no-open` to skip) / `--mcp` stdio / `--mcp-http` |
564
+ | `memoark consolidate` | Run memory consolidation (tier rotation hot→warm / warm→cold) |
565
+ | `memoark export` | Export memory pages to an Obsidian vault (Markdown) |
566
+ | `memoark import` | Import an Obsidian vault back into Memoark |
567
+ | `memoark docs` | Feishu doc summary cards: `sync` / `status` / `retry` |
568
+ | `memoark identity` | Person identity: aliases, merge, rename |
569
+ | `memoark sources` | `list` sources / `test <name>` connectivity |
570
+ | `memoark doctor` | Diagnose configuration and connectivity |
571
+ | `memoark config` | `init` (alias of `memoark init`) / `edit` (browser UI) |
361
572
 
362
573
  ### `memoark extract`
363
574
 
364
- 从数据源提取信号。
575
+ Extract signals from data sources.
365
576
 
366
577
  ```bash
367
578
  memoark extract \
368
- --source <name> # claude-code, codex, hermes, feishu, all
369
- --format json|markdown # 输出格式,默认 json
370
- --adapter store|file|gbrain|stdout # 输出目标,默认 store
371
- --since <date> # 只处理此日期之后的消息
372
- --limit <n> # 限制消息数
373
- --dry-run # 测试模式
579
+ --source <name> # feishu, claude-code, codex, hermes, all
580
+ --format json|markdown # Output format (default: json)
581
+ --adapter store|file|gbrain|stdout # Output target (default: store)
582
+ --output <dir> # Output directory for file adapter
583
+ --since <date> # Process messages after this date (ISO 8601 or relative: 1d, 2h)
584
+ --limit <n> # Max messages to process
585
+ --dry-run # Test without LLM calls or writes
586
+ ```
587
+
588
+ ### `memoark start`
589
+
590
+ One-step launch. If no `memoark.yaml` exists, it opens the browser setup wizard first; once configured, it starts the HTTP server and auto-opens your browser. Running `memoark` with no subcommand does the same thing.
591
+
592
+ ```bash
593
+ memoark start
594
+ memoark # equivalent
374
595
  ```
375
596
 
376
597
  ### `memoark serve`
377
598
 
378
- 启动服务器。
599
+ Start the Memoark server.
379
600
 
380
601
  ```bash
381
- memoark serve # HTTP API
382
- memoark serve --mcp # MCP stdio 传输
602
+ # HTTP API + Web UI (default http://localhost:3927) — auto-opens the browser
603
+ memoark serve
604
+
605
+ # Skip the auto-open
606
+ memoark serve --no-open
607
+
608
+ # MCP stdio transport (local direct connect for AI agents)
609
+ memoark serve --mcp
610
+
611
+ # MCP Streamable HTTP transport (remote / multi-client, default http://localhost:3928/mcp)
612
+ memoark serve --mcp-http
383
613
  ```
384
614
 
385
615
  ### `memoark search <query>`
386
616
 
387
- 搜索存储的记忆。
617
+ Search your stored memory.
388
618
 
389
619
  ```bash
390
- memoark search "认证中间件" # 混合搜索(默认)
391
- memoark search "JWT" --mode fts # 仅全文搜索
392
- memoark search "部署" --limit 5 # 限制结果数
620
+ # Hybrid search (FTS + vector, default)
621
+ memoark search "authentication middleware"
622
+
623
+ # FTS-only search
624
+ memoark search "JWT token" --mode fts
625
+
626
+ # Limit results
627
+ memoark search "deployment" --limit 5
393
628
  ```
394
629
 
395
630
  ### `memoark embed`
396
631
 
397
- 为未嵌入的 chunk 生成向量嵌入。
632
+ Generate embeddings for unembedded chunks.
398
633
 
399
634
  ```bash
400
- memoark embed # 嵌入所有过期 chunk
401
- memoark embed --limit 100 # 限制批量大小
635
+ # Embed all stale chunks
636
+ memoark embed
637
+
638
+ # Limit batch size
639
+ memoark embed --limit 100
402
640
  ```
403
641
 
404
642
  ### `memoark doctor`
405
643
 
406
- 诊断配置和环境。
644
+ Diagnose configuration and environment.
645
+
646
+ ```bash
647
+ memoark doctor
648
+ ```
407
649
 
408
650
  ### `memoark config init`
409
651
 
410
- 等价于 `memoark init` —— 启动交互式配置中心生成 / 编辑 `memoark.yaml`(支持 `--auto` / `--no-tui` / `--force`)。
652
+ Equivalent to `memoark init` launches the interactive configuration center to generate / edit `memoark.yaml` (supports `--auto` / `--no-tui` / `--force`).
653
+
654
+ ```bash
655
+ memoark config init
656
+ ```
657
+
658
+ ### `memoark sources list`
659
+
660
+ List available data sources.
661
+
662
+ ```bash
663
+ memoark sources list
664
+ ```
665
+
666
+ ### `memoark sources test <name>`
667
+
668
+ Test data source connectivity.
669
+
670
+ ```bash
671
+ memoark sources test claude-code
672
+ ```
673
+
674
+ ### `memoark consolidate`
675
+
676
+ Run memory lifecycle tier rotation (the "dream cycle").
677
+
678
+ ```bash
679
+ memoark consolidate # hot→warm and/or warm→cold rotation
680
+ ```
681
+
682
+ ### `memoark export` / `memoark import`
683
+
684
+ Bidirectional Obsidian sync.
685
+
686
+ ```bash
687
+ memoark export # memory pages → Obsidian vault (Markdown)
688
+ memoark import # Obsidian vault → Memoark
689
+ ```
690
+
691
+ ### `memoark docs`
411
692
 
412
- ### `memoark sources list` / `memoark sources test <name>`
693
+ Feishu doc summary cards (DocSource v2) build lightweight pointer cards first, then upgrade triggered docs to full summary cards.
694
+
695
+ ```bash
696
+ memoark docs sync # scan docs, build pointer cards, upgrade triggered docs
697
+ memoark docs status # show card counts by type
698
+ memoark docs retry <doc_token> # retry a failed full-card extraction
699
+ memoark docs retry --all-failed # retry every failed doc
700
+ ```
413
701
 
414
- 列出或测试数据源。
702
+ Agents can also ingest a single doc directly via the MCP tool `ingest_feishu_doc` (pass a doc URL or token).
415
703
 
416
- ## 配置
704
+ ## Configuration
417
705
 
418
706
  ### `memoark.yaml`
419
707
 
420
708
  ```yaml
421
- # 隐私配置
709
+ # Privacy
422
710
  privacy:
423
711
  enabled: true
424
- mode: reversible # reversible(可逆)| irreversible(不可逆)
712
+ mode: reversible # reversible | irreversible
425
713
  redact_phone: true
426
714
  redact_id_card: true
427
715
  redact_bank_card: true
428
716
  replacement: "[REDACTED]"
429
717
 
430
- # LLM(信号提取用)
718
+ # LLM (for signal extraction)
431
719
  llm:
432
720
  provider: openai
433
721
  model: gpt-4o-mini
434
722
  api_key: ${OPENAI_API_KEY}
435
723
 
436
- # 分块配置
724
+ # Block Builder
437
725
  block_builder:
438
726
  block_gap_minutes: 30
439
727
  max_block_tokens: 4000
440
728
  max_block_messages: 100
441
729
 
442
- # 数据源
730
+ # Data Sources
443
731
  sources:
732
+ # Feishu (Lark) — your primary work source
733
+ feishu:
734
+ enabled: true
735
+ auth_mode: user # user mode enables DM + message search
736
+ app_id: ${FEISHU_APP_ID}
737
+ app_secret: ${FEISHU_APP_SECRET}
738
+ sources:
739
+ messages: # group chats via OpenAPI
740
+ enabled: true
741
+ chat_ids: []
742
+ lookback_days: 3
743
+ message_search: # DMs + recent chats via lark-cli
744
+ enabled: true
745
+ chat_types: [p2p] # add `group` to include groups
746
+ lookback_days: 3
747
+ calendar: { enabled: true }
748
+ docs: { enabled: true }
749
+ tasks: { enabled: true }
750
+ # AI agent sessions
444
751
  claude-code:
445
752
  enabled: true
446
753
  codex:
@@ -448,113 +755,171 @@ sources:
448
755
  hermes:
449
756
  enabled: true
450
757
 
451
- # 存储(PGLite
758
+ # Store (PGLite)
452
759
  store:
453
760
  data_dir: ~/.memoark/data
454
761
 
455
- # 嵌入
762
+ # Embeddings
456
763
  embedding:
457
764
  provider: openai # openai | ollama
458
765
  model: text-embedding-3-large
459
766
  dimensions: 1536
460
767
  api_key: ${OPENAI_API_KEY}
461
768
 
462
- # 服务器
769
+ # Server
463
770
  server:
464
771
  http_port: 3927
465
772
  ```
466
773
 
467
- ## 支持的数据源
774
+ > **Feishu DM vs. group capture:** `messages` uses the OpenAPI chat/message endpoints (best for known group `chat_id`s), while `message_search` uses `lark-cli im messages-search` in user mode (required for recent DMs and 1:1 bot chats). Enable both for full coverage, and complete the `lark-cli` user login first.
468
775
 
469
- | 数据源 | 路径 | 说明 |
470
- |--------|------|------|
471
- | **飞书(Lark)** | API + lark-cli | 核心工作源 —— 7 个源:群聊、私信、邮件、日历、文档、任务、消息搜索 |
472
- | **Claude Code** | `~/.claude/projects/` | Claude Code Agent 对话记录 |
473
- | **Codex** | `~/.codex/` | OpenAI Codex CLI 会话 |
474
- | **Hermes** | `~/.openclaw/agents/` | OpenClaw Hermes Agent 会话 |
776
+ ## Supported Sources
475
777
 
476
- > 飞书优先:它承载的是工作本身 —— 需求讨论、技术方案、团队决策。私信和最近会话需要先完成 `lark-cli` 用户态登录并启用 `message_search`(详见上方配置)。
778
+ ### Feishu (Lark)
477
779
 
478
- ## 路线图
780
+ Your primary work source — group messages, DMs, email, calendar events, docs, and tasks.
479
781
 
480
- ### Phase 1 信号提取(已完成)
782
+ - **Auth**: `lark-cli` user-mode login (for DMs / message search) + app credentials
783
+ - **Data**: 7 sources — group chats, DMs, email, calendar, docs, tasks, message search
784
+ - **Why first**: Feishu carries the work itself — requirements, technical proposals, team decisions
481
785
 
482
- - [x] 多平台采集器(Claude Code、Codex、Hermes、飞书)
483
- - [x] LLM 驱动的噪声过滤和信号提取
484
- - [x] 7 类信号:实体、时间线、决策、任务、发现、知识、关系
485
- - [x] 双轨隐私脱敏(可逆 + 不可逆)
486
- - [x] JSON 和 Markdown 输出格式
786
+ ### Claude Code
487
787
 
488
- ### Phase 2 存储 & 服务器(已完成)
788
+ Extracts conversation transcripts from Claude Code agent sessions.
489
789
 
490
- - [x] PGLite 嵌入式 PostgreSQL + pgvector
491
- - [x] PageStore、ChunkStore、TagStore、TimelineStore、GraphStore
492
- - [x] 全文搜索(simple 分词器,支持中文)+ 向量搜索
493
- - [x] RRF 混合搜索
494
- - [x] EmbeddingService(OpenAI / Ollama)
495
- - [x] StoreAdapter — Pipeline 直接写入 PGLite
496
- - [x] Hono REST API
497
- - [x] MCP 服务器(17 个 stdio 工具)
498
- - [x] CLI serve、search、embed 命令
790
+ - **Location**: `~/.claude/projects/`
791
+ - **Data**: Agent conversations, decisions, discoveries, session logs
499
792
 
500
- ### Phase 3 — Web UI(已完成)
793
+ ### Codex
501
794
 
502
- - [x] Dashboard
503
- - [x] 时间线视图
504
- - [x] 知识图谱可视化(力导向)
505
- - [x] 搜索界面
506
- - [x] 实体 / 页面详情
795
+ Extracts session data from OpenAI Codex CLI.
796
+
797
+ - **Location**: `~/.codex/`
798
+ - **Data**: User/assistant messages with system-injection filtering
799
+
800
+ ### Hermes
801
+
802
+ Extracts session data from OpenClaw Hermes agents.
507
803
 
508
- ### Phase 4 — 上下文感知提取(规划中)
804
+ - **Location**: `~/.openclaw/agents/`
805
+ - **Data**: Multi-agent sessions with automatic sub-agent discovery
509
806
 
510
- - [ ] ContextBuffer —— 跨 block 共享上下文
511
- - [ ] 加权准入评分(替换二元噪声过滤)
512
- - [ ] NarrativeAssembler —— 按实体聚合叙事
807
+ ## Roadmap
513
808
 
514
- ### Phase 5巩固与常驻服务(规划中)
809
+ ### Phase 1Signal Extraction (Complete)
515
810
 
516
- - [ ] 记忆巩固(dream cycle):实体合并、链接修复、模式发现
517
- - [ ] 常驻后台服务 + 定时采集
518
- - [ ] 自然语言问答
811
+ - [x] Multi-platform collectors (Claude Code, Codex, Hermes, Feishu)
812
+ - [x] LLM-powered noise filtering and signal extraction
813
+ - [x] 7 signal types: entities, timeline, decisions, tasks, discoveries, knowledge, links
814
+ - [x] Dual-track privacy redaction (reversible + irreversible)
815
+ - [x] JSON and Markdown output formatters
816
+ - [x] File, GBrain, and Stdout adapters
817
+ - [x] CLI with extract, doctor, config, sources commands
519
818
 
520
- ### Phase 6同步与新数据源(规划中)
819
+ ### Phase 2Storage & Server (Complete)
521
820
 
522
- - [ ] Obsidian 双向同步
523
- - [ ] 微信聊天记录
524
- - [ ] 更多平台(社区驱动)
821
+ - [x] PGLite embedded PostgreSQL with pgvector
822
+ - [x] PageStore, ChunkStore, TagStore, TimelineStore, GraphStore
823
+ - [x] Full-text search with `tsvector` (simple tokenizer for multilingual)
824
+ - [x] Vector search with `pgvector` cosine similarity
825
+ - [x] Hybrid RRF search fusing FTS + vector results
826
+ - [x] EmbeddingService (OpenAI / Ollama)
827
+ - [x] StoreAdapter — pipeline writes directly to PGLite
828
+ - [x] Hono REST API
829
+ - [x] MCP Server with 29 stdio tools
830
+ - [x] CLI serve, search, embed commands
525
831
 
526
- ## 技术栈
832
+ ### Phase 3 — Web UI (Complete)
527
833
 
528
- | | 技术 |
529
- |----|------|
530
- | 语言 | TypeScript |
531
- | 运行时 | Bun |
532
- | 数据库 | PGLite(嵌入式 PostgreSQL) |
533
- | 向量搜索 | pgvector |
534
- | 嵌入 | OpenAI / Ollama |
535
- | Web 框架 | Hono |
834
+ - [x] Dashboard
835
+ - [x] Timeline view
836
+ - [x] Knowledge graph visualization (force-directed)
837
+ - [x] Search interface
838
+ - [x] Entity / page detail views
839
+
840
+ ### Phase 4 Consolidation & Daemon (Complete)
841
+
842
+ - [x] Memory consolidation ("dream cycle"): tier rotation, dead-link repair, preference inference
843
+ - [x] Resident daemon with scheduled extraction (scheduler, run history, alerts)
844
+ - [x] Person identity management (aliases, merge, rename)
845
+ - [x] Feishu doc summary cards (DocSource v2)
846
+ - [x] Obsidian bidirectional sync (export / import)
847
+
848
+ ### Phase 5 — Self-Hosted Always-On (In Progress · MVP)
849
+
850
+ - [ ] Standalone daemon service + autostart (systemd / launchd / Windows service) — "configure once, runs maintenance-free"
851
+ - [ ] Agent Hook: auto read/write memory on session end / key decisions
852
+
853
+ ### Phase 6 — More Chinese Workplace Sources (Planned)
854
+
855
+ - [ ] DingTalk
856
+ - [ ] WeCom (WeChat Work)
857
+ - [ ] WeChat chat history
858
+ - [ ] Local document source (scan local files, community-driven · low priority)
859
+
860
+ ### Phase 7 — Context-Aware Extraction & Q&A (In Progress)
861
+
862
+ - [x] Synthesis layer (basic): `synthesize` / `recall` — cited composed answers with inline `[n]` + gap analysis, intent-template framework, per-scope caching
863
+ - [x] **Person communication profile (Hero)**: `prep_for_person(person, goal?)` — passively infers a communication profile from real interactions (zero-LLM behavior layer + behavior-quadrant trait layer + relation layer + four-color shell) and gives goal-conditioned, `[n]`-cited communication strategy. No questionnaire, local-first, ethics-guardrailed (suggestions, not manipulation); disabled by default, per-person opt-in
864
+ - [x] **Cross-channel daily report**: `daily_report(date?)` — aggregates today's signals across DMs/group/email/Feishu Minutes/calendar into 7 sections; meeting notes yield `decisions` and owner-tagged `action_items` (yours land in "my tasks")
865
+ - [x] **Troubleshooting Playbooks**: `troubleshoot(query)` — ordered steps along the playbook `precedes` chain with per-result meaning; hierarchical tree (`part_of`) organizes problem domains; playbooks authored by hand or auto-extracted (draft) from conversations
866
+ - [x] **Retrieval quality**: best-chunk-per-page pooling (surface on strongest evidence), zero-LLM self-wiring (`[[slug]]`/`[[rel:slug]]` graph edges on write), rule-based query rewrite
867
+ - [ ] ContextBuffer — share context across conversation blocks
868
+ - [ ] Weighted admission scoring (replaces binary noise filter)
869
+ - [ ] Narrative assembler — aggregate signals into per-entity narratives
870
+ - [ ] Natural language Q&A over stored memories
871
+
872
+ ### Phase 8 — Web UI Enhancements (Planned)
873
+
874
+ - [ ] Memory editing (read-only today)
875
+ - [ ] Audit view (signal provenance visualization)
876
+
877
+ ## Tech Stack
878
+
879
+ | Layer | Technology |
880
+ |-------|-----------|
881
+ | Language | TypeScript |
882
+ | Runtime | Bun |
883
+ | Database | PGLite (embedded PostgreSQL) |
884
+ | Vector Search | pgvector |
885
+ | Embeddings | OpenAI / Ollama |
886
+ | Web Framework | Hono |
536
887
  | Web UI | React + Vite |
537
888
  | MCP | @modelcontextprotocol/sdk |
538
889
  | Linter | Biome |
539
- | 测试 | Vitest(800+ 测试) |
890
+ | Tests | Vitest (1000+ tests) |
540
891
 
541
- ## 开发
892
+ ## Development
542
893
 
543
894
  ```bash
544
- bun run test # 全量测试
545
- bun run test:watch # 监听模式
546
- bun run typecheck # 类型检查
547
- bun run lint # 代码检查
548
- bun run lint:fix # 自动修复
895
+ # Run tests
896
+ bun run test
897
+
898
+ # Watch mode
899
+ bun run test:watch
900
+
901
+ # Type-check
902
+ bun run typecheck
903
+
904
+ # Lint
905
+ bun run lint
906
+
907
+ # Auto-fix lint issues
908
+ bun run lint:fix
549
909
  ```
550
910
 
551
- 详见 [CONTRIBUTING.md](CONTRIBUTING.md)
911
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development workflow and guidelines.
912
+
913
+ ## Contributing
914
+
915
+ Contributions welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) before submitting a PR.
552
916
 
553
- ## 社区与支持
917
+ ## Community & Support
554
918
 
555
- - 🐛 发现 bug 或有功能建议?[提交 issue](https://github.com/AndreLYL/memoark/issues)
556
- - 💡 欢迎在 issue 区交流问题和想法。
919
+ - 🐛 Found a bug or have a feature request? [Open an issue](https://github.com/AndreLYL/memoark/issues).
920
+ - 💡 Questions and ideas are welcome in the issue tracker.
921
+ - ⭐ If Memoark helps you, give it a Star — it's the best way to support the project.
557
922
 
558
923
  ## License
559
924
 
560
- 基于 [Apache License 2.0](LICENSE) 开源。
925
+ Licensed under the [Apache License, Version 2.0](LICENSE).