Extension: dakera_memory — persistent cross-session semantic memory
text-generation-webui has a character/persona system and chat history, but no persistent cross-session memory — each conversation starts blank. This proposes a dakera_memory extension that hooks into input_modifier and output_modifier to add persistent semantic recall.
Problem: oobabooga sessions are ephemeral. Users with persistent AI companions lose all continuity on restart or when the context window fills.
Proposed Extension (extensions/dakera_memory/script.py):
import requests
DAKERA_URL = 'http://localhost:3300' AGENT_ID = 'ooba-companion'
def input_modifier(string, state, is_chat=False): # Recall relevant past context and prepend to user message resp = requests.post(f'{DAKERA_URL}/v1/memories/search', json={'query': string, 'session_id': AGENT_ID, 'top_k': 3}, headers={'Authorization': 'Bearer demo'}, timeout=3) if resp.ok: memories = resp.json().get('results', []) if memories: context = '\n'.join(f'- {m["content"]}' for m in memories) return f'[Recalled from prior sessions:\n{context}\n]\n{string}' return string
def output_modifier(string, state, is_chat=False): # Store the AI response for future recall requests.post(f'{DAKERA_URL}/v1/memories', json={'content': string, 'session_id': AGENT_ID}, headers={'Authorization': 'Bearer demo'}, timeout=3) return string
Setup: docker run -d -p 3300:3300 -e DAKERA_API_KEY=demo ghcr.io/dakera-ai/dakera:latest
This fits perfectly with oobabooga's extension architecture — no core modifications needed. Happy to open a PR with the full extension.
Source: oobabooga/textgen