Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/cache_persistence_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def demo_cache_persistence():

# Session 1: Populate cache
print("\nSession 1: Populating semantic cache...")
cache1 = SemanticCache(cache_file="demo_cache.pkl")
cache1 = SemanticCache(cache_file="demo_cache.sqlite")

# Simulate typical database queries
demo_queries = [
Expand Down Expand Up @@ -52,7 +52,7 @@ def demo_cache_persistence():

# Session 2: Load from disk
print("\nSession 2: Loading cache from disk...")
cache2 = SemanticCache(cache_file="demo_cache.pkl")
cache2 = SemanticCache(cache_file="demo_cache.sqlite")

stats2 = cache2.get_cache_stats()
print(f" Cache loaded: {stats2['total_entries']} entries")
Expand Down Expand Up @@ -105,7 +105,7 @@ def demo_cache_persistence():
# Environment variable configuration
print("\nEnvironment variable configuration:")
print(" Set NEXUMDB_CACHE_FILE to customize cache location")
print(" Example: export NEXUMDB_CACHE_FILE=my_custom_cache.pkl")
print(" Example: export NEXUMDB_CACHE_FILE=my_custom_cache.sqlite")

# Cleanup
print("\nCleaning up demo files...")
Expand Down Expand Up @@ -133,4 +133,4 @@ def demo_cache_persistence():
print("\n\nWarning: Demo interrupted by user")
except Exception as e:
print(f"\nError: Demo failed: {e}")
sys.exit(1)
sys.exit(1)
Loading
Loading