Skip to main content

🧠 Urdyn

Models are replaceable. Memory should remain portable.

Urdyn is a local-first, private-by-default memory engine for projects, people, and AI agents. It keeps durable decisions, evidence, attempts, lessons, and project context in .urdyn/, independently of any model or provider.

⚡ Quick start

Install Urdyn from PyPI:

pip install urdyn-memory

Or install it from a local source checkout:

cd /path/to/urdyn-memory
python -m pip install .

Then create a Brain inside an existing project:

cd my-project
urdyn create dev
urdyn status

urdyn init creates a Brain only in an empty or not-yet-existing directory, and otherwise re-opens the Brain already there. In a non-empty directory without a Brain it refuses and points to urdyn create: such a directory cannot be told apart from a project whose Brain was lost, so a Brain is never created there implicitly. (Urdyn 0.4.0 created one; since 0.5.0 it deliberately does not.)

Save something and ask for it back in your own words:

urdyn remember "The bread arrives at six from the Rossi bakery"
urdyn recall "bread"

recall shows exact matches first and otherwise falls back to the ranked query. Without the semantic index that query is lexical: the memory must contain the question's key words in the same form. With semantic retrieval enabled, a question in your own words, such as urdyn recall "when does the bread come", finds the memory even when the words differ.

The base engine requires Python 3.12+, declares zero mandatory runtime dependencies, and needs no model or API key.

Why Urdyn?

Provider history belongs to a provider and a session. When the session ends, the model changes, or another tool takes over, the project's operational knowledge should not disappear with it.

The model is replaceable. The memory is persistent.

Urdyn is not a conversation archive. It stores explicit, structured records with provenance and current-state rules, then retrieves the material relevant to the task at hand. A new AI session can reconstruct useful project context without depending on a previous provider transcript.

🧠 What Urdyn remembers

Urdyn keeps different kinds of information separate instead of flattening everything into chat text:

Concept What it represents
Memory Notes, decisions, root causes, pending work, questions, invariants, environment facts, and lessons
Evidence User statements or confirmations, command/test/tool output, observed errors, file references, and document observations
Attempt What was tried, how it was tried, and whether it succeeded, failed, or was partial
Skill An ordered procedure deliberately promoted from a Lesson; never created automatically
Source A project file identity with an append-only history of observations
Current state The current projection of Memory after superseded records are excluded; full history remains available

This preserves decisions, failures, provenance, and lessons as distinct records rather than pretending they all carry the same authority.

🔒 Local-first and private by default

  • Canonical data lives inside .urdyn/ in your workspace.
  • No account, cloud service, or API key is required for the base engine.
  • Base operation does not automatically upload data or download a model.
  • urdyn create/urdyn init add .urdyn/ to the directory's .gitignore (existing rules and line endings are kept, nothing is duplicated, a symlinked .gitignore is never written through). When Git is available they ask Git to confirm the Brain's files are ignored, and refuse to create a Brain if Git already tracks files under .urdyn/ or a rule explicitly un-ignores it; the Git index is never modified. Without Git the entry is written and reported as not verified. A .gitignore entry only prevents accidental commits: it is not encryption, access control, or protection of data already pushed.
  • Seeding a document stores the observed document content locally in .urdyn/; it is not sent elsewhere.

The optional semantic extra is the explicit exception to zero downloads: its setup fetches a pinned embedding model from Hugging Face.

🤖 Works with AI tools

Connect any MCP client (Claude Code, Claude Desktop, Codex, Cursor, ...) to a Brain:

claude mcp add urdyn -- urdyn mcp --brain /absolute/path/my-project

The agent then searches records, your own memories and the project's documents in one budgeted packet, reads more of a document around a passage, and writes attributed, unverified memories of its own. See docs/mcp.md for every client, the options and the trust boundary: the client is not confined, the grant limits only what the MCP tools do. A Linux launcher that also confines the client is described in docs/confined-client.md.

Agents with shell access can also use the public CLI, and any tool can take exported context:

