Skip to main content

A library to help facilitate memory recall

Project description

psg_recall

Usage

Installation

Install latest from the GitHub repository:

$ pip install git+https://github.com/problemsolversguild/psg_recall.git

or from pypi

$ pip install psg_recall

Documentation

Documentation can be found hosted on this GitHub repository’s pages. Additionally you can find package manager specific guidelines on pypi.

How to use

psg_recall provides persistent memory storage at three levels:

  • Global - Memories shared across all projects (stored in ~/.solveit_memory/)
  • Project - Memories for the current project directory (stored in .memory/)
  • File - Memories tied to a specific file (stored in .memory/{filename}_memory.txt)
from psg_recall.storage import remember, recall, recall_all, recall_history, forget

Storing memories

Use remember() to store a key-value pair. By default it stores at the project level:

# Store a project-level memory
remember("user_name", "Alice")
'Remembered (project): user_name'
# Store a global memory (available across all projects)
remember("api_preference", "openai", level="global")
'Remembered (global): api_preference'
# Store a file-specific memory (context specifies the filename)
remember("last_edit", "fixed bug on line 42", level="file", context="main.py")
'Remembered (file): last_edit'

Recalling memories

Use recall() to retrieve memories from a specific level. Returns None if the key doesn’t exist:

# Recall a specific key from project level
recall(key="user_name")
'Alice'
# Recall all project-level memories
recall()
'user_name: Alice\n'
# Recall from global level
recall(level="global")
'api_preference: openai\n'

Recalling from all levels

Use recall_all() to get memories from global, project, and file levels combined:

# Get all memories across all levels
print(recall_all(context="main.py"))  # include file context to also get file-level memories
=== GLOBAL ===
api_preference: openai

=== PROJECT ===
user_name: Alice

=== FILE ===
last_edit: fixed bug on line 42

Forgetting memories

Use forget() to remove a key from memory. This also records the removal in history:

# Forget a project-level memory
forget("user_name")
'Forgot (project): user_name'

Viewing history

Use recall_history() to see past changes to memories, including timestamps and whether values were remembered or forgotten:

# View all history for project level
print(recall_history())
2026-01-05 04:33:41 | remember | user_name | Alice
2026-01-05 04:33:41 | forget | user_name | Alice
2026-01-05 04:33:57 | remember | user_name | Alice
2026-01-05 04:33:57 | forget | user_name | Alice
# View history for a specific key
print(recall_history(key="user_name"))
2026-01-05 04:33:41 | remember | user_name | Alice
2026-01-05 04:33:41 | forget | user_name | Alice
2026-01-05 04:33:57 | remember | user_name | Alice
2026-01-05 04:33:57 | forget | user_name | Alice

Export

from nbdev import nbdev_export
from nbdev.quarto import nbdev_docs

nbdev_export()
nbdev_docs()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

psg_recall-0.0.3.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

psg_recall-0.0.3-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file psg_recall-0.0.3.tar.gz.

File metadata

  • Download URL: psg_recall-0.0.3.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for psg_recall-0.0.3.tar.gz
Algorithm Hash digest
SHA256 706ab4d3ac3fc305d8b244c299303ce0f362bf5cb386b18d42e28365b4058eb4
MD5 3348ccc8f34775d43a49044b23e1983e
BLAKE2b-256 2e61d63d8b496bf0b9403485f8c7341acfad2e106484bad1ac291f264280166a

See more details on using hashes here.

File details

Details for the file psg_recall-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: psg_recall-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for psg_recall-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 512a7829eb3b5bfe735ce0f8c0bef21fcbb4707c3507f776a35d8358d0ef7b3e
MD5 2582ad15fad45615a1c56f3e44a98cbf
BLAKE2b-256 824335e01533727dd17e8a94e462d579edc1e8204d32dd0bbf657a93867b911c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page