Wrste / pheromone-network
git clone https://github.com/Wrste/pheromone-network.git
0.1.0 · 18d ago
A zero-dependency TypeScript memory kernel that gives any agent long-term memory. No training or backpropagation: each output reads a few tag-compatible neighbors, updated by a manual Hebbian rule. Links used often are reinforced; idle ones evaporate by half-life. Based on the paper Local Pheromone Network (arXiv:2606.30669).
+0
stars, 24h · #34,423
+~0
stars, 7 days · #34,898
+101
stars, 30 days · #4,876
94
★ total
0
forks · 1 open issues
Star history (as recorded here)
LanguageTypeScript
LicenseMIT
Created2026-10-04 (18d ago)
Last push18d ago
Watchers0
OwnerUser
GitHub topics
Links
README excerpt
# pheromone_network **Memory that strengthens with use and fades with disuse.** A zero-dependency, embeddable local association and recall kernel: frequently used relationships grow stronger, while idle relationships naturally decay. English | 中文 `TypeScript` · `Node >= 18` · `0 runtime deps` · `offline-friendly` ## What problem does it solve? Many systems need to answer the same question: **given a new input, which pieces of past information are worth using again?** `pheromone_network` packages that loop into a small local component. You provide vectors; it learns local associations, scores candidates, and lets unused relationships fade over time. It does not require a remote model, a vector database, a training dataset, a network connection, or a GPU. Use it as a standalone recall layer, or place it in front of search, caching, recommendation, rules, or agent memory. ## Install from npm The package is publicly available on npm as version `0.1.0`. It includes compiled CommonJS output and TypeScript declarations, so applications can install and import it directly: [code] [code] Package page: ## Browser demo Try the live demo directly in your browser: **Open the online Memory Lab**. It demonstrates memory observation, ranked recall, repeated reinforcement, frequency weighting, and time based pheromone decay. You can also open `examples/index.html` locally. See `examples/README.md` for local serving and GitHub Pages instructions. ## Why use it? - **Adapts through real usage**: repeated hits reinforce the relationships that matter in your product. - **Lets stale context fade**: evaporation and time based decay keep old relationships from dominating forever. - **Small and inspectable**: local connections, explicit weights, and cosine scores are easy to inspect. - **Simple deployment**: zero runtime dependencies, no network requirement, and no GPU requirement. - **Works with existing vectors**: use model embeddings, hashed features, or the built in `ngramEmbed` encoder. ## Where can it be used? | Scenario | How to use it | Typical outcome | | --- | --- | --- | | **Semantic caching** | Associate request vectors with previous requests; reinforce reused entries and decay old ones | Fewer repeated computations for local APIs, tools, and generated content | | **Recommendation and personalization** | Write behavior or content features; reinforce clicks, saves, and repeated actions | Lightweight interest ranking and personalized shortcuts | | **Document, ticket, and knowledge deduplication** | Score a new item against historical vectors before review | Similar tickets, duplicate FAQs, and existing solutions surface early | | **Log and event recall** | Encode event features or text n-grams and retrieve similar historical events | Faster incident investigation and runbook matching | | **Offline and edge applications** | Keep associations on the device or inside a tenant or project scope | Desktop tools, browser extensions, IoT, and privacy sensitive syste