Skip to main content

PrismCortex

PyPI Python 3.10+ License: MIT GitHub

Deterministic, auditable, self-consolidating memory for AI agents.

Compliance-grade memory for regulated teams: byte-identical replay, bitemporal audit, and self-hosted sovereignty — not another vector chat log.

Repository: https://github.com/insightitsGit/PrismCortex (public)

🤖 AI agent handoff · 📄 Whitepaper · 📊 Benchmarks · ⚖️ How we compare · 🗺️ Roadmap · 🏗️ Design spec

Product page: insightits.com/products/prismcortex


AI assistants: docs/ai-overview.md · docs/llm-context.md · docs/architecture.md

What is this?

Deterministic, auditable, self-consolidating memory for AI agents (byte-identical replay, bitemporal audit).

Package: prismcortex 0.3.0 · Azure E2E scorecard still cites the v0.2.1 run

Who is it for?

Regulated teams needing compliance-grade agent memory, not a chat-log vector store.

What problem does it solve?

Chat-log / SaaS memory fails audit, correction, and residency requirements.

When NOT to use it

You only need ephemeral chat history with no audit requirements.

What's new in 0.3.0

  • mem.on_event(callback) — correction / conflict / forget notifications for PrismShine and cache invalidation (MemoryEvent)
  • Evidence correction metadatavalid_from, supersedes_prior, prior_value on /explain
  • [prism-plus] extra — use prismlib-plus instead of prismlib (mutually exclusive with [prism])
  • Release notes: docs/CHANGELOG_0.3.0.md

Why PrismCortex exists

Most agent memory is an append-only chat log or a vector store in someone else's cloud. That breaks in production when:

  • Legal asks "what did the agent know on March 3rd?" — and you grep chat logs
  • A correction ($40k → $55k) doesn't reliably surface — or erases audit history
  • Compliance rejects third-party memory SaaS for data residency

PrismCortex digests each turn into a knowledge graph, consolidates uncertain facts in the background (sleep()), and recalls by rendering facts once and freezing answers in a content-addressed cache.

from prismcortex import reference_memory

mem = reference_memory(cache_path=".prismcortex_cache/demo.json")

mem.digest("My production deploy budget is $40,000.")
print(mem.recall("What's my deploy budget?").answer)        # → "$40,000"

mem.digest("Correction: my deploy budget is now $55,000.")  # fast-tracked (ALERT)
print(mem.recall("What's my deploy budget?").answer)        # → "$55,000"
# The $40,000 fact is still on record — time-stamped — for audit / time-travel.

Validated claims (Azure E2E, real Gemini, v0.2.1)

Claim Result
Replay determinism 24/24 byte-identical replays
Corrections + audit $40k → $55k; superseded fact retained
Cost / cache 99.6% hit rate — 30 Gemini calls / 2,563 recalls
Cached replay ~6 ms vs ~724 ms first render
Mixed load (c=20) 0 errors on 4 vCPU node
Reference load SLO PASS (slo_pass: true) — recall + mixed @ c=20, digest @ c=16
Server reliability 0 errors on core path
Scale (50k facts, ANN) 85% hit@8, 74 ms p95 retrieval

Details: benchmarks/RESULTS.md · docs/WHITEPAPER.md


How we compare

Mem0 and Zep lead published accuracy benchmarks (LoCoMo, LongMemEval, DMR). PrismCortex leads compliance — byte-identical replay, bitemporal audit, and self-hosted sovereignty.

Mem0 (published) Zep (published) PrismCortex (live)
LoCoMo accuracy 91.6% Full run pending
Correction test ($40k→$55k) Top hit stale in our OSS run Yes — new value + audit trail
Byte-identical replay No No 24/24 on Azure
Bitemporal audit (OSS) Varies Graph Yes
Self-hosted default OSS + SaaS SaaS Yes

Head-to-head: same Gemini, same correction — PrismCortex surfaced $55k after update; Mem0 OSS top retrieval stayed $40k in our live test. Reproducible: benchmarks/results/competitive/vs_mem0.json.

