Skip to main content

SynMem – 4-Stage Synthetic Memory

Overview

SynMem is a production-grade, multi-stage synthetic memory framework inspired by real cognition. Built for AI Agents, LLMs, Voice Assistants and more with advanced automation.

Stages:

  1. Perception – Immediate, in-memory (RAM) context
    • Optional, not required
  2. Sensory – Short-lived, per-user episodic memory
  3. STM (Short-Term Memory) – Active conversation/session memory
  4. LTM (Long-Term Memory) – Persistent archive

Key Features

  • Direct, 4-stage architecture:

    • Perception (RAM) Sensory (Per User) → STM (All Users) → LTM (All Users)
  • Thread-safe singleton: One instance per process, all operations safe for concurrency.

  • Configurable: All limits, expirations, are adjustable.

  • No vendor lock-in: Plug into any agent, LLM, or workflow.

  • No required maintenance: Maintenance/cleanup is optional but recommended. Run in a background thread no lock-in or forced schedules.

  • Bonus: Image storage and expiry: Store/expire/archive images and metadata if needed—totally optional.


Why SynMem?

Most “memory” modules just log history or dump to a database. SynMem is layered, time-aware, and models real-world cognition.

  • Perception: Working context—ephemeral, in-memory, no disk. (Optional Use)
  • Sensory: Fast, expiring, per-user buffer.
  • STM: Recent active memory, rolls into LTM automatically.
  • LTM: Archive—retrieve by date, user, or content.
  • Image: Use if you need; never required.
  • Memory Recall: Semantic (embedded/meaning-based) or Rapid (word-based) memory search. Both can be filtered by user or all users

You control all layouts, all workflows.


API Highlights

Perception (RAM only):

mem.savePerception("live context chunk")
mem.retrievePerception()   # FIFO, up to limit
mem.clearPerception()

Sensory / STM / LTM:

mem.saveSensory("input", "response", "user", mem.senDir)
mem.retrieveSensory(mem.getDir(mem.senDir, "user.db"))
mem.saveConversationDetails("input", "response", "user", mem.stmUserConversationDetails)
mem.retrieveConversationDetails("user", [mem.stmUserConversationDetails, mem.ltmUserConversationDetails])
mem.setSynMemModel("model_name") # Set the model for embeddings, if you forget to set it, it will default to rapid that way your memory recall is always available.
mem.recallMemory(
    "your query",
    [mem.stmUserConversationDetails, mem.ltmUserConversationDetails],
    user="user",         # or None for all users
    type="Embedded",     # or "Rapid"
    topK=5,              # number of results
    minScore=60,         # min score for Rapid
    showProgress=False
)

Bonus: Images (if needed):

mem.saveCreatedImage("subject", image_data, mem.stmCreatedImages, mem.stmCreatedImageDetails)

Maintenance (Optional, Recommended)

  • Why? For auto-cleanup, auto-archival, and expired memory removal.
  • Not required for operation.
  • Enable any time—runs in the background so no blocking.

If you don’t enable maintenance, expired items will accumulate until you remove them.


Plug and Play

  • No schemas, no boilerplate.
  • Use with any LLM/agent plug-N-play and go.

FAQ

Q: Is perception persistent? A: No, it is always RAM-only.

Q: Do I need maintenance? A: No, but it’s strongly recommended for any long-running use.

Q: What if I don’t use image storage? A: Ignore all image APIs—they’re bonus, not core.


Code Examples

You can find code examples on my GitHub repository.


License

This project is licensed under the Apache License, Version 2.0. Copyright 2025 Tristan McBride Sr.


Acknowledgements

Project by:

  • Tristan McBride Sr.
  • Sybil

Release files for SynMem 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SynMem 0.1.7
File Size Uploaded
synmem-0.1.7.tar.gz 18.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SynMem 0.1.7
File Interpreter ABI Platform
synmem-0.1.7-py3-none-any.whl Python 3 none any Details

Total release size: 38.7 kB

Release files / synmem-0.1.7.tar.gz

Download URL synmem-0.1.7.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
54d7123658817dbbaf23cd18b8d7a189931fd9e39d998449d2cfd1ac95b37695
BLAKE2b-256 checksum
How to use checksums
bf47488adbcfb22b0a8d2162a26a6f370811ba8acb490f26ce399e071ff3ae46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / synmem-0.1.7-py3-none-any.whl

Download URL synmem-0.1.7-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b50021f9002d6e3049e1880e13805dcc9a4e649dbd40166659106ef0fc082aaa
BLAKE2b-256 checksum
How to use checksums
337cfdf45308e2947fde50c8b68d09d7272464bfeeb6ddaaf257a21a65d29673
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page