AI / tool
   │  MCP (urdyn mcp) · CLI · Python API · urdyn export
   ▼
validation · provenance · memory rules
   │
   ▼
.urdyn/

AI tools should use these interfaces and never edit .urdyn/ directly.

🧭 Motherboard (experimental)

A Brain holds one project. The Motherboard holds the base of the user's world, outside every Brain: who the user is, the people, places, devices and projects they talk about, with their aliases in any language, and how they relate. With the integrated_context retrieval profile it decides which lexical matches count: a request about one restaurant does not pull in records about another one that merely shares a word. Entries learned from memories stay proposed until the owner confirms them. See docs/motherboard-context.md.

Existing project files

Explicit file seeding works in every profile. In a dev workspace, urdyn seed with no paths lists discovery candidates and records nothing. Name regular UTF-8 text files explicitly to observe them:

urdyn seed                           # list candidates; record nothing
urdyn seed README.md pyproject.toml  # record specific files

Discovery in dev is a bounded recursive walk: root-level manifest files (README*, LICENSE*, pyproject.toml, ...) plus documentation-like files (.md, .txt) anywhere in the project tree, at any depth. It stays bounded and privacy-safe by construction, not by asking:

  • it never descends into .git/, .venv/venv/, node_modules/, dist//build/, caches, or Urdyn's own .urdyn/ directory;
  • it honors .gitignore and .git/info/exclude when present — anything a project already tells Git to forget, Urdyn never surfaces, indexes, or observes;
  • it never follows a symlink outside the workspace, never reads a binary or oversized file, and applies a discovery-only sensitive-name filter (*secret*, *password*, *token*, ...) on top of the credential-name guard explicit seeding already has;
  • Git is entirely optional: ignore files are read directly as plain text, never through a git subprocess, so discovery works identically with or without a repository.

Each seeded file becomes a Source with a document-observation Evidence record. Urdyn keeps the observed text, digest, size, and timestamp, but does not treat the document's claims as verified knowledge. Listing a candidate never records anything by itself — that stays an explicit urdyn seed <path>....

👀 Project watcher

The dev profile can keep project-document observations current in the background:

urdyn watch status
urdyn watch start
urdyn watch stop

urdyn init dev enables and starts the watcher. It watches every already-tracked Source plus everything the same bounded, privacy-filtered discovery above currently proposes — including a newly created file nobody has seeded yet, not only files that already have a tracked history. Already-tracked files are checked on a fast, adaptive cadence (as often as every 2 seconds while active); noticing a brand-new, never-seen file uses a slower cadence (about every 10 seconds), since nothing about a file with no baseline can be lost by finding it a little later. Changes create Source/Observation/Evidence records, never automatic Memory or other canonical knowledge, and remain local. urdyn watch stop stops and persistently disables it.

The watcher is validated and supported on Linux in this release. Known limits:

  • Deletions and renames are not tracked. Existing history is retained, and a renamed file begins a new Source history.
  • It is not a boot service. After a reboot, the next normal urdyn command restarts an enabled watcher and rechecks already tracked files.
  • A file first created while the watcher is down is discovered only after it changes again, not retroactively at restart.

Evidence ≠ Knowledge

Evidence records what was observed. Memory records what the caller asks Urdyn to treat as knowledge, with an explicit epistemic state.

Recording Evidence never creates a Memory, Lesson, or Skill automatically. A seeded README is faithful evidence of what that file said at that moment; it is not proof that the README is correct. A new Memory can be user_asserted, inferred, or verified, and verified requires explicitly designated supporting Evidence of a qualifying kind. Urdyn enforces that structural gate but does not claim to understand whether the evidence truly proves the conclusion.

🧩 Profiles

urdyn create [general|dev|lab]   # in an existing project
urdyn init [general|dev|lab]     # in an empty or new directory
Profile Implemented behavior
general Core engine; explicit seed works, but no-path discovery and the watcher are unavailable
dev Adds no-path project-file discovery and the Linux-validated background watcher
lab Reserved canonical profile identifier; currently behaves like general

