惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志
C
Check Point Blog
Stack Overflow Blog
Stack Overflow Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
酷 壳 – CoolShell
酷 壳 – CoolShell
M
MIT News - Artificial intelligence
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
WordPress大学
WordPress大学
博客园_首页
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
L
LINUX DO - 最新话题
S
Security @ Cisco Blogs
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Help Net Security
Help Net Security
大猫的无限游戏
大猫的无限游戏
Hugging Face - Blog
Hugging Face - Blog
The GitHub Blog
The GitHub Blog
Schneier on Security
Schneier on Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
Jina AI
Jina AI
雷峰网
雷峰网
罗磊的独立博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 【当耐特】
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
人人都是产品经理
人人都是产品经理
Microsoft Security Blog
Microsoft Security Blog
V
V2EX
N
News and Events Feed by Topic
V2EX - 技术
V2EX - 技术
宝玉的分享
宝玉的分享
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
P
Proofpoint News Feed
N
Netflix TechBlog - Medium
Martin Fowler
Martin Fowler
O
OpenAI News
P
Proofpoint News Feed
H
Help Net Security
S
Securelist
Vercel News
Vercel News
Hacker News: Ask HN
Hacker News: Ask HN
博客园 - 三生石上(FineUI控件)

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor GitHub - GenAI-Gurus/awesome-eu-ai-act: Curated tools, official sources, OSS, templates, and guides for EU AI Act compliance. Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders How to Switch AI Chatbots and Why You Might Want To GitHub - MattMessinger1/agentic_refund_guardrail: Safe refund policy layer for AI agents — Python + TypeScript. Same behavior, shared tests. Adam/papers/emergent_values_whitepaper.md at master · strangeadvancedmarketing/Adam Ask HN: How do you stop playing 20 questions with your AI coding tools How far can automation and AI support psychotherapy? - @theU GitHub - stagas/rtdiff: realtime git diff gui and AI-assisted commits A Mac Studio for Local AI — 6 Months Later A History of the Early Years of AI at the University of Edinburgh Why AI Coding Tools Still Feel Stuck on Localhost MSN AI Datacenters Are Becoming Strategic Targets twitter.com Penn Researchers Use AI to Surface Unreported GLP-1 Side Effects in Reddit Posts Show HN: MoodSense AI (ML and FastAPI and Gradio, Deployed on Hugging Face) Moodsense Ai - a Hugging Face Space by aman179102 AI models are terrible at betting on soccer—especially xAI Grok GitHub - xialeistudio/echoic GitHub - HimashaHerath/github-dev-wrapped: AI-powered weekly GitHub activity reports deployed to GitHub Pages GitHub - alejandrobalderas/claude-code-from-source: Architecture, patterns & internals of Anthropic's AI coding agent — reverse-engineered from source maps AI and Tech brief: Ireland ascendant GitHub - Titovilal/context0: Context0 - Never Surrender Training for a Marathon with an AI Coach: What Worked and What Didn't Cyber Pulse: Agentic Intel - Apps on Google Play I Built an AI PR Reviewer That Catches Bugs by Not Looking for Bugs Gen Z workers are so fearful AI will take their job they’re intentionally sabotaging their company’s AI rollout | Fortune How AI Is Reimagining the Game of Golf–For Both Players and Courses GitHub - nattergabriel/reseed: A CLI tool for managing and distributing agent skills across projects Is SVG the final frontier? My AI workflow evolved from prompts to a near-autonomous workflow MLSharp Help - 3DGS Viewer & Generator I put my cognitive field based AI's runtime on GitHub Is Numble the first AI-proof game? A3: Kubernetes for autonomous AI agent fleets | Emergent Principles Deepali Vyas ("The Elite Recruiter") GitHub - msmarkgu/RelayFreeLLM: A restful API designed to route user prompts to various AI model providers. Unionized ProPublica staff are on strike over AI, layoffs, and wages Unleashing the Advantage of Quantum AI We're heading for an AI-fueled 'dementia crisis,' brain scientist warns The AI-Assisted Breach of Mexico's Government Infrastructure [pdf] GitHub - stef41/lmscan: 🔍 Detect AI-generated text and fingerprint which LLM wrote it. Open-source GPTZero alternative. Zero dependencies, works offline. MSN GitHub - visionscaper/collabmem: Enabling long-term collaboration with Agentic AI - building up episodic and world model memory over time with in-context awareness We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs AI Code is Hollowing Out Open Source, and Maintainers are Looking the Other Way What leaked "SteamGPT" files could mean for the PC gaming platform's use of AI AI is the boss at this retail store. What could go wrong? GitHub - Wuzu11517/agentic-proxy: Local proxy meant to help reduce With Drones, Geophysics and ArtificiaI Intelligence, Researchers Prepare to Do Battle Against Land Mines A Single Operator, Two AI Platforms, Nine Government Agencies: The Full Technical Report 在 Steam 上购买 FriedrichAI: Offline AI 立省 10% GitHub - inevolin/resume-cli: Hit Claude usage limits? Resume any AI coding session elsewhere. Switch tools at zero friction. GitHub - atripati/ark: AI Runtime Kernel — a context operating system for AI agents. Eliminates tool bloat, loads only what’s needed, and gives LLMs their reasoning space back. How to Build a Secure AI PR Reviewer with Claude, GitHub Actions, and JavaScript This Startup Wants You to Pay Up to Talk With AI Versions of Human Experts Intel Arc Pro B70 Brings 32GB VRAM to Local AI for $949 WordPress 7.0: The Good, the AI, and the Still Missing AI on the couch: Anthropic gives Claude 20 hours of psychiatry IatroBench: Pre-Registered Evidence of Iatrogenic Harm from AI Safety Measures AI Agents Know About Supabase. They Don't Always Use It Right. The history and future of AI at Google, with Sundar Pichai Inside an AI‑enabled device code phishing campaign How Meta Used AI to Map Tribal Knowledge in Large-Scale Data Pipelines AI for Systems: Using LLMs to Optimize Database Query Execution Forecasting the Economic Effects of AI Introducing Tinker: Play with AI, bring your ideas to life AI sheds light on an ancient gaming mystery People really hate AI but not as much as Iran—or Democrats | Fortune What is an AI Product Engineer? Phoebe Gates wants her $185 million AI startup to succeed with 'no ties to my privilege or my last name': 'I have a chip on my shoulder' | Fortune
GitHub - rishipratap10/memory-guardian
rishipratap1 · 2026-04-28 · via Hacker News - Newest: "AI"

