Skip to main content
Erasure clears an agent’s knowledge base between sessions, with clear errors when an adapter can’t support an operation.

Quick Start

1

Reset the knowledge base

2

Delete all scoped memories

3

Inspect change history


How It Works

Knowledge erasure calls route to the underlying memory adapter. Unsupported operations fail loudly instead of raising AttributeError.

Adapter Capabilities

Support differs per adapter — verify against praisonaiagents/knowledge/adapters/ before relying on an operation.
Since PraisonAI PR #4020, Knowledge.reset() warns instead of raising AttributeError, and delete_all() / history() raise NotImplementedError on unsupported adapters instead of AttributeError. Wrap history() and delete_all() in try/except when your code should work across adapters.
Since PraisonAI PR #4991, Knowledge.reset() returns boolTrue when the backend actually reset, False when the adapter has no reset() and the call was a silent no-op. On destructive paths, check the return value before telling a user their data was erased: a False means nothing was cleared. Existing callers that ignore the return value are unaffected.

Common Patterns

Guard erasure calls so your code works across adapters:
Report to users honestly on a destructive path — check the return value before claiming success:

Best Practices

Call agent.knowledge.reset() at the end of a session to clear context for privacy-sensitive workflows. reset() returns True when the backend actually reset, and False when the adapter had no reset — it warns and no-ops instead. On destructive paths check the return value before telling a user their data was erased; a False means nothing was cleared.
Both raise NotImplementedError on adapters that don’t support them. Wrap them in try/except so multi-adapter code degrades gracefully.
Only Mem0-backed knowledge implements history(memory_id). Choose Mem0 when you need an audit trail of memory changes.
reset() returns False and logs a warning when the adapter can’t reset. Prefer the return value over log-scraping — it’s a reliable signal that the tier was actually cleared (True) or silently skipped (False).

Knowledge Overview

Load files and documents into an agent’s knowledge base.

Knowledge Storage

Configure the storage backend for knowledge.