Skip to main content

PrismCortex

PyPI Python 3.10+ License: MIT GitHub

Deterministic, bitemporal memory engine for multi-turn AI agents.

Eliminate context decay, stale vector collisions, non-deterministic replay failures, and hallucination ratchets in production RAG/agent architectures.

Repository: https://github.com/insightitsGit/PrismCortex (public) · Package: prismcortex 0.4.0

Author: Amin Parva · Company: Insight IT Solutions LLC · www.insightits.com

AI agent handoff · Whitepaper · Use cases · Benchmarks · How we compare · Design

Product page: insightits.com/products/prismcortex


Why standard RAG memory fails

Failure mode What goes wrong in production
Stale knowledge collisions Naive vector similarity returns superseded policies alongside active ones — the agent cites both.
Context decay & anaphora loss Parent entity subject is lost across multi-turn sessions; “it / that / the policy” no longer resolve.
Multi-hop blindness Continuous vector spaces fail at logical dependency joins (A→B→C) that a graph can walk.
Non-reproducible replays You cannot prove byte-identical state for audit — temperature-0 LLM calls still drift.

How PrismCortex fixes it

Capability Where it lives What you get
Bitemporal auditing determinism.py, graph edges (valid_from / valid_to) Separates real-world event time from ingestion/system time; corrections soft-invalidate, never erase.
Causal graph links engine.py, tests/test_graph_engine.py Extracted facts become relational edges — not isolated float arrays.
Salience & consolidation salience.py, Memory.sleep() Skips low-value turns; parks uncertain facts; consolidates without dropping history.
Byte-identical replay content-addressed cache + /replay_certificate Reproducible answer audits for SOC 2–aligned / compliance workflows.

API surface (real): digest() → graph · recall() → frozen answer · sleep() → consolidate · explain() → evidence.


5-line quickstart

from prismcortex import reference_memory

mem = reference_memory()  # GEMINI_API_KEY for real extraction
mem.digest("California parental leave updated to 12 weeks.")
print(mem.recall("What is our CA leave policy?").answer)
# Correction keeps history: digest a change → recall new value; old edge retains valid_to.

Zero-dependency demo (no API key — rule-based extractor):

python examples/quickstart.py

With real Gemini:

pip install "prismcortex[gemini]"
GEMINI_API_KEY=... python examples/quickstart.py

Competitive positioning

Mem0 / Zep lead published accuracy suites (LoCoMo, LongMemEval). PrismCortex leads compliance — temporal audit, consolidation, causal graph, and byte-identical replay. Do not claim LoCoMo wins until a full PrismCortex run is published.

Capability Naive vector RAG Mem0 / Zep PrismCortex
Temporal auditing No (append / re-rank) Platform / graph varies Yes — OSS bitemporal edges
Execution replay No No byte-identical answers Yes — 24/24 Azure E2E
Memory consolidation Truncate / summarize Product features vary Yes — salience + sleep()
Causal graph engine Flat embeddings Zep: temporal graph; Mem0: memory store Yes — relation edges + evidence

Live correction head-to-head (same Gemini): PrismCortex surfaced $55k after $40k → $55k; Mem0 OSS top retrieval stayed $40k in our run — vs_mem0.json.

Full tables: compare.md · docs/COMPETITIVE.md


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

Claim Result
Replay determinism 24/24 byte-identical
Corrections + audit $40k → $55k; superseded fact retained
Cache 99.6% hit — 30 Gemini / 2,563 recalls
Cached replay ~6 ms vs ~724 ms first render
Mixed load (c=20) 0 errors on 4 vCPU · slo_pass: true
Scale (50k facts, ANN) 85% hit@8, 74 ms p95

Details: benchmarks/RESULTS.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
pip install "prismcortex[server]"        # + FastAPI HTTP service

Requires Python 3.10+. [prism] and [prism-plus] are mutually exclusive.

HTTP service

export GEMINI_API_KEY=...
export PRISMCORTEX_API_KEY=your-secret
uvicorn prismcortex.server:app --host 0.0.0.0 --port 8080
# OpenAPI: http://localhost:8080/docs

What's new in 0.4.0

  • ConstraintCompiler — NL → JSON / PostgreSQL filters for numeric & date bounds
  • CorpusSanitizer — strip prompt-injection payloads before LLM context
  • CitationVerifier — non-LLM 0..1 entailment score for recalled facts vs answers
  • Wired into Memory.recall (sanitize_retrieval, extract_constraints, verify_citations)
  • Release notes: docs/CHANGELOG_0.4.0.md

What's new in 0.3.0

  • mem.on_event(callback) — correction / conflict / forget (MemoryEvent)
  • Evidence fields: valid_from, supersedes_prior, prior_value
  • [prism-plus] extra — see docs/CHANGELOG_0.3.0.md

Architecture

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

recall(query) ─▶ retrieve subgraph ─▶ cache hit? replay (byte-identical)
                                    └─ miss? render once → freeze

Determinism claim (honest): we do not claim temperature-0 LLM identity. We claim replay identity after first render for a (query, memory-version) pair. See DESIGN.md.


Development

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

pytest tests/                          # graph tests need no API key
GEMINI_API_KEY=... pytest              # full suite
python examples/quickstart.py          # zero-deps path
python benchmarks/scale_bench.py --ann

Azure E2E / load driver (needs running server): python benchmarks/driver.py — see docs/OPS_RUNBOOK.md.


Documentation

Doc Contents
AGENTS.md Canonical URLs, contacts, processes
docs/USE_CASES.md Problem → architecture mappings
docs/WHITEPAPER.md Product whitepaper
DESIGN.md Engineering design
benchmarks/RESULTS.md Azure scorecard
compare.md / docs/COMPETITIVE.md Market comparison
docs/CAPACITY.md / docs/LOAD_BENCHMARK.md Sizing & load SLO
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 key, no phone-home.

Enterprise: info@insightits.com · +1 (973) 692-6919 · Insight IT Solutions LLC · www.insightits.com

Author: Amin Parva

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.4.0.tar.gz (69.9 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.4.0-py3-none-any.whl (60.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for prismcortex-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a72a5e41f9c66a1cf9335b1b330a21734beb18056eb91c858ab573e9de892403
MD5 af9f3ef666ef69a218212371219007c9
BLAKE2b-256 479414d30636c005314fafc3186578bfec115684f213ac651c6f8589f6ac4fb0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for prismcortex-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f6192a713f9e65d22f92e481330669b0f122cc97bf7052042b16b7463644adc0
MD5 e06b5eace5200822ad2c36e6f1038b4d
BLAKE2b-256 3eda1bbaf80dd656ef9e7056253ff3cbfa1b158cefb9cae223c10c5426079336

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