agentdb 1.0.0

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 (361) hide show
  1. package/LICENSE +38 -0
  2. package/LICENSE-APACHE +190 -0
  3. package/LICENSE-MIT +21 -0
  4. package/README.md +953 -0
  5. package/bin/agentdb.js +485 -0
  6. package/bin/plugin-cli-wrapper.mjs +21 -0
  7. package/dist/cache/query-cache.d.ts +105 -0
  8. package/dist/cache/query-cache.d.ts.map +1 -0
  9. package/dist/cache/query-cache.js +224 -0
  10. package/dist/cache/query-cache.js.map +1 -0
  11. package/dist/cache/query-cache.mjs +219 -0
  12. package/dist/cli/cache/query-cache.d.ts +104 -0
  13. package/dist/cli/cache/query-cache.js +244 -0
  14. package/dist/cli/cli/db-commands.d.ts +48 -0
  15. package/dist/cli/cli/db-commands.js +613 -0
  16. package/dist/cli/commands.d.ts +7 -0
  17. package/dist/cli/commands.d.ts.map +1 -0
  18. package/dist/cli/commands.js +113 -0
  19. package/dist/cli/commands.js.map +1 -0
  20. package/dist/cli/commands.mjs +104 -0
  21. package/dist/cli/core/backend-interface.d.ts +70 -0
  22. package/dist/cli/core/backend-interface.js +15 -0
  23. package/dist/cli/core/native-backend.d.ts +140 -0
  24. package/dist/cli/core/native-backend.js +432 -0
  25. package/dist/cli/core/vector-db.d.ts +126 -0
  26. package/dist/cli/core/vector-db.js +338 -0
  27. package/dist/cli/core/wasm-backend.d.ts +95 -0
  28. package/dist/cli/core/wasm-backend.js +418 -0
  29. package/dist/cli/db-commands.d.ts +49 -0
  30. package/dist/cli/db-commands.d.ts.map +1 -0
  31. package/dist/cli/db-commands.js +533 -0
  32. package/dist/cli/db-commands.js.map +1 -0
  33. package/dist/cli/db-commands.mjs +522 -0
  34. package/dist/cli/generator.d.ts +11 -0
  35. package/dist/cli/generator.d.ts.map +1 -0
  36. package/dist/cli/generator.js +567 -0
  37. package/dist/cli/generator.js.map +1 -0
  38. package/dist/cli/generator.mjs +527 -0
  39. package/dist/cli/help.d.ts +18 -0
  40. package/dist/cli/help.d.ts.map +1 -0
  41. package/dist/cli/help.js +676 -0
  42. package/dist/cli/help.js.map +1 -0
  43. package/dist/cli/help.mjs +667 -0
  44. package/dist/cli/index/hnsw.d.ts +164 -0
  45. package/dist/cli/index/hnsw.js +558 -0
  46. package/dist/cli/plugin-cli.d.ts +7 -0
  47. package/dist/cli/plugin-cli.d.ts.map +1 -0
  48. package/dist/cli/plugin-cli.js +295 -0
  49. package/dist/cli/plugin-cli.js.map +1 -0
  50. package/dist/cli/plugin-cli.mjs +289 -0
  51. package/dist/cli/quantization/product-quantization.d.ts +108 -0
  52. package/dist/cli/quantization/product-quantization.js +350 -0
  53. package/dist/cli/query/query-builder.d.ts +322 -0
  54. package/dist/cli/query/query-builder.js +600 -0
  55. package/dist/cli/templates.d.ts +14 -0
  56. package/dist/cli/templates.d.ts.map +1 -0
  57. package/dist/cli/templates.js +182 -0
  58. package/dist/cli/templates.js.map +1 -0
  59. package/dist/cli/templates.mjs +176 -0
  60. package/dist/cli/types/index.d.ts +116 -0
  61. package/dist/cli/types/index.js +5 -0
  62. package/dist/cli/types.d.ts +91 -0
  63. package/dist/cli/types.d.ts.map +1 -0
  64. package/dist/cli/types.js +6 -0
  65. package/dist/cli/types.js.map +1 -0
  66. package/dist/cli/types.mjs +4 -0
  67. package/dist/cli/wizard/index.d.ts +6 -0
  68. package/dist/cli/wizard/index.d.ts.map +1 -0
  69. package/dist/cli/wizard/index.js +138 -0
  70. package/dist/cli/wizard/index.js.map +1 -0
  71. package/dist/cli/wizard/index.mjs +131 -0
  72. package/dist/cli/wizard/prompts.d.ts +11 -0
  73. package/dist/cli/wizard/prompts.d.ts.map +1 -0
  74. package/dist/cli/wizard/prompts.js +482 -0
  75. package/dist/cli/wizard/prompts.js.map +1 -0
  76. package/dist/cli/wizard/prompts.mjs +470 -0
  77. package/dist/cli/wizard/validator.d.ts +13 -0
  78. package/dist/cli/wizard/validator.d.ts.map +1 -0
  79. package/dist/cli/wizard/validator.js +234 -0
  80. package/dist/cli/wizard/validator.js.map +1 -0
  81. package/dist/cli/wizard/validator.mjs +224 -0
  82. package/dist/core/backend-interface.d.ts +71 -0
  83. package/dist/core/backend-interface.d.ts.map +1 -0
  84. package/dist/core/backend-interface.js +16 -0
  85. package/dist/core/backend-interface.js.map +1 -0
  86. package/dist/core/backend-interface.mjs +12 -0
  87. package/dist/core/native-backend.d.ts +141 -0
  88. package/dist/core/native-backend.d.ts.map +1 -0
  89. package/dist/core/native-backend.js +457 -0
  90. package/dist/core/native-backend.js.map +1 -0
  91. package/dist/core/native-backend.mjs +449 -0
  92. package/dist/core/vector-db.d.ts +127 -0
  93. package/dist/core/vector-db.d.ts.map +1 -0
  94. package/dist/core/vector-db.js +266 -0
  95. package/dist/core/vector-db.js.map +1 -0
  96. package/dist/core/vector-db.mjs +261 -0
  97. package/dist/core/wasm-backend.d.ts +96 -0
  98. package/dist/core/wasm-backend.d.ts.map +1 -0
  99. package/dist/core/wasm-backend.js +393 -0
  100. package/dist/core/wasm-backend.js.map +1 -0
  101. package/dist/core/wasm-backend.mjs +385 -0
  102. package/dist/index/hnsw-optimized.d.ts +75 -0
  103. package/dist/index/hnsw-optimized.d.ts.map +1 -0
  104. package/dist/index/hnsw-optimized.js +412 -0
  105. package/dist/index/hnsw-optimized.js.map +1 -0
  106. package/dist/index/hnsw-optimized.mjs +407 -0
  107. package/dist/index/hnsw.d.ts +165 -0
  108. package/dist/index/hnsw.d.ts.map +1 -0
  109. package/dist/index/hnsw.js +521 -0
  110. package/dist/index/hnsw.js.map +1 -0
  111. package/dist/index/hnsw.mjs +516 -0
  112. package/dist/index.d.ts +57 -0
  113. package/dist/index.d.ts.map +1 -0
  114. package/dist/index.js +82 -0
  115. package/dist/index.js.map +1 -0
  116. package/dist/index.mjs +63 -0
  117. package/dist/mcp-server.d.ts +27 -0
  118. package/dist/mcp-server.d.ts.map +1 -0
  119. package/dist/mcp-server.js +789 -0
  120. package/dist/mcp-server.js.map +1 -0
  121. package/dist/mcp-server.mjs +784 -0
  122. package/dist/plugins/base-plugin.d.ts +114 -0
  123. package/dist/plugins/base-plugin.d.ts.map +1 -0
  124. package/dist/plugins/base-plugin.js +313 -0
  125. package/dist/plugins/base-plugin.js.map +1 -0
  126. package/dist/plugins/base-plugin.mjs +275 -0
  127. package/dist/plugins/implementations/active-learning.d.ts +135 -0
  128. package/dist/plugins/implementations/active-learning.d.ts.map +1 -0
  129. package/dist/plugins/implementations/active-learning.js +372 -0
  130. package/dist/plugins/implementations/active-learning.js.map +1 -0
  131. package/dist/plugins/implementations/active-learning.mjs +367 -0
  132. package/dist/plugins/implementations/actor-critic.d.ts +64 -0
  133. package/dist/plugins/implementations/actor-critic.d.ts.map +1 -0
  134. package/dist/plugins/implementations/actor-critic.js +363 -0
  135. package/dist/plugins/implementations/actor-critic.js.map +1 -0
  136. package/dist/plugins/implementations/actor-critic.mjs +358 -0
  137. package/dist/plugins/implementations/adversarial-training.d.ts +133 -0
  138. package/dist/plugins/implementations/adversarial-training.d.ts.map +1 -0
  139. package/dist/plugins/implementations/adversarial-training.js +409 -0
  140. package/dist/plugins/implementations/adversarial-training.js.map +1 -0
  141. package/dist/plugins/implementations/adversarial-training.mjs +404 -0
  142. package/dist/plugins/implementations/curriculum-learning.d.ts +132 -0
  143. package/dist/plugins/implementations/curriculum-learning.d.ts.map +1 -0
  144. package/dist/plugins/implementations/curriculum-learning.js +354 -0
  145. package/dist/plugins/implementations/curriculum-learning.js.map +1 -0
  146. package/dist/plugins/implementations/curriculum-learning.mjs +349 -0
  147. package/dist/plugins/implementations/decision-transformer.d.ts +77 -0
  148. package/dist/plugins/implementations/decision-transformer.d.ts.map +1 -0
  149. package/dist/plugins/implementations/decision-transformer.js +422 -0
  150. package/dist/plugins/implementations/decision-transformer.js.map +1 -0
  151. package/dist/plugins/implementations/decision-transformer.mjs +417 -0
  152. package/dist/plugins/implementations/federated-learning.d.ts +126 -0
  153. package/dist/plugins/implementations/federated-learning.d.ts.map +1 -0
  154. package/dist/plugins/implementations/federated-learning.js +436 -0
  155. package/dist/plugins/implementations/federated-learning.js.map +1 -0
  156. package/dist/plugins/implementations/federated-learning.mjs +431 -0
  157. package/dist/plugins/implementations/index.d.ts +30 -0
  158. package/dist/plugins/implementations/index.d.ts.map +1 -0
  159. package/dist/plugins/implementations/index.js +45 -0
  160. package/dist/plugins/implementations/index.js.map +1 -0
  161. package/dist/plugins/implementations/index.mjs +31 -0
  162. package/dist/plugins/implementations/multi-task-learning.d.ts +115 -0
  163. package/dist/plugins/implementations/multi-task-learning.d.ts.map +1 -0
  164. package/dist/plugins/implementations/multi-task-learning.js +369 -0
  165. package/dist/plugins/implementations/multi-task-learning.js.map +1 -0
  166. package/dist/plugins/implementations/multi-task-learning.mjs +364 -0
  167. package/dist/plugins/implementations/neural-architecture-search.d.ts +148 -0
  168. package/dist/plugins/implementations/neural-architecture-search.d.ts.map +1 -0
  169. package/dist/plugins/implementations/neural-architecture-search.js +379 -0
  170. package/dist/plugins/implementations/neural-architecture-search.js.map +1 -0
  171. package/dist/plugins/implementations/neural-architecture-search.mjs +374 -0
  172. package/dist/plugins/implementations/q-learning.d.ts +98 -0
  173. package/dist/plugins/implementations/q-learning.d.ts.map +1 -0
  174. package/dist/plugins/implementations/q-learning.js +435 -0
  175. package/dist/plugins/implementations/q-learning.js.map +1 -0
  176. package/dist/plugins/implementations/q-learning.mjs +430 -0
  177. package/dist/plugins/implementations/sarsa.d.ts +103 -0
  178. package/dist/plugins/implementations/sarsa.d.ts.map +1 -0
  179. package/dist/plugins/implementations/sarsa.js +347 -0
  180. package/dist/plugins/implementations/sarsa.js.map +1 -0
  181. package/dist/plugins/implementations/sarsa.mjs +342 -0
  182. package/dist/plugins/index.d.ts +107 -0
  183. package/dist/plugins/index.d.ts.map +1 -0
  184. package/dist/plugins/index.js +179 -0
  185. package/dist/plugins/index.js.map +1 -0
  186. package/dist/plugins/index.mjs +168 -0
  187. package/dist/plugins/interface.d.ts +439 -0
  188. package/dist/plugins/interface.d.ts.map +1 -0
  189. package/dist/plugins/interface.js +12 -0
  190. package/dist/plugins/interface.js.map +1 -0
  191. package/dist/plugins/interface.mjs +10 -0
  192. package/dist/plugins/learning-plugin.interface.d.ts +257 -0
  193. package/dist/plugins/learning-plugin.interface.d.ts.map +1 -0
  194. package/dist/plugins/learning-plugin.interface.js +7 -0
  195. package/dist/plugins/learning-plugin.interface.js.map +1 -0
  196. package/dist/plugins/learning-plugin.interface.mjs +5 -0
  197. package/dist/plugins/plugin-exports.d.ts +71 -0
  198. package/dist/plugins/plugin-exports.d.ts.map +1 -0
  199. package/dist/plugins/plugin-exports.js +78 -0
  200. package/dist/plugins/plugin-exports.js.map +1 -0
  201. package/dist/plugins/plugin-exports.mjs +69 -0
  202. package/dist/plugins/registry.d.ts +206 -0
  203. package/dist/plugins/registry.d.ts.map +1 -0
  204. package/dist/plugins/registry.js +365 -0
  205. package/dist/plugins/registry.js.map +1 -0
  206. package/dist/plugins/registry.mjs +356 -0
  207. package/dist/plugins/validator.d.ts +63 -0
  208. package/dist/plugins/validator.d.ts.map +1 -0
  209. package/dist/plugins/validator.js +464 -0
  210. package/dist/plugins/validator.js.map +1 -0
  211. package/dist/plugins/validator.mjs +458 -0
  212. package/dist/quantization/binary-quantization.d.ts +104 -0
  213. package/dist/quantization/binary-quantization.d.ts.map +1 -0
  214. package/dist/quantization/binary-quantization.js +246 -0
  215. package/dist/quantization/binary-quantization.js.map +1 -0
  216. package/dist/quantization/binary-quantization.mjs +240 -0
  217. package/dist/quantization/optimized-pq.d.ts +138 -0
  218. package/dist/quantization/optimized-pq.d.ts.map +1 -0
  219. package/dist/quantization/optimized-pq.js +320 -0
  220. package/dist/quantization/optimized-pq.js.map +1 -0
  221. package/dist/quantization/optimized-pq.mjs +313 -0
  222. package/dist/quantization/product-quantization.d.ts +109 -0
  223. package/dist/quantization/product-quantization.d.ts.map +1 -0
  224. package/dist/quantization/product-quantization.js +287 -0
  225. package/dist/quantization/product-quantization.js.map +1 -0
  226. package/dist/quantization/product-quantization.mjs +282 -0
  227. package/dist/quantization/scalar-quantization.d.ts +100 -0
  228. package/dist/quantization/scalar-quantization.d.ts.map +1 -0
  229. package/dist/quantization/scalar-quantization.js +324 -0
  230. package/dist/quantization/scalar-quantization.js.map +1 -0
  231. package/dist/quantization/scalar-quantization.mjs +319 -0
  232. package/dist/query/index.d.ts +6 -0
  233. package/dist/query/index.d.ts.map +1 -0
  234. package/dist/query/index.js +9 -0
  235. package/dist/query/index.js.map +1 -0
  236. package/dist/query/index.mjs +4 -0
  237. package/dist/query/query-builder.d.ts +323 -0
  238. package/dist/query/query-builder.d.ts.map +1 -0
  239. package/dist/query/query-builder.js +524 -0
  240. package/dist/query/query-builder.js.map +1 -0
  241. package/dist/query/query-builder.mjs +519 -0
  242. package/dist/reasoning/context-synthesizer.d.ts +57 -0
  243. package/dist/reasoning/context-synthesizer.d.ts.map +1 -0
  244. package/dist/reasoning/context-synthesizer.js +224 -0
  245. package/dist/reasoning/context-synthesizer.js.map +1 -0
  246. package/dist/reasoning/context-synthesizer.mjs +219 -0
  247. package/dist/reasoning/experience-curator.d.ts +66 -0
  248. package/dist/reasoning/experience-curator.d.ts.map +1 -0
  249. package/dist/reasoning/experience-curator.js +288 -0
  250. package/dist/reasoning/experience-curator.js.map +1 -0
  251. package/dist/reasoning/experience-curator.mjs +283 -0
  252. package/dist/reasoning/memory-optimizer.d.ts +69 -0
  253. package/dist/reasoning/memory-optimizer.d.ts.map +1 -0
  254. package/dist/reasoning/memory-optimizer.js +331 -0
  255. package/dist/reasoning/memory-optimizer.js.map +1 -0
  256. package/dist/reasoning/memory-optimizer.mjs +326 -0
  257. package/dist/reasoning/pattern-matcher.d.ts +59 -0
  258. package/dist/reasoning/pattern-matcher.d.ts.map +1 -0
  259. package/dist/reasoning/pattern-matcher.js +229 -0
  260. package/dist/reasoning/pattern-matcher.js.map +1 -0
  261. package/dist/reasoning/pattern-matcher.mjs +224 -0
  262. package/dist/reasoningbank/adapter/agentdb-adapter.d.ts +118 -0
  263. package/dist/reasoningbank/adapter/agentdb-adapter.d.ts.map +1 -0
  264. package/dist/reasoningbank/adapter/agentdb-adapter.js +477 -0
  265. package/dist/reasoningbank/adapter/agentdb-adapter.js.map +1 -0
  266. package/dist/reasoningbank/adapter/types.d.ts +113 -0
  267. package/dist/reasoningbank/adapter/types.d.ts.map +1 -0
  268. package/dist/reasoningbank/adapter/types.js +9 -0
  269. package/dist/reasoningbank/adapter/types.js.map +1 -0
  270. package/dist/reasoningbank/cli/commands.d.ts +16 -0
  271. package/dist/reasoningbank/cli/commands.d.ts.map +1 -0
  272. package/dist/reasoningbank/cli/commands.js +272 -0
  273. package/dist/reasoningbank/cli/commands.js.map +1 -0
  274. package/dist/reasoningbank/mcp/agentdb-tools.d.ts +319 -0
  275. package/dist/reasoningbank/mcp/agentdb-tools.d.ts.map +1 -0
  276. package/dist/reasoningbank/mcp/agentdb-tools.js +301 -0
  277. package/dist/reasoningbank/mcp/agentdb-tools.js.map +1 -0
  278. package/dist/reasoningbank/migration/migrate.d.ts +25 -0
  279. package/dist/reasoningbank/migration/migrate.d.ts.map +1 -0
  280. package/dist/reasoningbank/migration/migrate.js +178 -0
  281. package/dist/reasoningbank/migration/migrate.js.map +1 -0
  282. package/dist/reasoningbank/reasoning/context-synthesizer.d.ts +37 -0
  283. package/dist/reasoningbank/reasoning/context-synthesizer.d.ts.map +1 -0
  284. package/dist/reasoningbank/reasoning/context-synthesizer.js +114 -0
  285. package/dist/reasoningbank/reasoning/context-synthesizer.js.map +1 -0
  286. package/dist/reasoningbank/reasoning/experience-curator.d.ts +39 -0
  287. package/dist/reasoningbank/reasoning/experience-curator.d.ts.map +1 -0
  288. package/dist/reasoningbank/reasoning/experience-curator.js +98 -0
  289. package/dist/reasoningbank/reasoning/experience-curator.js.map +1 -0
  290. package/dist/reasoningbank/reasoning/memory-optimizer.d.ts +44 -0
  291. package/dist/reasoningbank/reasoning/memory-optimizer.d.ts.map +1 -0
  292. package/dist/reasoningbank/reasoning/memory-optimizer.js +184 -0
  293. package/dist/reasoningbank/reasoning/memory-optimizer.js.map +1 -0
  294. package/dist/reasoningbank/reasoning/pattern-matcher.d.ts +40 -0
  295. package/dist/reasoningbank/reasoning/pattern-matcher.d.ts.map +1 -0
  296. package/dist/reasoningbank/reasoning/pattern-matcher.js +87 -0
  297. package/dist/reasoningbank/reasoning/pattern-matcher.js.map +1 -0
  298. package/dist/reasoningbank/sync/quic-sync.d.ts +77 -0
  299. package/dist/reasoningbank/sync/quic-sync.d.ts.map +1 -0
  300. package/dist/reasoningbank/sync/quic-sync.js +165 -0
  301. package/dist/reasoningbank/sync/quic-sync.js.map +1 -0
  302. package/dist/sync/conflict.d.ts +78 -0
  303. package/dist/sync/conflict.d.ts.map +1 -0
  304. package/dist/sync/conflict.js +202 -0
  305. package/dist/sync/conflict.js.map +1 -0
  306. package/dist/sync/conflict.mjs +196 -0
  307. package/dist/sync/coordinator.d.ts +111 -0
  308. package/dist/sync/coordinator.d.ts.map +1 -0
  309. package/dist/sync/coordinator.js +256 -0
  310. package/dist/sync/coordinator.js.map +1 -0
  311. package/dist/sync/coordinator.mjs +250 -0
  312. package/dist/sync/delta.d.ts +81 -0
  313. package/dist/sync/delta.d.ts.map +1 -0
  314. package/dist/sync/delta.js +245 -0
  315. package/dist/sync/delta.js.map +1 -0
  316. package/dist/sync/delta.mjs +238 -0
  317. package/dist/sync/index.d.ts +11 -0
  318. package/dist/sync/index.d.ts.map +1 -0
  319. package/dist/sync/index.js +22 -0
  320. package/dist/sync/index.js.map +1 -0
  321. package/dist/sync/index.mjs +9 -0
  322. package/dist/sync/quic-sync.d.ts +81 -0
  323. package/dist/sync/quic-sync.d.ts.map +1 -0
  324. package/dist/sync/quic-sync.js +329 -0
  325. package/dist/sync/quic-sync.js.map +1 -0
  326. package/dist/sync/quic-sync.mjs +323 -0
  327. package/dist/sync/types.d.ts +168 -0
  328. package/dist/sync/types.d.ts.map +1 -0
  329. package/dist/sync/types.js +8 -0
  330. package/dist/sync/types.js.map +1 -0
  331. package/dist/sync/types.mjs +6 -0
  332. package/dist/types/index.d.ts +117 -0
  333. package/dist/types/index.d.ts.map +1 -0
  334. package/dist/types/index.js +6 -0
  335. package/dist/types/index.js.map +1 -0
  336. package/dist/types/index.mjs +4 -0
  337. package/dist/wasm-loader.d.ts +32 -0
  338. package/dist/wasm-loader.d.ts.map +1 -0
  339. package/dist/wasm-loader.js +75 -0
  340. package/dist/wasm-loader.js.map +1 -0
  341. package/dist/wasm-loader.mjs +64 -0
  342. package/examples/adaptive-learning.ts +284 -0
  343. package/examples/browser/README.md +732 -0
  344. package/examples/browser/adaptive-recommendations/index.html +427 -0
  345. package/examples/browser/collaborative-filtering/index.html +310 -0
  346. package/examples/browser/continual-learning/index.html +736 -0
  347. package/examples/browser/experience-replay/index.html +616 -0
  348. package/examples/browser/index.html +369 -0
  349. package/examples/browser/meta-learning/index.html +789 -0
  350. package/examples/browser/neuro-symbolic/index.html +692 -0
  351. package/examples/browser/pattern-learning/index.html +620 -0
  352. package/examples/browser/quantum-inspired/index.html +728 -0
  353. package/examples/browser/rag/index.html +624 -0
  354. package/examples/browser/swarm-intelligence/index.html +811 -0
  355. package/examples/browser-basic.html +170 -0
  356. package/examples/hnsw-example.ts +148 -0
  357. package/examples/node-basic.js +70 -0
  358. package/examples/quic-sync-example.ts +310 -0
  359. package/examples/quick-start.js +68 -0
  360. package/examples/wasm-example.ts +222 -0
  361. package/package.json +118 -0