Memory governance for AI agents.

Most agent memory layers are passive storage. Memory Guardian is an active governance layer — it controls what gets stored, what gets retrieved, how memories age, and what contradicts what — with full explainability at every step.


The problem

AI agents with persistent memory break in predictable ways:

  • Duplicate facts accumulate until retrieval becomes noise
  • Conflicting preferences coexist with no resolution path
  • Stale memories from months ago outrank fresh ones
  • Retrieval is a black box — no way to know why a memory was selected
  • Quality degrades the longer an agent runs in production

In consumer apps, getting this wrong is a bad experience. In regulated environments — wealth management, KYC, claims, credit — getting this wrong is a suitability breach, a compliance failure, or a mis-sold product.


What Memory Guardian does differently

Capability Mem0 Zep Letta agentmemory Memory Guardian
Conflict detection Yes Yes Partial Yes Yes
Explainable retrieval (why_selected) No No No No Yes
Retrieval decision trace per stage No No No No Yes
Score decay + archival lifecycle No Partial Partial Yes (local) Yes
Consolidation of redundant memories Partial Partial No No Yes
Pinned memory (survives decay) No No No No Yes
NLI conflict detection No No No No Yes
Strict multi-tenant isolation at API layer Yes Yes No No Yes
Framework-agnostic production API Yes Yes No No Yes

Core features

Intelligent ingestion

Every memory write goes through enrichment, deduplication, and type normalisation before persistence. Two dedup paths run in sequence — exact match on normalised content, then vector-similarity match against nearby tenant memories. Noise does not enter the store.

Supported canonical memory types: fact, preference, episodic, instruction, consolidated. Aliases are normalised automatically (prefpreference, episodeepisodic, etc.). Unknown types are rejected with HTTP 422.

Task-aware retrieval

Retrieval combines four signals into a final score:

  • Semantic similarity — vector distance from query embedding
  • Importance — priority-weighted score from metadata
  • Recency — exponential decay with 30-day half-life; uses last_accessed_at where available
  • Frequency — logarithmic reuse score, capped at 20 accesses with a 21-day half-life to prevent runaway dominance

