Home / Function/ clear_all_memory() — anthropic-sdk-python Function Reference

clear_all_memory() — anthropic-sdk-python Function Reference

Architecture documentation for the clear_all_memory() function in basic.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  35d60adf_2ecd_644b_1c44_7b4b135ea856["clear_all_memory()"]
  c2730250_7059_6f44_aa62_71ce88c5a804["LocalFilesystemMemoryTool"]
  35d60adf_2ecd_644b_1c44_7b4b135ea856 -->|defined in| c2730250_7059_6f44_aa62_71ce88c5a804
  39d72171_4d60_dd21_ca18_ab93fe5bdef3["conversation_loop()"]
  39d72171_4d60_dd21_ca18_ab93fe5bdef3 -->|calls| 35d60adf_2ecd_644b_1c44_7b4b135ea856
  style 35d60adf_2ecd_644b_1c44_7b4b135ea856 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

examples/memory/basic.py lines 185–190

    def clear_all_memory(self) -> str:
        """Override the base implementation to provide file system clearing."""
        if self.memory_root.exists():
            shutil.rmtree(self.memory_root)
        self.memory_root.mkdir(parents=True, exist_ok=True)
        return "All memory cleared"

Subdomains

Frequently Asked Questions

What does clear_all_memory() do?
clear_all_memory() is a function in the anthropic-sdk-python codebase, defined in examples/memory/basic.py.
Where is clear_all_memory() defined?
clear_all_memory() is defined in examples/memory/basic.py at line 185.
What calls clear_all_memory()?
clear_all_memory() is called by 1 function(s): conversation_loop.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free