Landing page spec for agents: compare.md · Full technical comparison: docs/COMPETITIVE.md


Install

pip install prismcortex                  # core (MIT)
pip install "prismcortex[gemini]"        # + real Gemini extraction/rendering
pip install "prismcortex[prism]"         # + Insight ITS stack with prismlib
pip install "prismcortex[prism-plus]"    # + same stack with prismlib-plus (ChorusGraph)
pip install "prismcortex[server]"        # + FastAPI HTTP service
pip install "prismcortex[gemini,server,prism]"   # production stack

Requires Python 3.10+.

[prism] and [prism-plus] are mutually exclusive — both install the prism import namespace. Use [prism] for standalone PrismCortex; use [prism-plus] when the host already depends on prismlib-plus (e.g. ChorusGraph). Do not install both extras.


Two ways to run

1. Python library (in-process)

Best for a single agent embedded in your app:

from prismcortex import reference_memory

mem = reference_memory()   # needs GEMINI_API_KEY for real extraction
mem.digest("We use Postgres 16 in us-east-1.")
result = mem.recall("Where is our database hosted?")
print(result.answer, result.cache_hit, result.confidence)

# Optional: subscribe to corrections (PrismShine / semantic-cache eviction)
unsub = mem.on_event(lambda ev: print(ev.kind, ev.old_value, "→", ev.new_value))
# unsub() when done

2. HTTP service (multi-agent, Docker, Azure)

Best for platform teams and non-Python clients:

export GEMINI_API_KEY=...
export PRISMCORTEX_API_KEY=your-secret
uvicorn prismcortex.server:app --host 0.0.0.0 --port 8080
# OpenAPI docs: http://localhost:8080/docs
curl -X POST http://localhost:8080/digest \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-secret" \
  -d '{"text": "Our deploy budget is $40,000."}'

curl -X POST http://localhost:8080/recall \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-secret" \
  -d '{"query": "What is our deploy budget?"}'

Docker + Azure deploy: see deploy/run_only.sh.


Why it's different

Append-only RAG PrismCortex
Storage every chat turn graph topology (the gist)
Updates append + hope retrieval ranks it bitemporal: invalidate old, add new, keep history
Determinism logs + LLM drift content-addressed cache, replay-identical
Cost re-extract every call salience-gated writes, cached reads
Audit grep the logs evidence trail + replay certificate

Enterprise features (v0.3)

Feature Endpoint / module
Explainability POST /explain
Time-travel recall POST /recall_at
Replay certificate GET /replay_certificate
Conflict surfacing GET /conflicts, POST /conflicts/resolve
GDPR erasure POST /forget
Legal hold POST /legal_hold
Multi-tenant + RBAC auth.py, tenant.py
Audit console GET /console
Metrics / ops GET /metrics, GET /dashboard
50k+ facts (ANN) PRISMCORTEX_USE_ANN=1
Correction events Memory.on_eventMemoryEvent (library)

Docs: docs/SLA.md · docs/CAPACITY.md · docs/SOC2_ROADMAP.md · SECURITY.md


Architecture

digest(text) ─▶ salience gate ─▶ extract gist ─▶ delta in RAM
                   ├─ certain / urgent ─▶ commit  (version++)
                   └─ uncertain ───────▶ staging buffer ──▶ sleep() ──▶ commit

recall(query) ─▶ retrieve subgraph ─▶ cache hit? replay (byte-identical)
                                    └─ miss? render once → freeze
Port Reference (core, no Prism deps) Production extras
Gist projection hashing embeddings prismlang ([prism] / [prism-plus])
Graph store in-memory bitemporal Cortex-owned store (+ prismrag-patch governor)
Consolidation in-process prismresonance
Render cache JSON file prismlib or prismlib-plus
Extraction Gemini ([gemini])

Dependency note: pip install prismcortex needs only pydantic, numpy, and cryptography. Prism-family packages are optional via [prism] or [prism-plus].

Full design: DESIGN.md · Whitepaper: docs/WHITEPAPER.md · Changelog: docs/CHANGELOG_0.3.0.md


Determinism, honestly