Returns ranked, deduplicated, relevant memories. Archived memories are excluded. Reranker applies after base scoring with deterministic fallback if the provider fails.

Explainable ranking

Every retrieved memory includes:

  • score_breakdown — per-signal contributions (similarity, importance, recency, frequency)
  • decision_trace — stage-by-stage trace: candidate generation → scoring → rerank → final order
  • why_selected — human-readable reasons generated from the actual executed path

This is not post-hoc explanation. The trace reflects what the system actually did.

Conflict detection — three providers

Heuristic (default, zero dependencies) Polarity analysis over shared topic tokens. Detects opposite-sentiment statements about the same subjects — e.g. "user likes X" vs "user hates X".

NLI — Natural Language Inference (optional, local) Uses microsoft/deberta-v3-small-mnli via HuggingFace transformers. Runs a text-classification pipeline on each candidate memory pair. Flags pairs where the contradiction label score exceeds a configurable threshold (default 0.8). Requires requirements-ml.txt. Model downloads on first use.

LLM (optional, OpenAI-compatible) Sends each candidate pair to an LLM with a structured prompt. Returns is_conflict, reason, conflict_type, and shared_topics. Most semantically capable. Works with any OpenAI-compatible endpoint including HuggingFace inference, Ollama, and others.

All providers fall back to heuristic automatically on failure. Memory writes are never rolled back if conflict analysis fails — the write path is failure-safe by design. Conflicts are persisted as first-class objects with canonical pair handling — no duplicate conflict records per pair.

Memory lifecycle

  • Decay — importance scores reduce over time using configurable heuristic or LLM policy. Pinned memories are always preserved regardless of score.
  • Archival — inactive low-importance memories are archived automatically. Archived memories are excluded from all retrieval.
  • Recency signalslast_accessed_at is updated atomically on retrieval. Lifecycle decisions use real access history, not just creation time.

Consolidation

  • Clusters similar active memories within strict scope boundaries (tenant_id + user_id + agent_id + session_id)
  • Generates a canonical consolidated memory via configurable summariser (heuristic or LLM)
  • Archives originals with consolidated_into trace metadata
  • Prevents recursive consolidation — memories with memory_type=consolidated are excluded from future consolidation input by default

Tenant isolation

  • X-Tenant-Id header enforced at API boundary — missing or blank returns 401/400
  • All repository queries scoped by tenant_id
  • No cross-tenant retrieval, conflict reads, or admin access possible by design
  • Admin endpoints require X-Is-Admin: true separately

FSI and regulated environment use cases

Memory Guardian's architecture maps directly to the memory governance requirements of regulated industries.

Wealth management suitability A client's stated risk appetite changes over time. Without conflict detection, both the old and new preference coexist with no governed resolution. Memory Guardian persists the contradiction as a first-class conflict object, flags it for review, and surfaces the most recent preference on retrieval with a full decision trace — your explainability record under MiFID II suitability requirements.

KYC / AML profiling Resolved sanctions flags and stale risk classifications should not carry the same weight as fresh transaction signals. Memory Guardian decays soft signals automatically, pins formal risk decisions permanently, and detects when new evidence contradicts a stored classification — triggering review rather than silent coexistence.

Claims handling Contradicting customer statements across multiple touchpoints are stored as conflict pairs with canonical traces — the audit trail needed if a case goes to dispute.

Credit underwriting Stale financial snapshots decay automatically. Covenant breaches and credit committee decisions are pinned permanently. Quarterly updates consolidate into a clean current-state picture.

Trade surveillance Investigated and cleared flags do not dominate current risk profiles. Lifecycle archival retires resolved low-value memories. Every retrieval decision is traceable.

Memory Guardian is early-stage open source software. These use cases reflect the architectural design intent, not production deployments. If you are building agent systems in financial services and recognise these problems, we want to hear from you.


Quickstart

With Docker Compose

git clone https://github.com/your-org/memory-guardian
cd memory-guardian
cp .env.example .env
docker compose up --build -d db
docker compose run --rm migrate
docker compose up --build -d api

Without Docker

# Python 3.12 required
pip install -r requirements-dev.txt

# Optional: NLI conflict detection (downloads DeBERTa model on first use ~500MB)
pip install -r requirements-ml.txt

cp .env.example .env
# Start PostgreSQL with pgvector, then:
alembic upgrade head
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Configuration

Copy .env.example to .env. Key variables:

