Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
add agent-voice-chat/providers/conversation-history.js
oversteppingfbe5f343c1fc
diff --git a/agent-voice-chat/providers/conversation-history.js b/agent-voice-chat/providers/conversation-history.jsnew file mode 100644index 000000000..17266b96b--- /dev/null+++ b/agent-voice-chat/providers/conversation-history.js@@ -0,0 +1,41 @@+// SPDX-License-Identifier: Apache-2.0+// Copyright 2026 nirholas (https://github.com/nirholas/agent-voice-chat)++const DEFAULT_MAX_HISTORY = 20++class ConversationHistory {+ constructor(maxHistory = DEFAULT_MAX_HISTORY) {+ this.maxHistory = maxHistory+ this.histories = {}+ }++ _key(roomId, agentId) {+ return `${roomId || "default"}:${agentId}`+ }++ add(roomId, agentId, role, content) {+ const key = this._key(roomId, agentId)+ if (!this.histories[key]) this.histories[key] = []+ this.histories[key].push({ role, content })+ if (this.histories[key].length > this.maxHistory) {+ this.histories[key] = this.histories[key].slice(-this.maxHistory)+ }+ }++ get(roomId, agentId) {+ return this.histories[this._key(roomId, agentId)] || []+ }++ clear(agentId, roomId) {+ delete this.histories[this._key(roomId, agentId)]+ }++ clearRoom(roomId) {+ const prefix = `${roomId}:`+ for (const key of Object.keys(this.histories)) {+ if (key.startsWith(prefix)) delete this.histories[key]+ }+ }+}++module.exports = { ConversationHistory }