All profiles share the same canonical store, retrieval, preflight, context, and export behavior. Today, the profile changes only no-path seed discovery and watcher availability.

📦 Python API

The distribution is urdyn-memory, the import package is urdyn, and the public workspace class is Urdyn:

from urdyn import Urdyn

ud = Urdyn.discover()
ud.remember("SQLite is the canonical project store.", kind="decision")

for memory in ud.recall("SQLite is the canonical project store"):
    print(memory.content)

The Python API and the urdyn CLI share the core validation and persistence rules. This README shows only the essential entry points; use the public types exported from urdyn for library integration.

Context compilation and export

Before starting work, ask Urdyn for relevant prior experience:

urdyn preflight "wrap a multi-step migration in one transaction"
urdyn context "wrap a multi-step migration in one transaction"
urdyn export "wrap a multi-step migration in one transaction"

context compiles a task-aware, character-budgeted working context. export renders the same kind of context as portable generic text suitable for redirection or piping:

urdyn export "<task description>" > context.txt

This export is task-scoped context, not a full backup or memory-archive export.

Seeded project documents can contribute task-relevant Project Evidence to compiled context through lexical retrieval and, when enabled, semantic retrieval. For large documents, Urdyn retrieves the portions relevant to the task instead of requiring the entire document to fit the context budget. The retrieved text remains document Evidence with its Source provenance: Source != Evidence != Durable Memory, and retrieving Evidence never promotes it to Memory.

Semantic retrieval

The base engine works offline with lexical/full-text retrieval. Semantic retrieval is optional:

pip install "urdyn-memory[semantic]"
urdyn semantic setup

Setup downloads a pinned embedding model and builds a derived local index next to the canonical store. By default (URDYN_SEMANTIC_MODEL=auto) Urdyn measures the machine and picks EmbeddingGemma-300m (int8 ONNX, more accurate) when building the index is estimated to take under ten minutes, and the lighter multilingual MiniLM otherwise; minilm or embeddinggemma selects one explicitly. Both are pinned to fixed revisions and digests; see their model cards for their licenses (EmbeddingGemma is under the Gemma Terms of Use). Encoders use an accelerator when ONNX Runtime offers one, with CPU fallback. The models are not redistributed with Urdyn. See semantic models. The index is rebuildable; when semantic retrieval is unavailable, canonical data remains intact and Urdyn falls back to lexical retrieval.

For seeded project documents, semantic relevance is computed at the granularity of derived text chunks rather than whole documents: a long document is split into paragraph-sized segments, each gets its own embedding, and a document becomes eligible for retrieval based on the strongest match among its own current chunks. This lets a long, multi-topic document surface on a query that only matches one of its sections, while admission still stays bounded to a small number of distinct documents per query, so one long document cannot crowd out every other seeded document. Chunks are always derived and rebuilt from the same canonical document text; they are never stored as their own kind of record and carry no authority independent of the document they came from.

External semantic backend (experimental)

SemanticBackend, SemanticBackendIdentity and Urdyn.configure_semantic_backend(backend) let an application supply its own local embedding function. The backend is attached to one Urdyn instance and must be configured again after a new open() or init(). available() checks local availability without network access; encode(texts) returns one finite, non-zero vector per text. Urdyn validates type, count and width, converts to float32 rejecting non-finite values and zero rows, normalizes under the versioned contract l2-scaled-f64-v1, and keeps managing the index, retrieval and fallback. An index built under the previous l2 contract is neither read nor updated: rebuild it explicitly with semantic_setup(); canonical memory is not touched. If a call's semantic read fails, the answer is entirely lexical and says so (unavailable). The built-in ONNX backend remains the default.

Only identities of the MiniLM artifacts at the calibrated revision, with 384 dimensions, are accepted for now. The identity includes the SHA-256 of model and tokenizer and a stable identifier of the encoding policy (batching and padding included), all persisted with the index. Clients must verify the hashes of the actual files before reporting available(). The contract does not enable new models with uncalibrated admission thresholds. The semantic-backend extra installs only NumPy. This API is experimental and new in 0.5.0.