# Environment
ENVIRONMENT=local
ALLOW_LOCAL_STUB_AUTH=true

# Database
DATABASE_URL=postgresql+asyncpg://user:pass@localhost:5432/memory_guardian

# Embedding
# Set EMBEDDING_DIMENSION to match your model's actual output size exactly.
# HuggingFace free models typically output 64–384 dimensions.
# OpenAI text-embedding-3-small outputs up to 1536.
EMBEDDING_PROVIDER=llm
EMBEDDING_DIMENSION=64
LLM_EMBEDDING_API_TOKEN=...
LLM_EMBEDDING_BASE_URL=...      # HuggingFace inference endpoint or OpenAI-compatible URL
LLM_EMBEDDING_MODEL=...

# Conflict detection
CONFLICT_DETECTION_PROVIDER=llm  # llm | nli | heuristic
# NLI requires: pip install -r requirements-ml.txt

# Other providers
RERANKER_PROVIDER=llm
SUMMARIZER_PROVIDER=llm
INGESTION_ENRICHER_PROVIDER=llm
DEDUPE_PROVIDER=heuristic
MAINTENANCE_POLICY_PROVIDER=heuristic
CONSOLIDATION_QUALITY_PROVIDER=llm

# LLM API (OpenAI-compatible — works with HuggingFace, Ollama, OpenAI, etc.)
LLM_API_KEY=...
LLM_BASE_URL=...

Provider options and fallback

Every provider falls back to heuristic automatically on startup or request failure. The system never crashes on provider failure.

Variable Default Options
EMBEDDING_PROVIDER llm llm, heuristic (tests only)
CONFLICT_DETECTION_PROVIDER heuristic heuristic, nli, llm
RERANKER_PROVIDER heuristic heuristic, llm
INGESTION_ENRICHER_PROVIDER heuristic heuristic, llm
DEDUPE_PROVIDER off off, heuristic, llm
MAINTENANCE_POLICY_PROVIDER heuristic heuristic, llm
SUMMARIZER_PROVIDER heuristic heuristic, llm
CONSOLIDATION_QUALITY_PROVIDER heuristic heuristic, llm

Embedding dimension note

EMBEDDING_DIMENSION must match your active model's output size exactly. Retrieval and dedup only compare vectors with matching dimensions — dimension mismatch is enforced at query time. You can switch models and dimensions without breaking existing rows; old vectors simply won't be compared against new-dimension queries.


API surface

GET  /health

POST /api/v1/memories                         Store a memory
POST /api/v1/retrieve                         Retrieve memories for a query
GET  /api/v1/conflicts                        List conflicts for a user
GET  /api/v1/memories/{memory_id}/explain     Full explain payload

POST /api/v1/maintenance/decay                Run decay pass (admin)
POST /api/v1/maintenance/consolidate          Run consolidation pass (admin)

GET  /api/v1/admin/memories                   Memory explorer (admin, filterable, paginated)
GET  /api/v1/admin/memories/stats             Aggregate stats (admin)
GET  /api/v1/admin/memories/{memory_id}       Single memory with explain (admin)
GET  /api/v1/admin/conflicts                  Conflict list (admin, filterable, paginated)

Full OpenAPI spec at /docs (Swagger UI) or /openapi.json when running. Export committed spec:

python scripts/export_swagger_yaml.py

Example: store a memory

curl -X POST http://localhost:8000/api/v1/memories \
  -H "Content-Type: application/json" \
  -H "X-Subject: user-001" \
  -H "X-Tenant-Id: tenant-finance" \
  -d '{
    "user_id": "user-001",
    "content": "Client stated conservative risk appetite, no equities",
    "memory_type": "preference",
    "metadata": { "priority": "high", "pinned": true }
  }'

Example: retrieve with explanation

curl -X POST http://localhost:8000/api/v1/retrieve \
  -H "Content-Type: application/json" \
  -H "X-Subject: user-001" \
  -H "X-Tenant-Id: tenant-finance" \
  -d '{
    "user_id": "user-001",
    "query": "What is this client'\''s risk profile?",
    "top_k": 5
  }'

Every returned memory includes why_selected and score_breakdown.


Auth

Auth is fail-closed:

  • ENVIRONMENT defaults to production
  • Stub auth only active when ENVIRONMENT=local and ALLOW_LOCAL_STUB_AUTH=true
  • In local stub mode: X-Subject and X-Tenant-Id are both required
  • Admin endpoints require X-Is-Admin: true
  • Production use requires integrating a real JWT/OIDC provider