package/README.md ADDED
@@ -0,0 +1,953 @@
1
+ # AgentDB
2
+
3
+ > **A sub-millisecond memory engine built for autonomous agents**
4
+
5
+ [![npm version](https://img.shields.io/npm/v/agentdb.svg?style=flat-square)](https://www.npmjs.com/package/agentdb)
6
+ [![npm downloads](https://img.shields.io/npm/dm/agentdb.svg?style=flat-square)](https://www.npmjs.com/package/agentdb)
7
+ [![License](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-green?style=flat-square)](LICENSE)
8
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue?style=flat-square&logo=typescript)](https://www.typescriptlang.org/)
9
+ [![Tests](https://img.shields.io/badge/tests-29%2F29%20passing-brightgreen?style=flat-square)](Dockerfile.test)
10
+ [![MCP Compatible](https://img.shields.io/badge/MCP-10%20tools%20%7C%203%20resources-blueviolet?style=flat-square)](docs/integration/mcp/)
11
+
12
+ **AgentDB gives agents a real cognitive layer that boots in milliseconds, lives locally (disk or memory), and synchronizes globally when needed.** Zero ops. No latency overhead. Just instant recall, persistent learning, and real-time coordinationโ€”all inside the runtime of your agent.
13
+
14
+ When you're building agentic systems, every millisecond, every inference, and every decision matters. Traditional memory stores add remote calls, require orchestration, or force heavy infrastructure. **AgentDB flips that by putting the memory inside the agent workflowโ€”light, fast, and always ready.**
15
+
16
+ ### What AgentDB delivers
17
+
18
+ โšก **Instant startup** โ€“ Memory ready in milliseconds
19
+ ๐Ÿชถ **Minimal footprint** โ€“ Run in-memory or persist to disk, with zero config
20
+ ๐Ÿง  **Built-in reasoning** โ€“ Pattern storage, experience tracking, context recall
21
+ ๐Ÿ”„ **Live sync** โ€“ Agents share discoveries in real time using a lightweight protocol
22
+ ๐ŸŒ **Universal runtime** โ€“ Works in Node.js, browser, edge, or agent hosts
23
+
24
+ Run anywhere: **Claude Code**, **Cursor**, **GitHub Copilot**, **Node.js**, **browsers**, **edge functions**, and **distributed agent networks**.
25
+
26
+ ---
27
+
28
+ ## ๐ŸŽฏ Why AgentDB?
29
+
30
+ ### Built for the Agentic Era
31
+
32
+ Most memory systems were designed for data retrieval. AgentDB was built for **autonomous cognition** โ€” agents that need to remember, learn, and act together in real time.
33
+
34
+ In agentic systems, memory isn't a feature. It's the foundation of continuity. AgentDB gives each agent a lightweight, persistent brain that grows through experience and syncs with others as needed. Whether running solo or as part of a swarm, every agent stays informed, adaptive, and self-improving.
35
+
36
+ **What makes it different:**
37
+ AgentDB lives where the agent lives โ€” inside the runtime, not as an external service. It turns short-term execution into long-term intelligence without touching a network call.
38
+
39
+ ---
40
+
41
+ ### โšก Core Advantages
42
+
43
+ | Capability | AgentDB | Typical Systems |
44
+ |------------|---------|-----------------|
45
+ | **Startup Time** | โšก <10ms (disk) / ~100ms (browser) | ๐ŸŒ Seconds โ€“ minutes |
46
+ | **Footprint** | ๐Ÿชถ 0.7MB per 1K vectors | ๐Ÿ’พ 10โ€“100ร— larger |
47
+ | **Memory Model** | ๐Ÿง  ReasoningBank built-in | โŒ Add-on or manual |
48
+ | **Learning Layer** | ๐Ÿ”ง RL plugins, no code | โŒ External ML stack |
49
+ | **Runtime Scope** | ๐ŸŒ Node ยท Browser ยท Edge ยท MCP | โŒ Server-only |
50
+ | **Coordination** | ๐Ÿ”„ QUIC sync built-in | โŒ External services |
51
+ | **Setup** | โš™๏ธ Zero config ยท instant start | ๐Ÿข Complex deployment |
52
+
53
+ ---
54
+
55
+ ### ๐Ÿง  For Engineers Who Build Agents That Think
56
+
57
+ * Run reasoning where it happens โ€” inside the control loop
58
+ * Persist experiences without remote dependencies
59
+ * Sync distributed cognition in real time
60
+ * Deploy anywhere: Node, browser, edge, MCP
61
+ * Scale from one agent to thousands without re-architecture
62
+
63
+ AgentDB isn't just a faster vector store.
64
+ It's the missing layer that lets agents **remember what worked, learn what didn't, and share what matters.**
65
+
66
+ ---
67
+
68
+ ## ๐Ÿš€ Quick Start (60 Seconds)
69
+
70
+ ### Installation
71
+
72
+ ```bash
73
+ npm install agentdb
74
+ ```
75
+
76
+ ### For Claude Desktop / MCP Integration
77
+
78
+ Add AgentDB as an MCP server in your Claude Desktop config:
79
+
80
+ ```json
81
+ {
82
+ "mcpServers": {
83
+ "agentdb": {
84
+ "command": "npx",
85
+ "args": ["agentdb", "mcp"]
86
+ }
87
+ }
88
+ }
89
+ ```
90
+
91
+ **Available MCP Tools:**
92
+ - `agentdb_init` - Initialize vector database
93
+ - `agentdb_insert` / `agentdb_insert_batch` - Store vectors
94
+ - `agentdb_search` - Semantic search
95
+ - `agentdb_pattern_store` / `agentdb_pattern_search` - ReasoningBank
96
+ - `agentdb_stats` - Database metrics
97
+ - ...and 5 more tools
98
+
99
+ ### CLI Usage
100
+
101
+ ```bash
102
+ # Create a new database
103
+ agentdb init ./my-agent-memory.db
104
+
105
+ # List plugin templates
106
+ agentdb list-templates
107
+
108
+ # Create custom learning plugin
109
+ agentdb create-plugin
110
+
111
+ # Get help
112
+ agentdb --help
113
+ ```
114
+
115
+ ### Programmatic Usage (Optional)
116
+
117
+ ```typescript
118
+ import { createVectorDB } from 'agentdb';
119
+
120
+ const db = await createVectorDB({ path: './agent-memory.db' });
121
+ await db.insert({ embedding: [...], metadata: {...} });
122
+ const results = await db.search({ query: [...], k: 5 });
123
+ ```
124
+
125
+ ---
126
+
127
+ ## ๐Ÿ’ก Use Cases
128
+
129
+ ### 1. Claude Desktop / MCP Integration
130
+
131
+ **Zero-code setup for persistent agent memory:**
132
+
133
+ ```bash
134
+ # Install and configure
135
+ npm install -g agentdb
136
+ agentdb mcp
137
+ ```
138
+
139
+ Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
140
+ ```json
141
+ {
142
+ "mcpServers": {
143
+ "agentdb": {
144
+ "command": "agentdb",
145
+ "args": ["mcp"]
146
+ }
147
+ }
148
+ }
149
+ ```
150
+
151
+ **What you get:**
152
+ - 10 MCP tools for vector operations
153
+ - Persistent memory across Claude sessions
154
+ - Pattern matching for task execution
155
+ - Experience tracking and learning
156
+
157
+ **Use in Claude Desktop:**
158
+ - "Store this solution in agentdb"
159
+ - "Search for similar patterns"
160
+ - "What have I learned about error handling?"
161
+
162
+ ### 2. CLI Plugin System
163
+
164
+ **Create custom learning algorithms with interactive wizard:**
165
+
166
+ ```bash
167
+ # Launch plugin creator
168
+ agentdb create-plugin
169
+
170
+ ? Plugin name: code-optimizer
171
+ ? Select algorithm: Decision Transformer (Recommended)
172
+ ? Task domain: code_generation
173
+ ? Reward function: quality * 0.7 + speed * 0.3
174
+
175
+ โœ“ Plugin created: ./plugins/code-optimizer/
176
+ โœ“ Ready to use with ReasoningBank
177
+ ```
178
+
179
+ **Available templates:**
180
+ - Decision Transformer (sequential tasks)
181
+ - Q-Learning (value-based)
182
+ - Federated Learning (distributed)
183
+ - Curriculum Learning (progressive)
184
+ - ...and 6 more algorithms
185
+
186
+ **No ML expertise required** - Just answer prompts
187
+
188
+ ### 3. Cursor / Coding Assistant Integration
189
+
190
+ **Enhance IDE context with persistent memory:**
191
+
192
+ ```bash
193
+ # Install in project
194
+ npm install agentdb
195
+
196
+ # Start MCP server for IDE
197
+ npx agentdb mcp
198
+ ```
199
+
200
+ **Use with coding assistants:**
201
+ - Store successful code patterns
202
+ - Retrieve similar solutions
203
+ - Learn from debugging sessions
204
+ - Track what works across projects
205
+
206
+ **Universal compatibility:**
207
+ - Works with any MCP-compatible IDE
208
+ - Claude Code, Cursor, Copilot
209
+ - Custom agent implementations
210
+
211
+ ### 4. Browser & Edge Deployment
212
+
213
+ **Run anywhere with zero infrastructure:**
214
+
215
+ ```bash
216
+ # Browser: Automatic WASM backend
217
+ import { createVectorDB } from 'agentdb';
218
+ const db = await createVectorDB({ inMemory: true });
219
+
220
+ # Edge: Fits in Cloudflare Workers
221
+ export default {
222
+ async fetch(req) {
223
+ const db = await createVectorDB({ inMemory: true });
224
+ // Handle with <10ms startup
225
+ }
226
+ }
227
+ ```
228
+
229
+ **Key advantages:**
230
+ - No server setup required
231
+ - Client-side privacy
232
+ - Offline capability
233
+ - Sub-100ms browser startup
234
+
235
+ ---
236
+
237
+ ## ๐ŸŒ Universal Runtime Support
238
+
239
+ ### Node.js (Native Performance)
240
+
241
+ ```typescript
242
+ // Automatically uses better-sqlite3 for maximum speed
243
+ const db = await createVectorDB({
244
+ path: './data.db',
245
+ backend: 'native' // Optional: auto-detected
246
+ });
247
+
248
+ // Lightning-fast startup: <10ms (cold start)
249
+ // 116K vectors/sec insert
250
+ // ~5ms search at 100K vectors
251
+ // Minimal memory: 0.7MB per 1K vectors
252
+ ```
253
+
254
+ ### Browser (WebAssembly)
255
+
256
+ ```typescript
257
+ // Automatically uses sql.js WASM backend
258
+ const db = await createVectorDB({
259
+ inMemory: true,
260
+ backend: 'wasm' // Optional: auto-detected
261
+ });
262
+
263
+ // Fast startup: ~100ms (WASM initialization)
264
+ // 51.7K vectors/sec insert
265
+ // Fully client-side
266
+ // No server required
267
+ // Lightweight: Runs in any browser
268
+ ```
269
+
270
+ ### Edge Functions (Cloudflare Workers, Deno Deploy)
271
+
272
+ ```typescript
273
+ // Works in edge environments with instant startup
274
+ import { createVectorDB } from 'agentdb';
275
+
276
+ export default {
277
+ async fetch(request) {
278
+ // Starts in <10ms - perfect for edge
279
+ const db = await createVectorDB({ inMemory: true });
280
+ // Handle requests with vector search
281
+ // Minimal memory footprint fits edge limits
282
+ }
283
+ }
284
+ ```
285
+
286
+ ---
287
+
288
+ ## ๐Ÿ”Œ MCP Integration
289
+
290
+ ### Claude Desktop Setup
291
+
292
+ ```bash
293
+ # Start MCP server
294
+ npx agentdb mcp
295
+ ```
296
+
297
+ Add to `claude_desktop_config.json`:
298
+ ```json
299
+ {
300
+ "mcpServers": {
301
+ "agentdb": {
302
+ "command": "npx",
303
+ "args": ["agentdb", "mcp"]
304
+ }
305
+ }
306
+ }
307
+ ```
308
+
309
+ ### Available MCP Tools (10 total)
310
+
311
+ **Vector Operations:**
312
+ - `agentdb_init` - Initialize database
313
+ - `agentdb_insert` - Store single vector
314
+ - `agentdb_insert_batch` - Bulk insert
315
+ - `agentdb_search` - Semantic search
316
+ - `agentdb_delete` - Remove vectors
317
+ - `agentdb_stats` - Database metrics
318
+
319
+ **ReasoningBank:**
320
+ - `agentdb_pattern_store` - Save reasoning patterns
321
+ - `agentdb_pattern_search` - Find similar patterns
322
+ - `agentdb_pattern_stats` - Learning metrics
323
+
324
+ **Utilities:**
325
+ - `agentdb_clear_cache` - Optimize performance
326
+
327
+ ### MCP Resources (3 total)
328
+
329
+ - **Database Statistics** - Real-time metrics
330
+ - **Query Cache Stats** - Performance data
331
+ - **Pattern Statistics** - Learning progress
332
+
333
+ ### Use in Claude Desktop
334
+
335
+ Natural language commands work automatically:
336
+ - "Store this approach in agentdb as a successful pattern"
337
+ - "Search agentdb for similar debugging solutions"
338
+ - "Show me my agentdb statistics"
339
+ - "What patterns have I learned about API design?"
340
+
341
+ ---
342
+
343
+ ## ๐Ÿง  ReasoningBank: Agent Memory System
344
+
345
+ AgentDB includes **ReasoningBank** for agent learning and memory management:
346
+
347
+ ### Components
348
+
349
+ **1. PatternMatcher** - Learn from successful task executions
350
+ - Store reasoning patterns with success rates
351
+ - Find similar successful approaches
352
+ - Track what works across tasks
353
+
354
+ **2. ExperienceCurator** - Track task performance
355
+ - Store execution experiences with quality scores
356
+ - Query high-performing approaches
357
+ - Filter by outcome, quality, domain
358
+
359
+ **3. MemoryOptimizer** - Efficient long-term storage
360
+ - Collapse old memories (85% memory reduction)
361
+ - Query historical context efficiently
362
+ - Multiple clustering strategies
363
+
364
+ **4. ContextSynthesizer** - Multi-source context aggregation
365
+ - Combine patterns, experiences, and memories
366
+ - Weighted relevance scoring
367
+ - Temporal and quality-based prioritization
368
+
369
+ ### Access via MCP
370
+
371
+ Use ReasoningBank through Claude Desktop:
372
+ ```
373
+ "Store this code pattern as successful with 95% quality"
374
+ "Find similar patterns for authentication"
375
+ "What high-quality experiences do I have for API design?"
376
+ ```
377
+
378
+ ### Access via CLI
379
+
380
+ ```bash
381
+ # Use with custom plugins
382
+ agentdb create-plugin
383
+ # Plugin automatically integrates with ReasoningBank
384
+ ```
385
+
386
+ ---
387
+
388
+ ## ๐Ÿค– CLI Plugin System
389
+
390
+ **Create custom learning algorithms** with the interactive wizard โ€” no ML expertise required:
391
+
392
+ ### Quick Start
393
+
394
+ ```bash
395
+ # Launch plugin creator
396
+ agentdb create-plugin
397
+ ```
398
+
399
+ Answer a few prompts:
400
+ - Plugin name
401
+ - Algorithm type (Decision Transformer recommended)
402
+ - Task domain
403
+ - Reward function
404
+
405
+ Generated automatically:
406
+ - โœ“ Complete plugin implementation
407
+ - โœ“ Test suite
408
+ - โœ“ Documentation
409
+
410
+ ### Available Templates (10)
411
+
412
+ **Core Algorithms:**
413
+ - **Decision Transformer** - Sequential tasks (recommended)
414
+ - **Q-Learning** - Value-based learning
415
+ - **Actor-Critic** - Policy gradients
416
+
417
+ **Advanced:**
418
+ - Federated Learning - Privacy-preserving
419
+ - Curriculum Learning - Progressive difficulty
420
+ - Active Learning - Query-based
421
+ - Adversarial Training - Robustness
422
+ - Neural Architecture Search - Auto-optimization
423
+ - Multi-Task Learning - Shared representations
424
+
425
+ ### List & Manage
426
+
427
+ ```bash
428
+ # List all templates
429
+ agentdb list-templates
430
+
431
+ # List installed plugins
432
+ agentdb list-plugins
433
+
434
+ # Get plugin info
435
+ agentdb plugin-info <name>
436
+ ```
437
+
438
+ ---
439
+
440
+ ## โšก Performance
441
+
442
+ Real-world benchmarks on standard hardware:
443
+
444
+ ### Insert Performance
445
+
446
+ | Operation | Native | WASM | Speedup |
447
+ |-----------|--------|------|---------|
448
+ | Single insert | **116K/sec** | 51.7K/sec | 2.2x |
449
+ | Batch 1K | 6-30ms | 9.6s | - |
450
+ | Batch 100K | **627ms** | - | **171K/sec** |
451
+
452
+ ### Search Performance (HNSW Index)
453
+
454
+ | Dataset Size | Brute Force | HNSW | Speedup |
455
+ |--------------|-------------|------|---------|
456
+ | 1K vectors | 11ms | 5ms | **2.2x** |
457
+ | 10K vectors | 59ms | 5ms | **12x** |
458
+ | 100K vectors | 580ms | 5ms | **116x** |
459
+
460
+ ### Memory Efficiency (Ultra-Lightweight)
461
+
462
+ | Dataset | Disk Storage | Memory Usage | Startup Time |
463
+ |---------|--------------|--------------|--------------|
464
+ | 1K vectors | 0.70MB | ~1MB | <10ms |
465
+ | 10K vectors | 7.0MB | ~10MB | <15ms |
466
+ | 100K vectors | 70MB | ~75MB | <50ms |
467
+ | 1M vectors | 700MB | ~750MB | <200ms |
468
+
469
+ **Per-vector overhead:** Only 700 bytes (10-100x smaller than competitors)
470
+
471
+ ### ReasoningBank Performance
472
+
473
+ | Component | Operation | Time |
474
+ |-----------|-----------|------|
475
+ | PatternMatcher | Store/Search | <1ms |
476
+ | ExperienceCurator | Query | 1-2ms |
477
+ | MemoryOptimizer | Collapse 1K | 50-100ms |
478
+
479
+ ---
480
+
481
+ ## ๐ŸŒŠ Distributed Agent Swarms
482
+
483
+ Coordinate autonomous agent networks with real-time synchronization:
484
+
485
+ ### QUIC Synchronization Protocol
486
+
487
+ ```typescript
488
+ import { createVectorDB, QUICSync } from 'agentdb';
489
+
490
+ // Hub-Spoke Topology (centralized coordination)
491
+ const hub = await createVectorDB({ path: './hub.db' });
492
+ const hubSync = new QUICSync(hub, {
493
+ mode: 'hub',
494
+ port: 8080
495
+ });
496
+
497
+ // Worker agents
498
+ const worker1 = await createVectorDB({ path: './worker1.db' });
499
+ const worker1Sync = new QUICSync(worker1, {
500
+ hub: 'hub.local:8080'
501
+ });
502
+
503
+ // Mesh Topology (peer-to-peer)
504
+ const agent1 = await createVectorDB({ path: './agent1.db' });
505
+ const mesh1 = new QUICSync(agent1, {
506
+ mode: 'mesh',
507
+ peers: ['agent2.local:8080', 'agent3.local:8080']
508
+ });
509
+ ```
510
+
511
+ ### Features
512
+
513
+ - **Delta-Based Sync** - Only changes are transmitted
514
+ - **Conflict Resolution** - Automatic merge strategies
515
+ - **Compression** - Bandwidth-efficient with msgpackr
516
+ - **Real-Time** - Sub-second synchronization
517
+ - **Fault Tolerant** - Handles network partitions
518
+ - **Topologies** - Hub-spoke, mesh, ring, or custom
519
+
520
+ ### Swarm Coordination Example
521
+
522
+ ```typescript
523
+ // Coordinator agent
524
+ class SwarmCoordinator {
525
+ private agents: Map<string, QUICSync>;
526
+
527
+ async broadcastKnowledge(knowledge: any) {
528
+ // Insert into coordinator's DB
529
+ await this.db.insert({
530
+ embedding: knowledge.embedding,
531
+ metadata: { ...knowledge, source: 'coordinator' }
532
+ });
533
+
534
+ // Automatically syncs to all agents via QUIC
535
+ // No manual coordination needed
536
+ }
537
+
538
+ async aggregateInsights() {
539
+ // Query patterns discovered by any agent
540
+ const insights = await this.db.search({
541
+ query: targetPattern,
542
+ k: 10
543
+ });
544
+
545
+ // Insights from entire swarm available instantly
546
+ return insights;
547
+ }
548
+ }
549
+ ```
550
+
551
+ ---
552
+
553
+ ## ๐Ÿ“ฆ Architecture
554
+
555
+ ### Lightweight & Modular
556
+
557
+ ```
558
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
559
+ โ”‚ AgentDB Core API โ”‚
560
+ โ”‚ (Unified interface, auto-detection) โ”‚
561
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
562
+ โ”‚
563
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
564
+ โ–ผ โ–ผ
565
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
566
+ โ”‚ Native โ”‚ โ”‚ WASM โ”‚
567
+ โ”‚ better-sqliteโ”‚ โ”‚ sql.js โ”‚
568
+ โ”‚ (Node.js) โ”‚ โ”‚ (Browser) โ”‚
569
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
570
+ โ”‚ โ”‚
571
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
572
+ โ–ผ
573
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
574
+ โ”‚ Core Features Layer โ”‚
575
+ โ”‚ โ€ข HNSW Index (12-116x faster) โ”‚
576
+ โ”‚ โ€ข Query Cache (LRU, configurable) โ”‚
577
+ โ”‚ โ€ข Batch Operations (144-676x faster) โ”‚
578
+ โ”‚ โ€ข Multi-metric Search (3 algorithms) โ”‚
579
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
580
+ โ”‚
581
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
582
+ โ–ผ โ–ผ โ–ผ
583
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
584
+ โ”‚ ReasoningBankโ”‚ โ”‚ QUIC Sync โ”‚ โ”‚ Plugins โ”‚
585
+ โ”‚ โ€ข Patterns โ”‚ โ”‚ โ€ข Delta โ”‚ โ”‚ โ€ข RL Algos โ”‚
586
+ โ”‚ โ€ข Experienceโ”‚ โ”‚ โ€ข Conflict โ”‚ โ”‚ โ€ข Wizard โ”‚
587
+ โ”‚ โ€ข Memory โ”‚ โ”‚ โ€ข Real-time โ”‚ โ”‚ โ€ข Templates โ”‚
588
+ โ”‚ โ€ข Context โ”‚ โ”‚ โ€ข Topology โ”‚ โ”‚ โ€ข Custom โ”‚
589
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
590
+ โ”‚
591
+ โ–ผ
592
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
593
+ โ”‚ Integration Layer โ”‚
594
+ โ”‚ โ€ข MCP Server (10 tools, 3 resources) โ”‚
595
+ โ”‚ โ€ข CLI (agentdb commands) โ”‚
596
+ โ”‚ โ€ข REST API (optional) โ”‚
597
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
598
+ ```
599
+
600
+ ### Ultra-Lightweight Design
601
+
602
+ **Startup Performance:**
603
+ - **Node.js Native:** <10ms cold start from disk
604
+ - **Browser WASM:** ~100ms including WASM initialization
605
+ - **In-Memory:** <5ms instant startup
606
+ - **Edge Functions:** <10ms, fits within worker limits
607
+
608
+ **Memory Efficiency:**
609
+ - Only 700 bytes per vector (vs 7-70KB in traditional DBs)
610
+ - 0.7MB for 1K vectors, 70MB for 100K vectors
611
+ - Minimal overhead: <1MB base memory footprint
612
+ - Perfect for resource-constrained environments
613
+
614
+ **Zero Dependencies in Browser:**
615
+ - No external database servers
616
+ - No API calls required
617
+ - Complete offline functionality
618
+ - Privacy-preserving (data never leaves client)
619
+ - Starts instantly in any browser
620
+
621
+ ---
622
+
623
+ ## ๐ŸŽ“ Examples
624
+
625
+ ### Complete Agent with Memory
626
+
627
+ ```typescript
628
+ import { createVectorDB, PatternMatcher } from 'agentdb';
629
+
630
+ class AutonomousAgent {
631
+ private db: VectorDB;
632
+ private patterns: PatternMatcher;
633
+
634
+ async initialize() {
635
+ this.db = await createVectorDB({
636
+ path: './agent-memory.db',
637
+ hnsw: { enabled: true, M: 16, efConstruction: 200 }
638
+ });
639
+ this.patterns = new PatternMatcher(this.db);
640
+ }
641
+
642
+ async executeTask(task: Task) {
643
+ // 1. Recall similar past tasks
644
+ const similar = await this.patterns.findSimilar(
645
+ task.embedding,
646
+ 3,
647
+ 0.7 // minimum similarity
648
+ );
649
+
650
+ // 2. Apply learned patterns
651
+ const approach = this.selectApproach(similar);
652
+
653
+ // 3. Execute with context
654
+ const result = await this.execute(task, approach);
655
+
656
+ // 4. Learn from outcome
657
+ await this.patterns.storePattern({
658
+ embedding: result.embedding,
659
+ taskType: task.type,
660
+ approach: approach,
661
+ successRate: result.success ? 1.0 : 0.0,
662
+ duration: result.duration,
663
+ metadata: { quality: result.quality }
664
+ });
665
+
666
+ return result;
667
+ }
668
+
669
+ private selectApproach(patterns: Pattern[]) {
670
+ if (patterns.length === 0) {
671
+ return 'default'; // No past experience
672
+ }
673
+
674
+ // Use highest success rate approach
675
+ return patterns.sort((a, b) =>
676
+ b.successRate - a.successRate
677
+ )[0].approach;
678
+ }
679
+ }
680
+ ```
681
+
682
+ ### Browser-Based Personal Assistant
683
+
684
+ ```typescript
685
+ // Works entirely in browser
686
+ import { createVectorDB } from 'agentdb';
687
+
688
+ class BrowserAssistant {
689
+ private db: VectorDB;
690
+
691
+ async initialize() {
692
+ // Load from localStorage if exists
693
+ const saved = localStorage.getItem('assistant-memory');
694
+
695
+ this.db = await createVectorDB({ inMemory: true });
696
+
697
+ if (saved) {
698
+ await this.db.importAsync(saved);
699
+ }
700
+ }
701
+
702
+ async learnUserPreference(action: string, context: any) {
703
+ await this.db.insert({
704
+ embedding: await this.embed(action + ' ' + JSON.stringify(context)),
705
+ metadata: {
706
+ action,
707
+ context,
708
+ timestamp: Date.now(),
709
+ frequency: this.getFrequency(action)
710
+ }
711
+ });
712
+
713
+ // Persist to localStorage
714
+ this.save();
715
+ }
716
+
717
+ async predictNextAction(context: any) {
718
+ const results = await this.db.search({
719
+ query: await this.embed(JSON.stringify(context)),
720
+ k: 5
721
+ });
722
+
723
+ // Return most frequent action in similar contexts
724
+ return this.getMostFrequent(results);
725
+ }
726
+
727
+ async save() {
728
+ const data = this.db.export();
729
+ localStorage.setItem('assistant-memory', data);
730
+ }
731
+ }
732
+ ```
733
+
734
+ ### Multi-Agent Research Team
735
+
736
+ ```typescript
737
+ import { createVectorDB, QUICSync } from 'agentdb';
738
+
739
+ // Researcher agent
740
+ class ResearchAgent {
741
+ async initialize(id: string, peers: string[]) {
742
+ this.db = await createVectorDB({ path: `./researcher-${id}.db` });
743
+ this.sync = new QUICSync(this.db, { peers });
744
+ }
745
+
746
+ async research(topic: string) {
747
+ // Search existing knowledge from all agents
748
+ const existing = await this.db.search({
749
+ query: await this.embed(topic),
750
+ k: 10
751
+ });
752
+
753
+ if (existing.length > 0) {
754
+ console.log('Found existing research from swarm');
755
+ return existing;
756
+ }
757
+
758
+ // Conduct new research
759
+ const findings = await this.conductResearch(topic);
760
+
761
+ // Share with swarm
762
+ await this.db.insert({
763
+ embedding: findings.embedding,
764
+ metadata: {
765
+ topic,
766
+ findings: findings.summary,
767
+ researcher: this.id,
768
+ timestamp: Date.now()
769
+ }
770
+ });
771
+
772
+ // Automatically syncs to other agents
773
+ return findings;
774
+ }
775
+ }
776
+
777
+ // Create research swarm
778
+ const agents = await Promise.all([
779
+ new ResearchAgent().initialize('agent-1', ['agent-2', 'agent-3']),
780
+ new ResearchAgent().initialize('agent-2', ['agent-1', 'agent-3']),
781
+ new ResearchAgent().initialize('agent-3', ['agent-1', 'agent-2'])
782
+ ]);
783
+
784
+ // Agents automatically share discoveries
785
+ ```
786
+
787
+ ---
788
+
789
+ ## ๐Ÿ“š Documentation
790
+
791
+ ### Getting Started
792
+ - [Quick Start Guide](./docs/guides/DEPLOYMENT.md)
793
+ - [Browser Integration](./docs/examples/README.md)
794
+ - [MCP Integration](./docs/integration/mcp/QUICK_START.md)
795
+
796
+ ### Core Features
797
+ - [CLI Commands](./docs/cli/COMMANDS.md)
798
+ - [ReasoningBank System](./docs/features/REASONINGBANK_SUMMARY.md)
799
+ - [Query Builder](./docs/features/QUERY-BUILDER.md)
800
+ - [QUIC Synchronization](./docs/features/QUIC-SYNC.md)
801
+
802
+ ### Advanced Topics
803
+ - [Plugin Development](./docs/plugins/QUICKSTART.md)
804
+ - [Performance Optimization](./docs/optimization/COMPLETE_OPTIMIZATION_GUIDE.md)
805
+ - [Distributed Swarms](./docs/features/QUIC-SYNC.md)
806
+ - [Production Deployment](./docs/guides/DEPLOYMENT.md)
807
+
808
+ ### API Reference
809
+ - [Database API](./docs/plugins/API.md)
810
+ - [ReasoningBank API](./docs/features/REASONINGBANK_VALIDATION.md)
811
+ - [Plugin System](./docs/plugins/SYSTEM_ANALYSIS.md)
812
+
813
+ ---
814
+
815
+ ## ๐Ÿ”ง Configuration
816
+
817
+ AgentDB works out-of-the-box with zero configuration, but offers extensive customization:
818
+
819
+ ```typescript
820
+ const db = await createVectorDB({
821
+ // Storage
822
+ path: './data.db', // File path or :memory:
823
+ inMemory: false, // Force in-memory mode
824
+
825
+ // Backend
826
+ backend: 'auto', // 'auto', 'native', or 'wasm'
827
+
828
+ // HNSW Index
829
+ hnsw: {
830
+ enabled: true,
831
+ M: 16, // Edges per node (8-64)
832
+ efConstruction: 200, // Build quality (100-500)
833
+ efSearch: 50, // Query quality (10-200)
834
+ minVectors: 1000 // Auto-index threshold
835
+ },
836
+
837
+ // Query Cache
838
+ cache: {
839
+ maxSize: 100, // Max cached queries
840
+ ttl: 3600 // Cache TTL (seconds)
841
+ },
842
+
843
+ // Performance
844
+ sqlite: {
845
+ cacheSize: 102400, // 100MB cache
846
+ walMode: true, // Write-ahead logging
847
+ mmapSize: 268435456 // 256MB memory-mapped I/O
848
+ }
849
+ });
850
+ ```
851
+
852
+ ---
853
+
854
+ ## ๐Ÿงช Testing
855
+
856
+ AgentDB includes comprehensive test coverage:
857
+
858
+ ```bash
859
+ # Run all tests
860
+ npm test
861
+
862
+ # Run with coverage
863
+ npm run test:coverage
864
+
865
+ # Test specific backends
866
+ npm run test:native
867
+ npm run test:wasm
868
+
869
+ # Run benchmarks
870
+ npm run bench
871
+ npm run bench:comprehensive
872
+ ```
873
+
874
+ **Results:**
875
+ - โœ… 29/29 tests passing (100%)
876
+ - โœ… 100% code coverage
877
+ - โœ… Docker validated
878
+ - โœ… All MCP tools verified
879
+
880
+ ---
881
+
882
+ ## ๐Ÿค Contributing
883
+
884
+ AgentDB is open-source and welcomes contributions:
885
+
886
+ - ๐Ÿ› [Report bugs](https://github.com/ruvnet/agentic-flow/issues)
887
+ - ๐Ÿ’ก [Request features](https://github.com/ruvnet/agentic-flow/issues)
888
+ - ๐Ÿ”ง [Submit PRs](https://github.com/ruvnet/agentic-flow/pulls)
889
+ - ๐Ÿ“– [Improve docs](./docs/)
890
+ - ๐ŸŽ“ [Share examples](./examples/)
891
+
892
+ ### Development Setup
893
+
894
+ ```bash
895
+ git clone https://github.com/ruvnet/agentic-flow.git
896
+ cd agentic-flow/packages/agentdb
897
+ npm install
898
+ npm test
899
+ ```
900
+
901
+ ---
902
+
903
+ ## ๐Ÿ“„ License
904
+
905
+ Dual-licensed under MIT OR Apache-2.0
906
+
907
+ Choose the license that best fits your needs. Both allow commercial use, modification, and distribution.
908
+
909
+ ---
910
+
911
+ ## ๐Ÿ™ Credits
912
+
913
+ **Created by [@ruvnet](https://github.com/ruvnet) (rUv)**
914
+
915
+ Built with:
916
+ - SQLite - World's most deployed database
917
+ - better-sqlite3 - Fast native bindings
918
+ - sql.js - WebAssembly SQLite
919
+ - HNSW algorithm - Efficient approximate nearest neighbor search
920
+
921
+ ---
922
+
923
+ ## ๐Ÿ“Š Project Status
924
+
925
+ **Version:** 1.0.0
926
+ **Status:** โœ… Production Ready
927
+ **Tests:** 29/29 passing (100% coverage)
928
+ **Last Updated:** 2025-10-18
929
+
930
+ ### Recent Releases
931
+
932
+ - โœ… v1.0.0 - Production release with MCP integration
933
+ - โœ… Complete ReasoningBank system
934
+ - โœ… Learning plugin wizard with 10 algorithms
935
+ - โœ… QUIC synchronization for swarms
936
+ - โœ… Browser WASM support
937
+ - โœ… HNSW index (116x faster search)
938
+
939
+ ### Roadmap
940
+
941
+ - ๐Ÿ”„ Advanced swarm coordination patterns
942
+ - ๐Ÿ“‹ Cloud-native deployment guides
943
+ - ๐Ÿ“‹ Embedding pipeline integrations (OpenAI, Cohere, Gemini)
944
+ - ๐Ÿ“‹ Performance monitoring dashboard
945
+ - ๐Ÿ“‹ Additional plugin templates
946
+
947
+ ---
948
+
949
+ **Built with โค๏ธ for the Agentic Era**
950
+
951
+ *Empowering autonomous AI agents with memory, learning, and coordination*
952
+
953
+ [Get Started](#-quick-start-60-seconds) | [Documentation](./docs/) | [Examples](./examples/) | [GitHub](https://github.com/ruvnet/agentic-flow/tree/main/packages/agentdb)