alameenpd
Joined 3 years ago
Joined 3 years ago
Whisper solves both at once.
It combines persistent memory with grounded retrieval, so your agents remember users across sessions and only surface what's actually true. We ran a benchmark on a frozen dual-provider dataset: 0% hallucination rate, 94.8% retrieval recall.
The full integration looks like this:
import { WhisperClient } from "@usewhisper/sdk";
const whisper = new WhisperClient({
apiKey: process.env.WHISPER_API_KEY,
project: "my-project",
});
// After each conversation — store what's worth remembering
await whisper.remember({ messages: conversationHistory, userId });
// Next session — retrieve before generation
const { context } = await whisper.query({ q: userMessage, userId });
// Model now has full context from prior sessions
const response = await openai.chat.completions.create({
model: "gpt-4o",
messages: [
{ role: "system", content: context },
{ role: "user", content: userMessage },
],
});
That's it. Your agent now remembers users across sessions and won't
hallucinate what it retrieves.The problem we kept seeing: memory-only solutions (Mem0, Zep) store context but hallucinate on retrieval. Retrieval-only solutions (Nia, Supermemory) are grounded but stateless — every session starts cold. Nobody was doing both.
What Whisper does differently: - Persistent memory that compounds across sessions - Retrieval that's grounded — it won't surface what isn't there - Works with any LLM, integrates in ~10 minutes - MCP-native, SDK + CLI for fast onboarding
Free tier available. Docs at usewhisper.dev.
Happy to answer anything — especially pushback on the benchmark methodology, I want to pressure test it.
{ "agents": { "defaults": { "model": "gemini/flash-lite", "fallbacks": ["anthropic/claude-3-opus"], "contextTokens": 150000 }, "heartbeat": { "model": "deepseek/v3.2", "interval": "45m" } } }
→ Switched trivial stuff away from Opus. Whisper skill setupCreated ~/.openclaw/workspace/skills/whisper/:SKILL.md
# Whisper Context Fetch Pulls delta-compressed context / memories to reduce prompt size.
@whisper get "summarize auth changes in repo" --project openclaw-exp
index.ts (simplified)ts
import { Whisper } from '@usewhisper/sdk';
const whisper = new Whisper({ apiKey: process.env.WHISPER_API_KEY, orgId: process.env.WHISPER_ORG_ID });
export async function getContext(args: { query: string; project: string }) { const res = await whisper.query({ project: args.project || 'openclaw-exp', query: args.query, compress: true, compression_strategy: 'delta', include_memories: true }); return { context: res.context, memories: res.memories?.map(m => `${m.type}: ${m.content}`) || [], meta: res.meta }; }
Then in agent instructions (AGENTS.md or prompt templates): "If context/history is large, call @whisper get first and prepend the result." Wrapper example (in a custom loop or cron)ts
async function runAgentWithContext(msg: string) { let enhanced = msg; if (/* detect long context needed */) { const wc = await getContext({ query: msg }); enhanced = `Context diff: ${wc.context}\nMemories:\n${wc.memories.join('\n')}\n\n${msg}`; } return openclaw.run(enhanced); }
Observations so farDelta compression seems to genuinely cut repeat context (e.g., codebase overviews drop from 10–15k → 1–3k tokens after first message). Memory types (preferences, events, goals) help avoid re-explaining user prefs. Combined with routing, my rough tracking shows ~60–75% lower usage on mixed workloads (not 97% like some YouTube claims, but meaningful). Latency added (~200–500ms per query) but worth it for longer sessions. Still manual; over-indexing sources bloats Whisper project if not careful.
Caveats: This is custom / early. Whisper costs $20/mo after trial. OpenClaw itself has had security noise lately (skills gone rogue, etc.), so sandbox everything. Not production-ready for high-stakes use.Curious from folks running OpenClaw:What's your biggest token sink (heartbeats, tools, long histories)? Tried context layers / vector DBs? Actual savings numbers? Better cheap fallbacks than Flash/DeepSeek for non-reasoning tasks?
Happy to share more snippets or debug if anyone's experimenting similarly.
And im new to hackernews lol