Architecture

app/api           HTTP routing, request/response, dependency injection
app/schemas       Pydantic validation
app/services      Domain workflows — ingestion, retrieval, conflict, lifecycle, consolidation
app/repositories  DB query layer, tenant-scoped
app/models        SQLAlchemy ORM models
app/core          Config, logging, exception contracts
alembic/          Schema migrations
tests/            Unit + integration coverage
admin_ui/         Streamlit memory inspector (optional)

Stack: FastAPI · SQLAlchemy 2.x async · PostgreSQL + pgvector · Alembic · Pydantic v2 · Uvicorn · Docker


Data model

Table Purpose
memories Tenant-scoped records with embeddings, importance score, reuse/access metadata
memory_conflicts Contradiction links between pairs — canonical pair uniqueness enforced
retrieval_logs Per-query retrieval outcomes and explanation payloads

Testing

pytest -q                    # all tests
pytest -q tests/bdd          # BDD acceptance scenarios
pytest -q tests/technical    # API contract tests
pytest -q -m bdd
pytest -q -m technical

Integration tests use ephemeral PostgreSQL + pgvector containers. Docker daemon required.

E2E simulation

python scripts/run_agent_e2e_simulation.py \
  --base-url http://127.0.0.1:8000 \
  --api-prefix /api/v1

Exercises ingestion, dedupe, retrieval explainability, tenant isolation, conflicts, maintenance, consolidation, and explain. Fails on any 5xx response.

Finance advisor test agent

# Deterministic mode
python scripts/run_finance_test_agent.py \
  --base-url http://127.0.0.1:8000 \
  --tenant-id finance-demo \
  --subject finance-test-agent \
  --user-message "I want to save £30,000 for a house deposit by next year."

# LLM mode
LLM_API_KEY=... python scripts/run_finance_test_agent.py \
  --mode llm \
  --llm-model gpt-4.1-mini \
  --user-message "I filed my tax return and signed a £12,000 car loan."

# Persist extracted memories back to Memory Guardian
python scripts/run_finance_test_agent.py \
  --user-message "I prefer low-risk index funds and avoid credit card debt." \
  --persist

Finance scenario matrix

python scripts/run_finance_test_agent_scenarios.py \
  --base-url http://127.0.0.1:8000 \
  --output-json /tmp/finance_scenario_report.json

Covers: health and auth contracts, memory persistence, contradiction detection, dedupe, pinned memory, tenant isolation, admin access control, invalid payload rejection.


Memory Inspector (Admin UI)

A Streamlit console for retrieval debugging, score trace inspection, conflict review, and lifecycle monitoring.

pip install -r admin_ui/requirements.txt

# .env
ADMIN_UI_ENABLED=true
ADMIN_UI_PASSWORD=<your_password>
MEMORY_GUARDIAN_API_BASE_URL=http://127.0.0.1:8000

streamlit run admin_ui/app.py
# Open http://127.0.0.1:8501

Status

MVP backend — ready for integration and pilot use.

  • Memory ingestion with enrichment and deduplication
  • Task-aware retrieval with multi-signal scoring
  • Explainable retrieval — why_selected and per-stage decision trace
  • Conflict detection — heuristic, NLI (DeBERTa via HuggingFace), and LLM providers
  • Failure-safe write path — memory writes never rolled back on conflict analysis failure
  • Score decay and archival lifecycle
  • Pinned memory — preserved through decay and archival
  • Consolidation with recursive prevention and trace metadata
  • Strict multi-tenant isolation at API and repository layers
  • Provider resilience — all providers fall back to heuristic on failure
  • Admin UI — Memory Inspector (Streamlit)
  • BDD and integration test coverage
  • CI — lint, tests, migration check, secret scan
  • Production JWT/OIDC auth provider
  • Distributed scheduling for maintenance jobs
  • End-user product frontend

Contributing

See CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md.

Before tagging a release:

bash scripts/release_preflight.sh

License

Apache 2.0

Copyright 2026 Memory Guardian Contributors. Licensed under the Apache License, Version 2.0. You may use, modify, and distribute this software freely. Any modifications must carry prominent notices. Patent rights are granted — and terminate automatically if you initiate patent litigation against the project.