{"id":48983557,"url":"https://github.com/bubustack/conversation-memory-engram","last_synced_at":"2026-04-18T12:01:13.844Z","repository":{"id":352179701,"uuid":"1208677690","full_name":"bubustack/conversation-memory-engram","owner":"bubustack","description":"Per-session conversation memory Engram for bobrapet — bounded history with TTL eviction, dedup, and context packet emission.","archived":false,"fork":false,"pushed_at":"2026-04-18T10:01:57.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-18T10:11:57.800Z","etag":null,"topics":["batch","bubustack","context","conversation","engram","go","kubernetes","memory","streaming"],"latest_commit_sha":null,"homepage":"https://bubustack.io/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bubustack.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["bubustack"]}},"created_at":"2026-04-12T15:54:08.000Z","updated_at":"2026-04-18T10:01:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bubustack/conversation-memory-engram","commit_stats":null,"previous_names":["bubustack/conversation-memory-engram"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/bubustack/conversation-memory-engram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fconversation-memory-engram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fconversation-memory-engram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fconversation-memory-engram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fconversation-memory-engram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bubustack","download_url":"https://codeload.github.com/bubustack/conversation-memory-engram/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubustack%2Fconversation-memory-engram/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31967993,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["batch","bubustack","context","conversation","engram","go","kubernetes","memory","streaming"],"created_at":"2026-04-18T12:00:35.106Z","updated_at":"2026-04-18T12:01:13.827Z","avatar_url":"https://github.com/bubustack.png","language":"Go","readme":"# 🧠 Conversation Memory Engram\n\nKeeps a bounded per-session conversation history and emits `conversation.context.v1`\npackets for downstream prompts without requiring each Engram to implement its own\nmemory layer.\n\n## 🌟 Highlights\n\n- Maintains per-key message history with TTL-based eviction and optional deduplication.\n- Supports both batch Jobs and streaming Deployments under the same Engram spec.\n- Produces normalized context packets downstream Engrams can consume immediately.\n- Offers configurable merge windows, rate-limited sweeps, and flexible role mapping.\n\n## 🚀 Quick Start\n\n```bash\ngo vet ./...\ngo test ./...\ndocker build -t ghcr.io/bubustack/conversation-memory-engram:dev .\n```\n\nDeploy the resulting container as part of a bobrapet Story. Use the sample\n`Engram.yaml` to register the template and pick defaults for your project.\n\n## ⚙️ Configuration (`Engram.spec.with`)\n\n| Field | Default | Description |\n| --- | --- | --- |\n| `maxMessages` | `16` | Maximum history length stored per key. |\n| `sessionTTL` | `45m` | Idle TTL before conversation keys are swept. |\n| `sweepInterval` | `1m` | How often the engram reaps expired keys. |\n| `minUserChars` | `4` | Minimum user text length that contributes to history. |\n| `ignorePattern` | `(?i)^(mhm+|hmm+|uh+|um+|ok(?:ay)?|mm+|huh)[.!? ]*$` | Regex of filler utterances to ignore for `role=user`. |\n| `dedupeWindow` | `1500ms` | Suppresses duplicate role-text pairs within this window. |\n| `mergeWindowMs` | `3000` | Merges consecutive same-role packets arriving within this window. |\n| `defaultRole` | `user` | Role used when metadata omits a role. |\n\n## 📥 Inputs\n\n| Field | Description |\n| --- | --- |\n| `key` | Explicit conversation key. If omitted, the engram derives one from session or participant metadata. |\n| `sessionId` | Optional session identifier used when deriving the conversation key. |\n| `role` | `user`, `assistant`, `developer`, or `system` (defaults to `defaultRole`). |\n| `text` / `assistantText` | Message content to add to history. |\n| `speakerId` | Optional identifier used for deduplication and merge logic. |\n| `reset` | Boolean flag to drop existing history for the current key before processing the message. |\n| `maxMessages` | Per-request override for the retained history length. |\n| `minUserChars` | Per-request override for the minimum accepted user transcript length. |\n| `includeHistory` | When `false`, suppresses the `history` array in the emitted context packet. |\n\nAdditional passthrough fields such as `metadata` are preserved for downstream context assembly because the input schema allows extra properties.\n\n## 📤 Outputs\n\nEmits a `conversation.context.v1` payload containing:\n\n- `accepted`: boolean indicating the message was accepted into history.\n- `role`, `text`, `speakerId`, and timestamps from the last stored message.\n- `history`: trimmed list of prior messages (bounded by `maxMessages`).\n- `metadata`: merged metadata from the stored history and the latest packet.\n- `diagnostics`: when `BUBU_DEBUG=true`, exposes TTL and sweep metadata.\n\n## 🧪 Local Development\n\n- `go vet ./...` – Runs Go vet checks.\n- `go test ./...` – Unit tests covering merging, dedup, and hydration.\n- `docker build -t ghcr.io/bubustack/conversation-memory-engram:dev .` – Builds the container image.\n\n## 🤝 Community \u0026 Support\n\n- [Contributing](./CONTRIBUTING.md)\n- [Support](./SUPPORT.md)\n- [Security Policy](./SECURITY.md)\n- [Code of Conduct](./CODE_OF_CONDUCT.md)\n- [Discord](https://discord.gg/dysrB7D8H6)\n\n## 📄 License\n\nCopyright 2025 BubuStack.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","funding_links":["https://github.com/sponsors/bubustack"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubustack%2Fconversation-memory-engram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbubustack%2Fconversation-memory-engram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubustack%2Fconversation-memory-engram/lists"}