We do not claim "temperature 0 = identical output" for shared API models.

We claim replay determinism: once an answer is rendered for a (query, memory-version) pair, it is frozen and replayed byte-identically. Facts are extractive from the graph; prose is frozen after first render. See DESIGN.md §2.


Development & benchmarks

git clone https://github.com/insightitsGit/PrismCortex.git
cd PrismCortex
pip install -e ".[dev,gemini,server]"

pytest tests/test_graph_engine.py          # no API key
GEMINI_API_KEY=... pytest                  # full suite

python benchmarks/scale_bench.py --ann     # 50k ANN scale test
BACKEND=prism bash deploy/run_only.sh      # Azure E2E (needs .env)

Publish 0.3.0 to PyPI

# Requires PYPI_API_TOKEN in .env (never commit)
.\scripts\publish_pypi.ps1
# Or: create a GitHub Release → .github/workflows/publish.yml (trusted publishing)

Verify: pip install prismcortex==0.3.0 · https://pypi.org/project/prismcortex/


Documentation index

Doc Contents
AGENTS.md AI agent handoff — canonical URLs, contacts, processes
docs/CHANGELOG_0.3.0.md 0.3.0 release notes — MemoryEvent, packaging
ai-info.txt Machine-readable product summary for LLM crawlers
docs/WHITEPAPER.md Product whitepaper — problem, architecture, validation
DESIGN.md Engineering design spec
benchmarks/RESULTS.md Azure benchmark scorecard
ROADMAP.md Enterprise GA plan + honest gaps
docs/SLA.md Reference SLOs + commercial tiers
docs/CAPACITY.md Sizing guide (~20 concurrent clients / 4 vCPU)
docs/LOAD_BENCHMARK.md Load test explainer — what we fixed, how to read SLO fields
docs/NOTEBOOKLM_STORY.md NotebookLM source — story, how-to, marketing & technical briefing
compare.md Landing page spec — comparison tables, copy blocks for insightits.com
docs/COMPETITIVE.md Market comparison — Mem0/Zep, LoCoMo, head-to-head
docs/SCALING.md Horizontal read scaling story
docs/SUPPORT.md 24×7 Enterprise support model
docs/SOC2_ROADMAP.md Compliance readiness
SECURITY.md Security posture

Licensing

Open-core (MIT): digest/recall, bitemporal graph, determinism cache — free on PyPI.

Commercial: audit console, advanced governance, scale tiers — offline Ed25519 license key, no phone-home, air-gap friendly. See DESIGN.md §7.

Enterprise: info@insightits.com · +1 (973) 692-6919 · Insight IT Solutions LLC
Address: 39 Aliso Ridge Loop, Mission Viejo, CA 92691, US


Related Insight ITS products

PrismCortex orchestrates the Insight ITS stack. Related products:

Download files

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

Source Distribution

prismcortex-0.3.0.tar.gz (64.1 kB view details)

Uploaded Source

Built Distribution

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

prismcortex-0.3.0-py3-none-any.whl (55.5 kB view details)

Uploaded Python 3

File details

Details for the file prismcortex-0.3.0.tar.gz.

File metadata

  • Download URL: prismcortex-0.3.0.tar.gz
  • Upload date:
  • Size: 64.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for prismcortex-0.3.0.tar.gz
Algorithm Hash digest
SHA256 514c5d950ea187624b8044f3bf58732333d29b04a1a8a1ea83cd74a1840df2b9
MD5 986cb40e2f25df336c3bd5974444b932
BLAKE2b-256 2ddf2e3599b07b4ae9914a1776bc10f2ae4ddc7c80998ddf229a130a43959423

See more details on using hashes here.

File details

Details for the file prismcortex-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: prismcortex-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 55.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for prismcortex-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 154a619eb839fadb9e9a32c699cdd6c1f8a5a888497e31b1e8a458a604b62c30
MD5 e37e3f8a902429ae2351cb7c1ea7e1d2
BLAKE2b-256 1ecf331388e211826341faf4f91fd6720c5611e37107ae2da77abd4e8e225a2d

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 Sentry Error logging StatusPage Status page