Website #
Docs #
Install #
Quickstart #
Star Lians
Reproducible benchmark evidence and offline quality gates
RIAD-1: decision reconstruction benchmark Β·
CI receiptsLians is the cross-platform decision evidence and reconstruction layer for regulated AI. It gives compliance, model-risk, and operational-risk teams one record of what an agent knew, what it retrieved, which policy governed it, which tools ran, who reviewed it, and what changed later.
The durable moat is neutrality. A firm can run agents across Bedrock, Azure OpenAI, Anthropic direct, and open-source runtimes while keeping one portable evidence record outside every provider.
Every write is preserved as a governed temporal record and compiled into a
typed memory artifact. Every recall can run in fast
, deep
, or reconstruct
mode and returns a content-addressed receipt that can bind automatically to a Decision Envelope. See decision evidence and reconstruction, the normative completeness grades, Evidence Pack signing key custody, the governed memory engine and reproducible evidence gates.
The platform exposes one evidence workflow:
Capture: open a Decision Envelope and bind memory, traces, policy decisions, prompts, tools, and human review as the action happens.Reconstruct: reproduce the point-in-time knowledge and execution path even when exact deterministic replay is impossible.** Verify**: grade every decision as Recorded, Reconstructable, Verifiable, or Replayable, with every missing requirement named.** Monitor**: when a source, policy, or model changes, identify every exposed decision and emit a blast-radius alert.
Memory remains a core evidence source and performance primitive. It is not the commercial category by itself.
| Library | Self-Hosted Server | Cloud | |
|---|---|---|---|
| Best for | |||
| Testing, prototyping | Regulated teams, private deployments | Zero-ops production (early access) | |
| Setup | |||
pip install lians-sdk[local] |
|||
docker compose up --build |
|||
pip install lians-sdk + API key |
|||
| Database | |||
| SQLite (zero setup) | Postgres 16 + pgvector | Managed | |
| Audit chain | |||
| Yes | Yes | Yes | |
| Crypto-shred erasure | |||
| Yes | Yes | Yes | |
| Information barriers | |||
| Local checks | PostgreSQL RLS | Managed policy | |
| Air-gap capable | |||
| No | Yes | No |
Lians gives agents a durable memory loop across facts, context, decisions, outcomes, and reviewed lessons. The Memory product keeps context current and useful; the Records product captures behavior and oversight in an open, verifiable event format.
Most memory layers stop at storage and retrieval. Lians is built for teams that also need to know what the agent knew, when it knew it, where the fact came from, which outcomes followed, who was allowed to see it, and whether stale or erased content was kept out of future context.
That is the gap between a memory demo and a memory system teams can trust in production, especially in financial, medical, and legal environments.
Generic agent memory optimizes for personalization and recall. Regulated agent memory has a different job: it must keep the agent's context correct, current, segregated, reproducible, and defensible under review.
Lians is designed for the failure modes that matter in institutions:
Stale fact contamination- old rates, old guidance, old medication doses, old damages estimates, or old client facts must not silently enter context.Point-in-time reconstruction- an examiner, clinician, partner, or risk committee may ask what the agent knew at a specific timestamp.** Information barriers**- one desk, care team, or matter team must not read another team's memory because of an application-layer bug.** Erasure with audit survival**- private content must be removable without breaking custody records, audit hashes, or legal retention evidence.** Relational compliance checks**- conflicts of interest, related-party exposure, and referral networks are graph questions, not plain vector search.
The short competitive frame:
Runtime vendors explain their own cloud. Lians preserves portable decision evidence across all of them.
| Vertical | What Lians proves | Product primitives |
|---|---|---|
| Financial institutions | ||
| No stale or future facts influenced a decision; desk barriers held; audit state is reconstructable | Bitemporal recall, backtest contamination checks, SEC/FINRA audit export, RLS information barriers, related-party graph paths | |
| Healthcare organizations | ||
| PHI access is scoped; care-team memory is reconstructable; patient erasure is provable | Per-subject encryption, crypto-shred certificates, HIPAA safeguard mapping, care-network graph, air-gap mode | |
| Legal institutions | ||
| Matter walls held; privilege cutoffs are reproducible; chain-of-custody survives erasure | Matter-level barriers, recall_at for privilege dates, audit reconstruction, conflict-of-interest graph paths |
Procurement and technical review materials:
Institutional proof kitVertical pitch guideCompetitive landscapeSecurity whitepaperSOC 2 / HIPAA readinessThreat modelProduction deploy checklist
Lians is listed on the official MCP Registry. Any MCP-compatible host - Claude Desktop, Cursor, VS Code, Windsurf, and others - can use local persistent memory immediately or connect to a hosted Lians server. No SDK code, custom adapter, Docker service, URL, or API key is required for local mode.
Your agents get eight tools automatically:
| Tool | What it does |
|---|---|
remember |
|
| Store a fact with event time and metadata | |
recall |
|
| Retrieve current (non-stale) facts by semantic query | |
recall_at |
|
| Point-in-time recall β what did we know on date X? | |
reconstruct |
|
| Full audit reconstruction for regulatory submissions | |
list_conflicts |
|
| Surface facts where two sources disagree | |
memory_lineage |
|
| Full supersession history of any fact | |
fact_history |
|
| Time-series view of a ticker+metric (e.g. AAPL EPS) | |
backtest_check |
|
| Detect lookahead bias before a backtest runs |
Add to your claude_desktop_config.json
(or equivalent MCP config):
{
"mcpServers": {
"lians": {
"command": "uvx",
"args": ["--from", "lians-sdk[mcp]", "lians-mcp"]
}
}
}
Restart your client and Lians memory tools appear immediately. Local mode persists to ~/.lians/mcp.db
. To use a hosted deployment instead, set LIANS_URL
, LIANS_API_KEY
, and optionally LIANS_AGENT_ID
.
uvx --from 'lians-sdk[mcp]' lians-mcp
No environment variables are needed for local mode. Set LIANS_URL
, LIANS_API_KEY
, and optionally LIANS_AGENT_ID
to use a remote server.
pip install lians-sdk[local] # SQLite plus real local semantic embeddings, no Docker
python
from lians import LocalLiansClient
from datetime import datetime, timezone
mem = LocalLiansClient()
mem.add(
agent_id="analyst-1",
content="NVDA FY2026 revenue guidance raised to $40B",
event_time=datetime(2025, 11, 19, 16, tzinfo=timezone.utc),
metadata={"ticker": "NVDA", "metric": "revenue_guidance"},
)
results = mem.recall(agent_id="analyst-1", query="NVDA revenue guidance")
results = mem.recall(
agent_id="analyst-1",
query="What changed in the guidance and why?",
mode="deep",
)
results = mem.recall_at(
agent_id="analyst-1",
query="NVDA revenue guidance",
as_of=datetime(2025, 3, 1, tzinfo=timezone.utc),
)
Switch to the hosted server with one line: from lians import LiansClient as LocalLiansClient
from datetime import datetime, timezone
from lians import AsyncLiansClient
async with AsyncLiansClient(base_url=LIANS_URL, api_key=LIANS_API_KEY) as lians:
envelope = await lians.open_decision_envelope(
agent_id="underwriter-1",
decision_type="credit_application",
regime="ECOA_REG_B",
completeness_profile="regulated_recordkeeping",
knowledge_as_of=datetime.now(timezone.utc),
)
context = await lians.recall(
agent_id="underwriter-1",
query="verified applicant income",
decision_envelope_id=envelope["id"],
)
sealed = await lians.seal_decision_envelope(
envelope["id"],
outcome="manual_review",
decided_at=datetime.now(timezone.utc),
input_hash=INPUT_SHA256,
output_hash=OUTPUT_SHA256,
)
print(sealed["completeness"])
LiansMemoryHarness
wraps the two operations every memory-augmented agent needs β
recall-before and remember-after β into one object, with the compliance scoping
(subject, source, event-time, information barrier) regulated deployments require.
Works with any sync client (LiansClient
or LocalLiansClient
) and any model.
from lians import LiansClient, LiansMemoryHarness
harness = LiansMemoryHarness(mem, agent_id="research-desk", domain="finance")
answer = harness.run_turn(
"What is NVDA's current revenue guidance?",
generate=lambda context, query: call_model(f"{context}\n\nUser: {query}"),
)
context = harness.recall_context("NVDA revenue guidance") # ready to inject
harness.remember("Desk note: guidance now $40B") # write after the turn
Regulated scoping ties every write to one data subject and an information barrier:
harness = LiansMemoryHarness(
mem, agent_id="care-team-3",
subject_id="MRN-00042", # per-subject key β the crypto-shred target
barrier_group="oncology", # information-barrier tag
domain="healthcare",
)
Runnable end-to-end demo: agentmem/examples/harness_demo.py.
Some compliance checks are graph queries. Lians stores bitemporal relationship edges alongside facts β same audit chain, same information barriers, no graph database β so you can answer them point-in-time:
Legalβ conflict-of-interest reachability (ABA 1.7/1.9): is an attorney connected to an adverse party?** Finance**β related-party / beneficial-ownership (SEC, AML/KYC): is a counterparty within N hops of a restricted entity?** Healthcare**β care-network / referral-pattern (anti-kickback) analysis.
mem.relate("analyst-1", src_entity="Attorney", rel_type="represented",
dst_entity="ClientX", event_time=datetime(2026, 1, 1, tzinfo=timezone.utc))
mem.relate("analyst-1", src_entity="ClientX", rel_type="adverse_to",
dst_entity="PartyY", event_time=datetime(2026, 1, 1, tzinfo=timezone.utc))
path = mem.path("analyst-1", src_entity="Attorney", dst_entity="PartyY")
mem.neighbors("analyst-1", entity="FundA", depth=2, as_of=datetime(2025, 6, 1, tzinfo=timezone.utc))
mem.recall_near("analyst-1", query="earnings", near_entity="FundA", near_key="ticker")
Endpoints: POST /v1/graph/relate
Β· /v1/graph/unrelate
Β· /v1/graph/extract
(text β edges, rule-based or opt-in LLM) Β· GET /v1/graph/neighbors
Β· /v1/graph/path
(all as_of
-capable). Inspired by Zep/Graphiti, built on our compliance spine.
Give any coding agent persistent, compliance-grade memory:
| Host | How |
|---|---|
| Claude Code | |
Plugin with slash commands (/lians-remember , /lians-recall , /lians-audit , /lians-integrate ) and a compliance subagent β |
|
integrations/lians-plugin |
|
| Codex | |
Drop-in AGENTS.md + MCP config β |
|
integrations/codex |
|
| Skills standard | |
npx skills add https://github.com/Lians-ai/Lians --skill lians β works in Claude Code, Codex, Cursor β |
|
skills/ |
|
| Any MCP host | |
| One-time config; eight native memory tools β see | |
Institutional AI agents accumulate facts that change over time: rate decisions supersede prior ones, guidance gets revised, medication doses change, care plans evolve, damages estimates move, and matter facts are corrected during discovery. Systems that return every version with equal rank contaminate the LLM context with stale facts.
Lians fixes this with a bitemporal model:
event_timeβ when the fact happened (business time)** valid_from / valid_to**β when it was known (system time)
Superseded facts are excluded at the database layer. Every write is recorded in a tamper-evident SHA-256 hash chain; physical immutability and SEC 17a-4 deployment claims require separately configured WORM storage and policy controls. Per-subject keys can be destroyed for governed erasure while the audit trail survives. Information barriers are enforced at PostgreSQL RLS, not only at the application layer.
Temporal memory is no longer unique: Graphiti documents a bitemporal knowledge graph, Mem0 documents temporal reasoning and history, Hindsight documents query-time temporal recall and audit controls, and Supermemory documents content versioning and a temporal graph. Lians should be evaluated on the compound decision-evidence boundary it implements:
- reconstruct a named decision at both event-time and knowledge-time cutoffs;
- enumerate the source versions included and excluded at those cutoffs;
- detect post-cutoff leakage before a result is accepted;
- emit a content-addressed Evidence Pack that can be verified offline; and
- preserve the surrounding chain when subject content is crypto-erased.
The repository's regulated-memory harness is useful product evidence, not an independent general-product leaderboard. Current leadership language remains gated on production load, isolation, restore, failure-injection, public benchmark, and independent-reproduction evidence. See docs/competitive-landscape.md and the runnable claim policy in agentmem/benchmarks/release_claims.py.
β Lookahead-bias demo β the same agent backtest with naive vs point-in-time retrieval (Sharpe 4.6 vs β0.6, every leak logged): ebeirne/lookahead-bias-demo Β· in-repo β Full benchmark numbers: docs/benchmark.md β Regulated-eval head-to-head (five compliance invariants, Lians 5.0 / ZepβGraphiti 2.0 / mem0 0.5): docs/regulated-eval-results.md β Lians, Graphiti OSS, and mem0 OSS all executed live in their default configurations (per-cell evidence in the appendix); remaining columns scored from their public API surface via runnable adapters you can re-run with keys.
Lians maintains client implementations across five languages. Public package versions currently differ by ecosystem; use the explicit coordinates below and verify the machine-readable published release status.
| Language | Install | Client | Docs |
|---|---|---|---|
| Python 0.4.2 | |||
pip install lians-sdk==0.4.2 |
|||
from lians import LiansClient |
|||
TypeScript / Node 0.4.0npm install @lians-ai/lians@0.4.0
import { LiansClient } from "@lians-ai/lians"
sdk/typescriptGo 0.4.1go get github.com/Lians-ai/Lians/agentmem/sdk/go@v0.4.1
lians.NewClient(url, key)
sdk/goJava 0.4.1(JVM 11+)ai.lians:lians-sdk:0.4.1
(Maven Central)new LiansClient(opts)
sdk/javaC 0.4.1(C99 + libcurl)v0.4.1
source taglians_client_new(...)
sdk/cβ One-page install + 30-second quickstart for every language: docs/install.md
All five cover core memory operations. Python and TypeScript currently expose a broader advanced surface than Go, Java, and C; verify the client you plan to use against the OpenAPI contract before a pilot.
| Framework | Install | Import |
|---|---|---|
| LangChain | ||
pip install lians-sdk[langchain] |
||
from lians.langchain_integration import LiansChatHistory, build_tools |
||
| LangGraph | ||
pip install lians-sdk[langgraph] |
||
from lians.langgraph_integration import create_recall_node, create_remember_node |
||
| CrewAI | ||
pip install lians-sdk[crewai] |
||
from lians.crewai_integration import build_crewai_tools |
||
| OpenAI Agents SDK | ||
pip install lians-sdk[openai-agents] |
||
from lians.openai_agents_integration import build_openai_agent_tools |
||
| AutoGen v0.4 | ||
pip install lians-sdk[autogen] |
||
from lians.autogen_integration import build_autogen_tools |
||
| TypeScript / Node | ||
npm install @lians-ai/lians |
||
import { LiansClient } from "@lians-ai/lians" |
git clone https://github.com/Lians-ai/Lians.git && cd Lians/agentmem
cp .env.demo .env
docker compose up --build -d
python scripts/seed_demo.py # prints a demo API key; open demo/index.html
Deploy to Fly.io, Kubernetes, or bare Docker: docs/deploy.md
from lians import LiansClient # sync, connects to hosted/self-hosted server
from lians import AsyncLiansClient # async, for FastAPI / async frameworks
from lians import LocalLiansClient # local SQLite, no server needed
client.add(agent_id, content, event_time, metadata={}, importance=0.5)
client.add_from_messages(agent_id, messages=[{"role": "user", "content": "..."}])
client.recall(agent_id, query, k=5)
client.recall_at(agent_id, query, as_of=datetime(...)) # point-in-time
client.snapshot(agent_id, as_of=datetime(...)) # full state export
client.backtest_check(agent_id, simulation_as_of=...) # lookahead-bias detection
client.erase(subject_id, request_ref) # GDPR crypto-shred
ββββββββββββββββ
β LLM / Agent β
ββββββββ¬ββββββββ
β REST / MCP
βββββββββββββΌβββββββββββββ
β Lians API β FastAPI Β· rate-limit Β· OTEL
ββββ¬βββββββββββββββββ¬βββββ
βββββββββΌβββββββ ββββββββΌββββββββ
β memories β β event_log β
β (encrypted) β β (hash chain) β
β bitemporal β β append-only β
βββββββββ¬ββββββββ ββββββββββββββββ
β
βββββββββΌββββββββ
β subject_keys β AES-256-GCM per subject
β (crypto-shred)β destroy key = content unrecoverable
βββββββββββββββββ
Postgres 16 + pgvector (HNSW) Redis (recall hot cache)
Recall pipeline: BM25 + cosine (Voyage Finance-2) β recency decay β validity gate (valid_to IS NULL
for present; valid_from β€ as_of < valid_to
for point-in-time)
Supersession pipeline: Stage 1 (metadata key overlap) β Stage 2 (deterministic: SUPERSEDES / CONFIRMS / ADDS) β Stage 3 (optional LLM adjudication for paraphrase detection)
| Variable | Default | Description |
|---|---|---|
EMBEDDING_PROVIDER |
||
local |
||
voyage Β· openai Β· sentence-transformers Β· local |
||
VOYAGE_API_KEY |
||
| β | Required when EMBEDDING_PROVIDER=voyage |
|
MASTER_ENCRYPTION_KEY |
||
| β | Base64 32-byte key; blank disables PII encryption | |
KMS_PROVIDER |
||
env |
||
env Β· aws Β· azure Β· vault |
||
ADMIN_SECRET |
||
| β | Protects /v1/admin/* β change in production |
|
SUPERSESSION_LLM_STAGE |
||
false |
||
| Enables Stage 3 LLM adjudication (Claude Haiku) | ||
AIRGAP_MODE |
||
false |
||
| Hard-fails at startup if any config would send data externally | ||
ADMISSION_MODE |
||
monitor |
||
Admission control: off Β· monitor (tag+audit) Β· enforce (reject injection/blocked source, hold PII/PHI/MNPI for review) |
||
SIEM_URL |
||
| β | Stream every audit event to a SIEM collector (Splunk HEC / Datadog / Elastic) | |
WORM_MODE |
||
false |
||
Attest write-once-read-many storage for SEC 17a-4 (object-locked audit, no UPDATE/DELETE on event_log ) |
||
STRIPE_API_KEY |
||
| β | Enables per-namespace usage metering |
Full reference: agentmem/.env.example
| Method | Path | Description |
|---|---|---|
POST |
||
/v1/memories |
||
Add a memory (admission control; supersession check; Idempotency-Key for exactly-once retries) |
||
GET /POST |
||
/v1/admissions Β· /{id}/resolve |
||
| Review queue for held writes (PII/PHI/MNPI) β approve / reject | ||
POST |
||
/v1/memories/batch |
||
| Batch ingest | ||
POST |
||
/v1/recall |
||
Hybrid BM25+cosine recall; optional as_of , MMR rerank (filters._rerank=mmr ) |
||
POST |
||
/v1/context |
||
| Token-budgeted, ready-to-inject context block (point-in-time + MMR aware) | ||
POST |
||
/v1/erase |
||
GDPR crypto-shred by subject_id |
||
GET |
||
/v1/audit/reconstruct |
||
| Reconstruct agent state at any past date | ||
GET |
||
/v1/admin/audit/verify |
||
| Verify SHA-256 hash chain integrity | ||
GET |
||
/v1/admin/audit/export |
||
| Export audit log (SEC/FINRA/CFTC) | ||
GET |
||
/livez |
||
| Liveness probe (cheap; process up) | ||
GET |
||
/readyz Β· /health |
||
| Readiness / deep health check (DB + Redis) |
Interactive docs: http://localhost:8000/docs
pip install -e ".[dev]"
python scripts/test_all.py
PYTHONPATH=agentmem/src python -m pytest \
agentmem/tests/test_supersession_benchmark.py \
agentmem/tests/test_recall_quality.py -v
See docs/testing.md for the six named invariants (temporal soundness, audit immutability, erasure, etc.).
Built to run in a regulated production environment, not just to demo:
Exactly-once writesβIdempotency-Key
onPOST /v1/memories
; the SDKs send a stable key automatically, so a retried write never duplicates.Resilient clientsβ built-in retry with exponential backoff on transport errors / 5xx / 429.** Kubernetes probes**β cheap/livez
(liveness) and deep/readyz
(readiness), so a dependency blip doesn't restart healthy pods.Rate limitingβ per-API-key sliding window (Redis), fails open.** Access control**β namespace-scoped keys,read
/write
/admin
scopes,RBAC roles(owner
/analyst
/compliance
/readonly
), and SSO via gateway forward-auth.DB-layer information barriersβRESTRICTIVE
PostgreSQL RLS,proven in CI against a non-superuser role.Run the app as a non-superuser DB roleβ superusers bypass RLS.Memory admission controlβ govern what'sallowed intomemory: PII/PHI/MNPI detection, source-trust, prompt-injection quarantine, and a high-risk review queue (ADMISSION_MODE
). No other memory layer does this.SIEM streamingβ every audit event forwarded to Splunk HEC / Datadog / Elastic (SIEM_URL
), fire-and-forget.Observabilityβ Prometheus metrics + Grafana, OpenTelemetry traces, JSON access logs with a request ID.** Evaluation**β a judge-free memory-eval harness (agentmem/benchmarks/memory_eval.py
) in the LoCoMo/LongMemEval shape.
Security & procurement docs: security-whitepaper.md Β· threat-model.md Β· soc2-hipaa-readiness.md Β· sso.md Β· publishing.md
| Requirement | Feature |
|---|---|
| SEC 17a-4 tamper-evidence | SHA-256 hash chain on every audit row |
| FINRA 4511 recordkeeping | Append-only event_log |
| GDPR Art. 17 erasure | AES-256-GCM per-subject keys; crypto-shred |
| MiFID II point-in-time | Bitemporal: event_time + valid_from/valid_to |
| Information barriers | barrier_group column; PostgreSQL RLS |
| HIPAA Β§164.312 | Per-subject encryption, audit controls, transmission security |
Scope of these claims:Lians provides thetechnical controlsmapped above β it is software, not a certification. Regulatory compliance is a property of your deployment and organization (retention configuration, policies, attestations such as SOC 2 or a HIPAA assessment), and several controls require operator configuration (WORM object-lock, non-superuser DB role, KMS). Every claim links to the doc that says exactly what is and isn't covered β start with[soc2-hipaa-readiness.md].
Full documentation: compliance.md Β· hipaa.md Β· security-whitepaper.md Β· threat-model.md Β· soc2-hipaa-readiness.md Β· sso.md Β· worm-storage.md
Access control: namespace-scoped API keys with read
/write
/admin
scopes and RBAC roles (owner
/analyst
/compliance
/readonly
); SSO via gateway forward-auth (any OIDC/SAML IdP).
Lians is open-source and fully self-hostable β the entire feature set, including every compliance primitive, is in this repository under Apache 2.0. Paid packages sell deployment support, hardening review, and evidence packets around the open core, not license keys. A managed cloud is in early access for customers whose compliance posture allows hosted processing (contact us); regulated buyers should choose the package by deployment boundary and evidence requirements, not by a consumer-style monthly tier.
| Package | Best for | Deployment | Commercial model |
|---|---|---|---|
| Developer | |||
| Local prototypes, benchmarks, integrations | Local library or single-node server | Free / usage-based | |
| Team | |||
| Internal pilots and non-production agent workflows | Docker or small Kubernetes deployment | Usage-based or team plan | |
| Regulated Production | |||
| Sensitive, audited, time-dependent agent workloads | Customer cloud, private VPC, or on-prem | Annual contract | |
| Enterprise / Air-Gap | |||
| Banks, hospitals, law firms, insurers, government | Private cloud, on-prem, or air-gapped | Custom annual contract | |
| Managed Cloud | |||
| Zero-ops production where hosted processing is approved | Lians-managed environment | Contract or usage-based |
Healthcare customers require an executed BAA before PHI is processed in a managed environment. Financial and legal customers may require customer-managed keys, private networking, regional residency, dedicated environments, or air-gapped deployment.
Full packaging documentation: docs/pricing-tiers.md and docs/billing.md
Switching from another system? Migrate from mem0 or Migrate from Zep CE
Apache 2.0 β see LICENSE.