from urdyn import Urdyn

brain = Urdyn.open("/path/to/brain")
brain.configure_semantic_backend(backend)  # implements SemanticBackend
brain.semantic_setup()                     # rebuilds the derived index

🛠 Current scope and limitations

Urdyn is alpha software (release 0.5.0). It does not currently include:

  • cloud sync;
  • a GUI or desktop application;
  • native provider adapters (MCP is the integration: see docs/mcp.md);
  • autonomous AI-driven memory curation;
  • automatic conversation ingestion;
  • full memory-archive import/export.

The CLI/API boundary is deliberate: Urdyn provides the memory engine and its rules, while a person or external tool decides what to record and when to consult it.

💾 Backup, recovery and compatibility

from urdyn import backup

backup.create_backup("my-brain", "my-brain-backup.zip")
backup.restore_backup("my-brain", "my-brain-backup.zip")

A backup covers a Brain directory: one that holds only .urdyn/ and .gitignore, such as a general Brain served to agents with urdyn mcp --brain. A Brain that shares its directory with project files, or a dev Brain with watcher state, is refused for now; backing those up is planned for the next release. Archives record the engine version that wrote them; 0.5.0 restores archives written by 0.4.0 and 0.5.0.

Restore is staged and atomic, keeps the previous Brain, and refuses an archive of a different Brain. Brains written by Urdyn 0.1.0–0.4.0 open unchanged; development-era Cortex stores are refused, never migrated implicitly. The full-text index can be checked and rebuilt explicitly with urdyn search-index status|rebuild, which also recovers a damaged index with a safety copy. See backup and recovery, search index and compatibility.

📚 Documentation

Getting started · Python API · CLI · AI agents · MCP · Semantic models · Motherboard · Architecture · Storage contract · Security and privacy · Changelog · Contributing · Security policy

Development

uv sync --frozen --all-extras
uv run pytest
HF_HUB_OFFLINE=1 uv run pytest -m real_model
uv build

The full test suite exercises the optional semantic backend, so development setup installs the semantic extra. The base package still has no mandatory runtime dependencies. Tests marked real_model are skipped unless the pinned model is already in the local cache. See CONTRIBUTING.md.

Development requires Python 3.12+ and uv.

License

Apache License 2.0. See LICENSE.

🌍 Languages

This document is in English. See README.it.md for the Italian version.

Metadata

Release files for urdyn-memory 0.5.0

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

Source distribution (sdist)

Source distribution for urdyn-memory 0.5.0
File Size Uploaded Provenance Actions
urdyn_memory-0.5.0.tar.gz 476.1 kB With provenance Details for urdyn_memory-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for urdyn-memory 0.5.0
File Interpreter ABI Platform Actions
urdyn_memory-0.5.0-py3-none-any.whl Python 3 none any Details for urdyn_memory-0.5.0-py3-none-any.whl

Total release size: 987.4 kB

Release files / urdyn_memory-0.5.0.tar.gz

Download URL urdyn_memory-0.5.0.tar.gz
Size 476.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a2fc5fa702dae917f29ecbffbf27a9ffa672524e38d2d2b6a5ffab9fd4a87acf
BLAKE2b-256 checksum
How to use checksums
9d8f0c65d1ce32bccfb81eaaefaa38b67dfa70cf8b86f8c6028e475633ebb050
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Release files / urdyn_memory-0.5.0-py3-none-any.whl

Download URL urdyn_memory-0.5.0-py3-none-any.whl
Size 511.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f3747e36a877e5bad7f44fbeea5d69d9cc04740375d041199b4f9b9475e2aa8
BLAKE2b-256 checksum
How to use checksums
7abe32ffdc790419d6d581add8b10f141541e9dfc7a0cb21f120651a6b63b9a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

Security for urdyn-memory 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for urdyn_memory-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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