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.1.tar.gz (10.6 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.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: psg_recall-0.0.1.tar.gz
  • Upload date:
  • Size: 10.6 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.1.tar.gz
Algorithm Hash digest
SHA256 a5f45030f0735809acc3cd10f7d29ed4f9719841ea6534377c30104720341677
MD5 d4a1a77931283472cc4da04231e904cf
BLAKE2b-256 207da68b07f77d5e16c3159d3aa53632833d4e686b265cf104aec84f29f3d6d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: psg_recall-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51cf7458d3bdb730c38ce3d6145ab556349fee5482e2fdab1087265ff65456ed
MD5 a09abda3d6e93c1887b3f68094d33f20
BLAKE2b-256 a064b83ea69541497a1c4e5a848887493200e4332583d30fb63df44877266583

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