Geometric memory engine. Store knowledge as shapes. Retrieve by containment. Verify by chain.
Project description
doorway-memory
Geometric memory engine. Store knowledge as shapes. Retrieve by containment. Verify by chain.
What This Is
A memory system where knowledge is geometry. Not embeddings. Not vectors. Not key-value pairs. Shapes.
A shape is a region in dimensional space with defined boundaries. Store a shape and you're saying "I know what happens inside these boundaries." Query a point and the system answers a binary question: is this point inside known territory, or is it in the void?
That's a different question than "what's similar to this?" Vector databases answer similarity. doorway-memory answers containment. Similarity is fuzzy — close enough counts. Containment is precise — you're inside or you're not.
pip install doorway-memory
from doorway_memory import Memory, Shape, Dimension
mem = Memory()
# Define a region of known territory
shape = Shape(dimensions={
"temperature": Dimension("temperature", 90.0, 110.0),
"pressure": Dimension("pressure", 0.9, 1.1),
})
mem.store(shape)
# Is this point inside known territory?
mem.is_known({"temperature": 100.0, "pressure": 1.0}) # True
# Is this point in the void?
mem.is_void({"temperature": 200.0, "pressure": 1.0}) # True — unknown territory
No AI required. No specific domain. Any system that operates in a dimensional space can use this.
Scanner — Zero Cold Start
Point doorway-memory at your existing system. It reads the structure and mints shapes automatically.
from doorway_memory import Memory, scan
mem = Memory()
# Scan a pandas DataFrame
import pandas as pd
df = pd.read_csv("orders.csv")
mem.scan_and_store(df)
# Every numeric column becomes a dimension.
# Observed min/max become boundaries. Done.
# Scan a database
mem.scan_and_store("postgresql://user:pass@localhost/mydb")
# Each table becomes a shape. Numeric columns become dimensions.
# Scan a JSON file or API response
mem.scan_and_store("data.json")
# Walks nested structure. Extracts numeric fields with ranges.
# Scan an OpenAPI spec
mem.scan_and_store("openapi.yaml")
# Each endpoint with numeric parameters becomes a shape.
# Scan a Python codebase
mem.scan_and_store("./src")
# Functions with typed numeric parameters become shapes.
Day one: your library is populated with the geometric territory of your own infrastructure. No manual shape definition. No cold start.
The scan() function auto-detects source type. One function, any source.
Confidence — How Deeply Known
Containment isn't binary when you need nuance. confidence() tells you how deep inside known territory a point sits.
shape = Shape(dimensions={
"x": Dimension("x", 0.0, 100.0),
})
mem.store(shape)
# Center of shape — maximum confidence
shape.confidence({"x": 50.0}) # 1.0
# Near the edge — low confidence
shape.confidence({"x": 95.0}) # 0.1
# On the boundary — zero
shape.confidence({"x": 100.0}) # 0.0
# Outside — zero
shape.confidence({"x": 110.0}) # 0.0
# Per-dimension breakdown
shape.confidence_breakdown({"x": 50.0, "y": 90.0})
# {"x": 1.0, "y": 0.2} — strong on x, weak on y
Edge knowledge and core knowledge are distinguishable.
Growth — Shapes That Learn
Shapes expand from use. When points consistently land just outside a boundary, the shape grows to absorb them.
mem = Memory(growth=True)
shape = Shape(dimensions={"x": Dimension("x", 0.0, 10.0)})
mem.store(shape)
# Point at 10.5 is a near-miss — just outside the boundary
mem.recall({"x": 10.5}) # Empty — in void
mem.recall({"x": 10.5}) # Still tracking...
mem.recall({"x": 10.5}) # Near-miss count: 3
mem.recall({"x": 10.5}) # Near-miss count: 4
mem.recall({"x": 10.5}) # Threshold hit — shape expands
mem.is_known({"x": 10.5}) # True — boundary grew
The library calibrates itself from actual queries. No manual tuning.
Overlap — Cross-Domain Emergence
When two shapes share a region of dimensional space, that intersection is detected automatically and stored as a new derived shape.
shape_a = Shape(
dimensions={"x": Dimension("x", 0.0, 10.0)},
metadata={"domain": "physics"}
)
shape_b = Shape(
dimensions={"x": Dimension("x", 5.0, 15.0)},
metadata={"domain": "economics"}
)
mem.store(shape_a)
mem.store(shape_b)
# Overlap detected: x=[5.0, 10.0]
# New derived shape stored with both parents linked.
# A cross-domain pattern nobody explicitly defined.
Decay — Knowledge That Fades
Shapes that aren't queried shrink over time. Frequently accessed shapes resist decay.
mem = Memory(decay=True)
mem.store(shape)
# Shape is active — accessed regularly
mem.recall({"x": 5.0}) # Access recorded
# Much later — no queries for weeks...
mem.maintain() # Boundaries contract slightly
# Even later — still no queries...
mem.maintain() # Shape archived — removed from active library,
# preserved in chain for history
The library self-prunes. Active knowledge stays strong. Dead knowledge fades gracefully.
Merge — Shape Fusion
When growth causes two shapes to touch, they merge into one continuous region.
# Shape A: x=[0, 10]
# Shape B: x=[8, 20] (overlaps significantly)
# After merge: single shape x=[0, 20]
# Parents archived. Merged shape replaces both.
The library consolidates instead of accumulating redundant overlapping shapes.
Narrative — Trajectories Through Knowledge
Shapes stored in sequence form trajectories. The system predicts what comes next.
# Record a learning trajectory
mem.store_in_trajectory(shape_a, "session-1")
mem.store_in_trajectory(shape_b, "session-1")
mem.store_in_trajectory(shape_c, "session-1")
# Another session follows a similar path
mem.store_in_trajectory(shape_a, "session-2")
mem.store_in_trajectory(shape_b, "session-2")
# Predict: after shape_b, what usually comes next?
mem.predict_next(shape_b.id)
# [("shape_c_id", 0.67), ...]
# Find common paths across all sessions
mem.find_common_paths(min_length=2)
# [["shape_a_id", "shape_b_id"]] — this sequence appears in multiple trajectories
Memory has temporal structure. Not just what you know, but how you learned it.
Void Mapping — The Shape of What You Don't Know
The void has structure. Boundaries. Size. Neighbors.
# What percentage of the bounded space is unknown?
mem.void_percentage() # 0.73 — 73% is void
# Where are the biggest gaps?
regions = mem.map_void()
for region in regions:
print(region.volume()) # How big is this gap?
print(region.center()) # Where is it?
print(region.neighboring_shapes) # What borders it?
# What's the single largest gap?
biggest = mem.largest_gap()
The gap detector expressed as persistent geometry.
Emergence — Tier 2 Pattern Detection
Patterns that span many shapes across many domains emerge automatically.
# After storing shapes from multiple domains...
tier2_patterns = mem.detect_emergence()
for pattern in tier2_patterns:
print(pattern.shape) # The geometric intersection
print(pattern.parent_ids) # Which shapes contribute
print(pattern.domains) # Which domains it spans
print(pattern.strength) # How many shapes participate
# Generative Complexity System — the system recognizing its own growth
gcs = mem.detect_gcs(growth_history)
# Intelligence System — the mechanism recognizing the mechanism
is_pattern = mem.detect_is()
Nobody programs emergence. It's detected from the geometry.
Verified Memory — Cryptographic Chain
Every store, every growth event, every merge, every archive is anchored to an xycore cryptographic chain. Optional but powerful.
pip install doorway-memory[anchor]
mem = Memory(anchor=True)
shape_id = mem.store(shape)
# Verify any shape's provenance
proof = mem.verify(shape_id)
# {"anchor_id": "...", "timestamp": ..., "hash": "...", "verified": True}
# Replay memory history
for shape in mem.replay():
print(shape.id, shape.metadata)
Provable, replayable history of everything the system has ever learned.
Storage Backends
# In-memory (default — no persistence)
mem = Memory()
# File persistence
mem = Memory(backend="file", path="./memory.json")
# Supabase (cloud persistence)
pip install doorway-memory[supabase]
mem = Memory(backend="supabase", config={
"url": "https://xxx.supabase.co",
"key": "your-service-key"
})
Configuration
Every threshold is tunable.
from doorway_memory.growth import GROWTH_THRESHOLD, NEAR_MISS_MARGIN
from doorway_memory.decay import DECAY_RATE, DECAY_GRACE_PERIOD
from doorway_memory.merge import MERGE_OVERLAP_RATIO
from doorway_memory.emergence import MIN_SHAPES_FOR_EMERGENCE
| Threshold | Default | What It Controls |
|---|---|---|
| NEAR_MISS_MARGIN | 0.15 | How far outside counts as near-miss |
| GROWTH_THRESHOLD | 5 | Near-misses before expansion |
| DECAY_RATE | 0.02 | Boundary shrink per cycle |
| DECAY_GRACE_PERIOD | 7 days | Time before decay starts |
| MERGE_OVERLAP_RATIO | 0.50 | Overlap % to trigger merge |
| MIN_SHAPES_FOR_EMERGENCE | 3 | Minimum shapes for Tier 2 |
Full API
from doorway_memory import Memory, Shape, Dimension, scan
mem = Memory()
# ── Store ──────────────────────────────
mem.store(shape) # Store a shape
mem.store_in_trajectory(shape, "session-1") # Store as trajectory step
mem.scan_and_store(source) # Scan system, store all shapes
# ── Recall ─────────────────────────────
mem.recall(point) # Shapes containing this point
mem.recall_with_confidence(point) # With confidence gradients
mem.is_known(point) # Inside known territory?
mem.is_void(point) # In the void?
# ── Predict ────────────────────────────
mem.predict_next(shape_id) # What comes after this?
mem.find_common_paths() # Shared trajectories
# ── Map ────────────────────────────────
mem.map_void() # Characterize unknown territory
mem.void_percentage() # % of space that's void
mem.largest_gap() # Biggest void region
# ── Emerge ─────────────────────────────
mem.detect_emergence() # Find Tier 2 patterns
mem.detect_gcs(history) # Growth pattern self-recognition
mem.detect_is() # Intelligence mechanism detection
# ── Verify ─────────────────────────────
mem.verify(shape_id) # Cryptographic proof
mem.replay() # Walk memory history
# ── Maintain ───────────────────────────
mem.maintain() # Run decay cycle
mem.count() # Shape count
Not a Vector Database
| Vector DB | doorway-memory | |
|---|---|---|
| Stores | Embeddings (points) | Shapes (regions) |
| Retrieves by | Similarity (nearest neighbor) | Containment (inside or not) |
| Answer type | "Here's what's close" | "You're inside / you're in the void" |
| Confidence | Distance score | Depth gradient (center to boundary) |
| Learns from use | No | Yes — growth, decay, merge |
| Cross-domain | No | Yes — overlap detection |
| Maps unknown | No | Yes — void mapping |
| Emergence | No | Yes — Tier 2 pattern detection |
| Verified | No | Yes — cryptographic chain |
Part of Doorway
doorway-memory is a standalone package. It does not require Doorway, AI, or any specific domain.
It's also the geometric memory layer of the Doorway reasoning stack.
| Package | What It Is |
|---|---|
| xycore | Cryptographic chain primitive |
| pruv | Verification infrastructure |
| doorway-memory | Geometric memory engine (this package) |
| doorway-agi | AGI reasoning engine |
| vantagepoint | Structured thinking methodology |
License
Apache License 2.0 — see for details.
© 2026 Doorway · doorwayagi.com
Created by Luke H
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file doorway_memory-0.2.0.tar.gz.
File metadata
- Download URL: doorway_memory-0.2.0.tar.gz
- Upload date:
- Size: 49.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61dff195ce34e67a8ce0d8d4b017e3fa93f5b9a2482d2b9dc14fe225d10f5e26
|
|
| MD5 |
4165604d137b47c0a1df78262c84d4b3
|
|
| BLAKE2b-256 |
64a4e7c5ca2f0d944698504bb8e2ba252bfc0656ecb5c98b34363dc14f5df5f9
|
Provenance
The following attestation bundles were made for doorway_memory-0.2.0.tar.gz:
Publisher:
publish.yml on mintingpressbuilds/doorway-memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
doorway_memory-0.2.0.tar.gz -
Subject digest:
61dff195ce34e67a8ce0d8d4b017e3fa93f5b9a2482d2b9dc14fe225d10f5e26 - Sigstore transparency entry: 1109109166
- Sigstore integration time:
-
Permalink:
mintingpressbuilds/doorway-memory@0d4b64d3c5b17c9be019e13af410b210466247d2 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/mintingpressbuilds
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0d4b64d3c5b17c9be019e13af410b210466247d2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file doorway_memory-0.2.0-py3-none-any.whl.
File metadata
- Download URL: doorway_memory-0.2.0-py3-none-any.whl
- Upload date:
- Size: 35.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2670aad64cd41b399d71ebda89de0bab335738989ab14031ad30f9e6aa4d599d
|
|
| MD5 |
ec4104ba804102aaf43bb8d9b92e3bee
|
|
| BLAKE2b-256 |
dfb0d53e680b76b2bd2e44449d287759e821f4b37440c7246c96bfa87011a331
|
Provenance
The following attestation bundles were made for doorway_memory-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on mintingpressbuilds/doorway-memory
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
doorway_memory-0.2.0-py3-none-any.whl -
Subject digest:
2670aad64cd41b399d71ebda89de0bab335738989ab14031ad30f9e6aa4d599d - Sigstore transparency entry: 1109109175
- Sigstore integration time:
-
Permalink:
mintingpressbuilds/doorway-memory@0d4b64d3c5b17c9be019e13af410b210466247d2 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/mintingpressbuilds
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0d4b64d3c5b17c9be019e13af410b210466247d2 -
Trigger Event:
release
-
Statement type: