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
@@ -0,0 +1,732 @@
1
+ # AgentDB Browser Examples - Self-Learning Architectures
2
+
3
+ > **Complete guide to building self-learning client-side AI systems with AgentDB WASM**
4
+
5
+ This collection demonstrates **5 different self-learning architectures** that run entirely in the browser using AgentDB's WebAssembly backend. Each example showcases a unique approach to client-side machine learning, persistent memory, and adaptive behavior.
6
+
7
+ ## 🎯 Overview
8
+
9
+ All examples feature:
10
+ - ✅ **100% Client-Side** - No backend server required
11
+ - ✅ **WASM-Powered** - AgentDB vector database running in browser
12
+ - ✅ **LocalStorage Persistence** - Data survives page refreshes
13
+ - ✅ **Real-Time Learning** - Immediate adaptation to user behavior
14
+ - ✅ **Visual Feedback** - See the learning process in action
15
+ - ✅ **Export/Import** - Portable data for backup and sharing
16
+
17
+ ## 📚 Example Architectures
18
+
19
+ ### 1. RAG Self-Learning (`rag/index.html`)
20
+
21
+ **Retrieval-Augmented Generation with Continuous Learning**
22
+
23
+ Build a knowledge base that learns from user queries and feedback to improve responses over time.
24
+
25
+ #### Key Features
26
+ - Dynamic knowledge base that grows with user contributions
27
+ - Vector-based semantic search for document retrieval
28
+ - Query pattern recognition and optimization
29
+ - Feedback loop for continuous improvement
30
+ - Context-aware response generation
31
+
32
+ #### Learning Mechanism
33
+ 1. User submits query → System searches knowledge base
34
+ 2. Retrieves top-K relevant documents using cosine similarity
35
+ 3. Generates response from retrieved context
36
+ 4. User provides feedback (helpful/not helpful)
37
+ 5. System stores query patterns and adjusts retrieval weights
38
+ 6. Future similar queries benefit from learned patterns
39
+
40
+ #### Use Cases
41
+ - Personal knowledge management systems
42
+ - FAQ chatbots that improve over time
43
+ - Document search with learning capabilities
44
+ - Context-aware help systems
45
+
46
+ ---
47
+
48
+ ### 2. Pattern-Based Learning (`pattern-learning/index.html`)
49
+
50
+ **Learn from User Interaction Patterns and Predict Next Actions**
51
+
52
+ Discover behavioral patterns in user interactions and provide predictive assistance.
53
+
54
+ #### Key Features
55
+ - Automatic pattern detection in task sequences
56
+ - Confidence scoring for pattern reliability
57
+ - Next-action prediction with explanations
58
+ - Temporal pattern analysis (time-aware)
59
+ - Visual timeline of user activity
60
+
61
+ #### Learning Mechanism
62
+ 1. Track user actions (clicks, navigation, tasks)
63
+ 2. Store action sequences as vector embeddings
64
+ 3. Detect frequent patterns using sliding window analysis
65
+ 4. Calculate pattern confidence based on frequency
66
+ 5. Predict next action by matching current sequence
67
+ 6. Adapt UI/UX based on discovered patterns
68
+
69
+ #### Use Cases
70
+ - Workflow optimization tools
71
+ - Predictive UI/UX systems
72
+ - Task automation assistants
73
+ - Smart productivity applications
74
+
75
+ ---
76
+
77
+ ### 3. Experience Replay (`experience-replay/index.html`)
78
+
79
+ **Q-Learning with Experience Buffer (Reinforcement Learning)**
80
+
81
+ Classic RL approach with experience replay for learning optimal strategies in grid-world environment.
82
+
83
+ #### Key Features
84
+ - Q-Learning algorithm implementation
85
+ - Experience replay buffer management
86
+ - Epsilon-greedy exploration strategy
87
+ - Real-time Q-value visualization
88
+ - Auto-play mode for rapid learning
89
+
90
+ #### Learning Mechanism
91
+ 1. Agent takes action in environment (grid navigation)
92
+ 2. Receives reward signal (goal: +10, obstacle: -5, step: -0.1)
93
+ 3. Stores experience tuple (state, action, reward, next_state)
94
+ 4. Samples random batch from replay buffer
95
+ 5. Updates Q-values using Bellman equation
96
+ 6. Policy improves through repeated training
97
+ 7. Success rate increases over episodes
98
+
99
+ #### Use Cases
100
+ - Game AI that learns optimal strategies
101
+ - Resource allocation optimization
102
+ - Path planning and navigation
103
+ - Decision-making under uncertainty
104
+
105
+ ---
106
+
107
+ ### 4. Collaborative Filtering (`collaborative-filtering/index.html`)
108
+
109
+ **Recommendation System Based on Similar User Preferences**
110
+
111
+ Build recommendations by finding users with similar tastes and suggesting items they liked.
112
+
113
+ #### Key Features
114
+ - User similarity calculation (cosine similarity)
115
+ - Item-based and user-based filtering
116
+ - Cold-start problem handling
117
+ - Multi-category preference learning
118
+ - Cross-user pattern transfer
119
+
120
+ #### Learning Mechanism
121
+ 1. User rates items (movies, music, food, games)
122
+ 2. System calculates similarity with other users
123
+ 3. Finds top-K most similar users
124
+ 4. Aggregates their preferences (weighted by similarity)
125
+ 5. Recommends unrated items with highest predicted scores
126
+ 6. Updates similarity as more ratings are provided
127
+
128
+ #### Use Cases
129
+ - Content recommendation engines
130
+ - E-commerce product suggestions
131
+ - Social platform friend recommendations
132
+ - Playlist and media suggestions
133
+
134
+ ---
135
+
136
+ ### 5. Adaptive Recommendations (`adaptive-recommendations/index.html`)
137
+
138
+ **Multi-Armed Bandit with Thompson Sampling**
139
+
140
+ Real-time adaptive recommendation system that balances exploration and exploitation.
141
+
142
+ #### Key Features
143
+ - Thompson Sampling for optimal exploration
144
+ - Beta distribution for each content category
145
+ - Real-time adaptation to user feedback
146
+ - Exploration vs exploitation balance
147
+ - Category preference tracking
148
+
149
+ #### Learning Mechanism
150
+ 1. Maintain Beta distribution (α, β) for each category
151
+ 2. Sample from each distribution to select category
152
+ 3. Show content from selected category
153
+ 4. User provides feedback (like/dislike)
154
+ 5. Update distribution: α += 1 (like) or β += 1 (dislike)
155
+ 6. Future samples favor categories with positive feedback
156
+ 7. System automatically balances trying new categories
157
+
158
+ #### Use Cases
159
+ - Personalized content feeds
160
+ - A/B testing optimization
161
+ - Dynamic pricing systems
162
+ - Adaptive marketing campaigns
163
+
164
+ ---
165
+
166
+ ## ⚡ Advanced & Exotic Architectures
167
+
168
+ ### 6. Swarm Intelligence (`swarm-intelligence/index.html`)
169
+
170
+ **Emergent Collective Behavior with Particle Swarm Optimization**
171
+
172
+ Watch autonomous agents exhibit emergent intelligence through local interactions, pheromone trails, and swarm coordination.
173
+
174
+ #### Key Features
175
+ - Multi-agent particle swarm optimization
176
+ - Stigmergy-based communication (pheromone trails)
177
+ - Three behavior modes: foraging, flocking, exploration
178
+ - Real-time emergent pathfinding
179
+ - Obstacle avoidance and target discovery
180
+
181
+ #### Learning Mechanism
182
+ 1. Agents move through environment with local perception
183
+ 2. Leave pheromone trails based on success/exploration
184
+ 3. Other agents detect and follow strong pheromone gradients
185
+ 4. Collective intelligence emerges from individual simple rules
186
+ 5. Optimal paths discovered without central coordination
187
+ 6. Pheromones decay over time, allowing adaptation
188
+
189
+ #### Use Cases
190
+ - Distributed optimization problems
191
+ - Route planning and logistics
192
+ - Autonomous swarm robotics
193
+ - Network optimization
194
+ - Resource allocation in distributed systems
195
+
196
+ ---
197
+
198
+ ### 7. Meta-Learning (MAML) (`meta-learning/index.html`)
199
+
200
+ **Learning to Learn: Few-Shot Task Adaptation**
201
+
202
+ Model-Agnostic Meta-Learning enables rapid adaptation to new tasks with just 3-5 examples by learning universal meta-parameters.
203
+
204
+ #### Key Features
205
+ - Model-Agnostic Meta-Learning (MAML) algorithm
206
+ - Inner loop: task-specific rapid adaptation
207
+ - Outer loop: meta-parameter optimization
208
+ - Few-shot learning across task distributions
209
+ - Meta-training across multiple task families
210
+
211
+ #### Learning Mechanism
212
+ 1. Meta-train across diverse tasks to learn good initialization
213
+ 2. Inner loop: Clone meta-parameters for new task
214
+ 3. Adapt cloned parameters with few examples (3-5 shots)
215
+ 4. Outer loop: Update meta-parameters using task gradients
216
+ 5. Learned meta-parameters enable rapid specialization
217
+ 6. New tasks learned in milliseconds instead of hours
218
+
219
+ #### Use Cases
220
+ - Personalization with limited user data
221
+ - Quick adaptation to new domains
222
+ - Transfer learning across problem types
223
+ - AI assistants that learn user preferences rapidly
224
+ - Dynamic task switching in multi-task systems
225
+
226
+ ---
227
+
228
+ ### 8. Neuro-Symbolic Reasoning (`neuro-symbolic/index.html`)
229
+
230
+ **Hybrid AI: Neural Perception + Symbolic Logic**
231
+
232
+ Combines neural networks' pattern recognition with symbolic systems' logical reasoning for interpretable, verifiable AI.
233
+
234
+ #### Key Features
235
+ - Dual-system architecture (neural + symbolic)
236
+ - Logical rule knowledge base
237
+ - Forward chaining inference engine
238
+ - Hybrid confidence scoring
239
+ - Explainable reasoning chains
240
+
241
+ #### Learning Mechanism
242
+ 1. Neural component: Pattern matching with learned embeddings
243
+ 2. Symbolic component: Rule-based logical inference
244
+ 3. Query triggers both neural and symbolic paths
245
+ 4. Neural provides soft confidence via learned patterns
246
+ 5. Symbolic provides hard logic via rule chaining
247
+ 6. Hybrid decision combines both (weighted fusion)
248
+ 7. Full reasoning chain logged for explainability
249
+
250
+ #### Use Cases
251
+ - Explainable AI systems
252
+ - Medical diagnosis with interpretability
253
+ - Legal reasoning and compliance checking
254
+ - Scientific hypothesis generation
255
+ - Safety-critical systems requiring verification
256
+
257
+ ---
258
+
259
+ ### 9. Quantum-Inspired Optimization (`quantum-inspired/index.html`)
260
+
261
+ **Global Optimization via Quantum Computing Principles**
262
+
263
+ Uses quantum mechanics concepts (superposition, entanglement, tunneling) to escape local optima and find global solutions.
264
+
265
+ #### Key Features
266
+ - Quantum Particle Swarm Optimization (QPSO)
267
+ - Superposition of multiple states
268
+ - Quantum entanglement between particles
269
+ - Tunneling through energy barriers
270
+ - Multi-modal landscape visualization
271
+
272
+ #### Learning Mechanism
273
+ 1. Initialize particles in quantum superposition
274
+ 2. Each particle exists in multiple states simultaneously
275
+ 3. Measure (collapse) superposition based on fitness
276
+ 4. Quantum potential well guides particle movement
277
+ 5. Tunneling allows escape from local minima
278
+ 6. Entangled particles share phase information
279
+ 7. Converge to global optimum faster than classical PSO
280
+
281
+ #### Use Cases
282
+ - Complex optimization landscapes
283
+ - Neural architecture search
284
+ - Hyperparameter tuning
285
+ - Portfolio optimization
286
+ - Protein folding simulation
287
+
288
+ ---
289
+
290
+ ### 10. Continual Learning (`continual-learning/index.html`)
291
+
292
+ **Lifelong Learning Without Catastrophic Forgetting**
293
+
294
+ Learn new tasks sequentially while preserving knowledge from previous tasks using Elastic Weight Consolidation (EWC) and memory replay.
295
+
296
+ #### Key Features
297
+ - Elastic Weight Consolidation (EWC) regularization
298
+ - Experience replay buffer with importance sampling
299
+ - Synaptic consolidation for critical weights
300
+ - Progressive task learning timeline
301
+ - Forgetting curve monitoring
302
+
303
+ #### Learning Mechanism
304
+ 1. Learn first task normally, compute Fisher Information
305
+ 2. Fisher identifies which weights are critical for task
306
+ 3. When learning new task, penalize changes to critical weights
307
+ 4. Store important examples in replay buffer
308
+ 5. Periodically replay old examples during new learning
309
+ 6. Consolidate memories based on activation patterns
310
+ 7. Sequential tasks learned without forgetting previous ones
311
+
312
+ #### Use Cases
313
+ - Personal AI assistants that grow with user
314
+ - Autonomous systems in changing environments
315
+ - Educational platforms adapting to curriculum
316
+ - Robotics with expanding skill sets
317
+ - Long-running production ML systems
318
+
319
+ ---
320
+
321
+ ## 🚀 Quick Start
322
+
323
+ ### Running the Examples
324
+
325
+ 1. **Open any example directly in your browser:**
326
+ ```bash
327
+ # Navigate to the examples directory
328
+ cd examples/browser
329
+
330
+ # Open the main index
331
+ open index.html
332
+
333
+ # Or open a specific example
334
+ open rag/index.html
335
+ ```
336
+
337
+ 2. **Use a local web server (recommended for WASM):**
338
+ ```bash
339
+ # Using Python
340
+ python -m http.server 8000
341
+
342
+ # Using Node.js
343
+ npx serve
344
+
345
+ # Then visit: http://localhost:8000
346
+ ```
347
+
348
+ 3. **Interact with the examples:**
349
+ - Each example has interactive UI elements
350
+ - Follow on-screen instructions
351
+ - Observe learning progress in real-time
352
+ - Check statistics panels for metrics
353
+
354
+ ### Integration with AgentDB
355
+
356
+ To use these patterns with real AgentDB WASM backend:
357
+
358
+ ```javascript
359
+ // Import AgentDB (in your actual application)
360
+ import { createVectorDB } from 'agentdb';
361
+
362
+ // Initialize with WASM backend (auto-detected in browser)
363
+ const db = await createVectorDB({
364
+ memoryMode: true // In-memory for browser, or use export/import
365
+ });
366
+
367
+ // Insert vectors
368
+ const id = db.insert({
369
+ embedding: yourEmbeddingArray, // From OpenAI, Cohere, or local model
370
+ metadata: { type: 'pattern', data: {...} }
371
+ });
372
+
373
+ // Search for similar vectors
374
+ const results = db.search(
375
+ queryEmbedding,
376
+ 5, // top 5 results
377
+ 'cosine', // similarity metric
378
+ 0.7 // minimum threshold
379
+ );
380
+
381
+ // Export for persistence
382
+ const data = db.export();
383
+ localStorage.setItem('agentdb', JSON.stringify(Array.from(data)));
384
+
385
+ // Import on next session
386
+ const stored = JSON.parse(localStorage.getItem('agentdb'));
387
+ await db.importAsync(new Uint8Array(stored));
388
+ ```
389
+
390
+ ## 🎓 Learning Algorithms Explained
391
+
392
+ ### Vector Embeddings
393
+
394
+ All examples use vector embeddings to represent data in high-dimensional space:
395
+
396
+ **Simple Hash-Based Embeddings (Demo)**
397
+ - Used in examples for demonstration
398
+ - Convert text to numeric vectors
399
+ - Enable similarity calculations
400
+
401
+ **Production Embeddings**
402
+ - Use OpenAI (`text-embedding-ada-002`)
403
+ - Use Cohere (`embed-english-v3.0`)
404
+ - Use open-source models (Sentence Transformers)
405
+ - Or fine-tune custom embeddings
406
+
407
+ ### Similarity Metrics
408
+
409
+ **Cosine Similarity** (Default)
410
+ - Measures angle between vectors
411
+ - Best for normalized embeddings
412
+ - Range: -1 to 1 (1 = identical)
413
+
414
+ **Euclidean Distance**
415
+ - Measures geometric distance
416
+ - Good for spatial data
417
+ - Smaller = more similar
418
+
419
+ **Dot Product**
420
+ - Measures projection magnitude
421
+ - Fast computation
422
+ - Not normalized
423
+
424
+ ### Learning Strategies
425
+
426
+ **Supervised Learning** (RAG, Collaborative Filtering)
427
+ - Learn from explicit user feedback
428
+ - Labeled data (ratings, likes, feedback)
429
+ - Gradual improvement with more labels
430
+
431
+ **Reinforcement Learning** (Experience Replay)
432
+ - Learn from reward signals
433
+ - Trial and error exploration
434
+ - Optimal policy emerges over time
435
+
436
+ **Unsupervised Learning** (Pattern Learning)
437
+ - Discover structure in data
438
+ - No explicit labels needed
439
+ - Pattern detection through clustering
440
+
441
+ **Bandit Algorithms** (Adaptive Recommendations)
442
+ - Balance exploration vs exploitation
443
+ - Probabilistic decision making
444
+ - Regret minimization
445
+
446
+ ## 🔧 Customization Guide
447
+
448
+ ### Modifying Learning Parameters
449
+
450
+ **RAG System:**
451
+ ```javascript
452
+ const MIN_SIMILARITY = 0.7; // Lower = more permissive matches
453
+ const TOP_K = 3; // Number of documents to retrieve
454
+ ```
455
+
456
+ **Pattern Learning:**
457
+ ```javascript
458
+ const MIN_PATTERN_FREQUENCY = 2; // How often before it's a pattern
459
+ const SEQUENCE_LENGTH = 5; // Max pattern length
460
+ ```
461
+
462
+ **Experience Replay:**
463
+ ```javascript
464
+ const ALPHA = 0.1; // Learning rate (0-1)
465
+ const GAMMA = 0.9; // Discount factor (0-1)
466
+ const EPSILON = 0.1; // Exploration rate (0-1)
467
+ const BUFFER_SIZE = 100; // Experience buffer capacity
468
+ ```
469
+
470
+ **Multi-Armed Bandit:**
471
+ ```javascript
472
+ const ALPHA_PRIOR = 1; // Initial success count (optimistic)
473
+ const BETA_PRIOR = 1; // Initial failure count
474
+ ```
475
+
476
+ ### Adding New Features
477
+
478
+ **1. Export/Import Functionality:**
479
+ ```javascript
480
+ function exportData() {
481
+ const data = {
482
+ database: db.export(),
483
+ userHistory: userHistory,
484
+ learnedPatterns: patterns,
485
+ timestamp: Date.now()
486
+ };
487
+
488
+ const blob = new Blob([JSON.stringify(data)], { type: 'application/json' });
489
+ // Download or save to localStorage
490
+ }
491
+
492
+ function importData(jsonData) {
493
+ const data = JSON.parse(jsonData);
494
+ db.importAsync(new Uint8Array(data.database));
495
+ userHistory = data.userHistory;
496
+ patterns = data.learnedPatterns;
497
+ // Restore UI state
498
+ }
499
+ ```
500
+
501
+ **2. Cross-Tab Synchronization:**
502
+ ```javascript
503
+ // Use BroadcastChannel API
504
+ const channel = new BroadcastChannel('agentdb-sync');
505
+
506
+ channel.onmessage = (event) => {
507
+ if (event.data.type === 'update') {
508
+ // Sync database state across tabs
509
+ db.importAsync(event.data.dbState);
510
+ }
511
+ };
512
+
513
+ // Broadcast updates
514
+ function broadcastUpdate() {
515
+ channel.postMessage({
516
+ type: 'update',
517
+ dbState: db.export()
518
+ });
519
+ }
520
+ ```
521
+
522
+ **3. Service Worker for Offline:**
523
+ ```javascript
524
+ // Register service worker
525
+ if ('serviceWorker' in navigator) {
526
+ navigator.serviceWorker.register('/sw.js');
527
+ }
528
+
529
+ // In sw.js - cache database exports
530
+ self.addEventListener('message', (event) => {
531
+ if (event.data.type === 'cache-db') {
532
+ caches.open('agentdb-v1').then(cache => {
533
+ cache.put('/db-backup', new Response(event.data.dbData));
534
+ });
535
+ }
536
+ });
537
+ ```
538
+
539
+ ## 📊 Performance Considerations
540
+
541
+ ### WASM Backend Performance
542
+
543
+ **Throughput:**
544
+ - 51.7K vectors/sec insert (WASM)
545
+ - ~5ms search time @ 100K vectors
546
+ - Only 2.2x slower than native
547
+
548
+ **Memory Usage:**
549
+ - ~0.74MB per 1K vectors (384-dim embeddings)
550
+ - ~7.4MB per 10K vectors
551
+ - ~74MB per 100K vectors
552
+
553
+ **Optimization Tips:**
554
+ 1. Use batch inserts for bulk operations
555
+ 2. Enable HNSW index for large datasets (>1K vectors)
556
+ 3. Implement pagination for large result sets
557
+ 4. Debounce frequent searches
558
+ 5. Use Web Workers for heavy computations
559
+
560
+ ### Browser Compatibility
561
+
562
+ **Minimum Requirements:**
563
+ - Modern browser with WebAssembly support
564
+ - Chrome 57+, Firefox 52+, Safari 11+, Edge 16+
565
+ - ~100MB free memory for large datasets
566
+ - LocalStorage or IndexedDB for persistence
567
+
568
+ **Feature Detection:**
569
+ ```javascript
570
+ // Check WASM support
571
+ const wasmSupported = (() => {
572
+ try {
573
+ if (typeof WebAssembly === 'object'
574
+ && typeof WebAssembly.instantiate === 'function') {
575
+ const module = new WebAssembly.Module(
576
+ Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00)
577
+ );
578
+ return module instanceof WebAssembly.Module;
579
+ }
580
+ } catch (e) {}
581
+ return false;
582
+ })();
583
+
584
+ if (!wasmSupported) {
585
+ console.error('WebAssembly not supported');
586
+ }
587
+ ```
588
+
589
+ ## 🌟 Advanced Patterns
590
+
591
+ ### Hybrid Architectures
592
+
593
+ Combine multiple learning approaches:
594
+
595
+ **RAG + Pattern Learning:**
596
+ - Learn query patterns to improve retrieval
597
+ - Adjust document ranking based on feedback
598
+ - Predict query intent from partial input
599
+
600
+ **Experience Replay + Collaborative Filtering:**
601
+ - Learn from both own experiences and similar users
602
+ - Transfer knowledge across user sessions
603
+ - Cold-start with replay buffer, warm-up with collaborative data
604
+
605
+ **Multi-Armed Bandit + Pattern Learning:**
606
+ - Use patterns to inform category selection
607
+ - Contextual bandits with pattern features
608
+ - Adaptive exploration based on detected patterns
609
+
610
+ ### Federated Learning Simulation
611
+
612
+ ```javascript
613
+ // Aggregate learnings from multiple users (privacy-preserving)
614
+ function aggregateModels(userModels) {
615
+ const aggregated = {};
616
+
617
+ // Average model parameters
618
+ Object.keys(userModels[0]).forEach(param => {
619
+ aggregated[param] = userModels
620
+ .map(m => m[param])
621
+ .reduce((a, b) => a + b, 0) / userModels.length;
622
+ });
623
+
624
+ return aggregated;
625
+ }
626
+
627
+ // Download global model
628
+ function downloadGlobalModel() {
629
+ fetch('/api/global-model')
630
+ .then(r => r.json())
631
+ .then(model => updateLocalModel(model));
632
+ }
633
+
634
+ // Upload local updates (gradients only, not data)
635
+ function uploadGradients(gradients) {
636
+ fetch('/api/update', {
637
+ method: 'POST',
638
+ body: JSON.stringify({ gradients })
639
+ });
640
+ }
641
+ ```
642
+
643
+ ## 🐛 Debugging Tips
644
+
645
+ **Enable Verbose Logging:**
646
+ ```javascript
647
+ const DEBUG = true;
648
+
649
+ function log(...args) {
650
+ if (DEBUG) {
651
+ console.log('[AgentDB]', ...args);
652
+ }
653
+ }
654
+
655
+ // Log all vector insertions
656
+ db.insert = new Proxy(db.insert, {
657
+ apply: (target, thisArg, args) => {
658
+ log('Insert:', args);
659
+ return target.apply(thisArg, args);
660
+ }
661
+ });
662
+ ```
663
+
664
+ **Visualize Vector Space:**
665
+ ```javascript
666
+ // Use t-SNE or UMAP for 2D projection
667
+ function visualizeEmbeddings(embeddings) {
668
+ // Reduce to 2D for plotting
669
+ const tsne = new TSNE({
670
+ dim: 2,
671
+ perplexity: 30
672
+ });
673
+
674
+ tsne.init(embeddings);
675
+ tsne.run();
676
+
677
+ const projected = tsne.getSolution();
678
+ plotScatter(projected); // Use Chart.js or D3.js
679
+ }
680
+ ```
681
+
682
+ **Monitor Learning Progress:**
683
+ ```javascript
684
+ setInterval(() => {
685
+ console.table({
686
+ 'Vectors': db.stats().count,
687
+ 'Queries': queryHistory.length,
688
+ 'Patterns': patterns.length,
689
+ 'Success Rate': `${(successRate * 100).toFixed(1)}%`,
690
+ 'Memory Usage': `${(performance.memory?.usedJSHeapSize / 1024 / 1024).toFixed(1)} MB`
691
+ });
692
+ }, 5000);
693
+ ```
694
+
695
+ ## 📚 Further Reading
696
+
697
+ **AgentDB Documentation:**
698
+ - [ReasoningBank Guide](../../docs/REASONINGBANK_VALIDATION.md)
699
+ - [Performance Benchmarks](../../docs/PERFORMANCE_REPORT.md)
700
+ - [WASM Backend Guide](../../docs/WASM_BACKEND.md)
701
+
702
+ **Learning Algorithms:**
703
+ - [Q-Learning Tutorial](https://towardsdatascience.com/q-learning)
704
+ - [Thompson Sampling Explained](https://en.wikipedia.org/wiki/Thompson_sampling)
705
+ - [Collaborative Filtering Guide](https://developers.google.com/machine-learning/recommendation/collaborative/basics)
706
+ - [RAG Systems Overview](https://arxiv.org/abs/2005.11401)
707
+
708
+ **Browser AI:**
709
+ - [TensorFlow.js](https://www.tensorflow.org/js)
710
+ - [ONNX Runtime Web](https://onnxruntime.ai/docs/tutorials/web/)
711
+ - [Transformers.js](https://huggingface.co/docs/transformers.js)
712
+
713
+ ## 🤝 Contributing
714
+
715
+ Have a new self-learning architecture idea? Contributions welcome!
716
+
717
+ 1. Fork the repository
718
+ 2. Create your example in `examples/browser/your-architecture/`
719
+ 3. Follow the existing structure (index.html with inline JS)
720
+ 4. Add to the main `index.html` grid
721
+ 5. Update this README with your architecture description
722
+ 6. Submit a pull request
723
+
724
+ ## 📄 License
725
+
726
+ These examples are part of AgentDB, dual-licensed under MIT OR Apache-2.0.
727
+
728
+ ---
729
+
730
+ **Built with ❤️ for AI developers**
731
+
732
+ *Demonstrating the power of client-side self-learning systems*