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 xspace-agent/xspace-agent/agent-voice-chat/lib/conversation-history.js
overstepping7154efa6b65c
diff --git a/xspace-agent/xspace-agent/agent-voice-chat/lib/conversation-history.js b/xspace-agent/xspace-agent/agent-voice-chat/lib/conversation-history.jsnew file mode 100644index 000000000..3e96fbc62--- /dev/null+++ b/xspace-agent/xspace-agent/agent-voice-chat/lib/conversation-history.js@@ -0,0 +1,49 @@+// SPDX-License-Identifier: Apache-2.0+// Copyright 2026 nirholas (https://github.com/nirholas/xspace-agent)++class ConversationHistory {+ constructor({ maxLength = 100 } = {}) {+ this.maxLength = maxLength+ this.histories = new Map()+ }++ add(message, key = "global") {+ if (!this.histories.has(key)) {+ this.histories.set(key, [])+ }+ const history = this.histories.get(key)+ history.push(message)+ if (history.length > this.maxLength) {+ this.histories.set(key, history.slice(-this.maxLength))+ }+ }++ get(key = "global") {+ return [...(this.histories.get(key) || [])]+ }++ clear(key) {+ if (key !== undefined) {+ this.histories.delete(key)+ } else {+ this.histories.clear()+ }+ }++ getRecent(key = "global", count = 50) {+ const history = this.histories.get(key) || []+ return [...history.slice(-count)]+ }++ size(key = "global") {+ return (this.histories.get(key) || []).length+ }++ keys() {+ return Array.from(this.histories.keys())+ }+}++module.exports = { ConversationHistory }++