一键导入
apex-memory
Optimize AI context retention, prevent hallucinations, and persist memory across sessions. Auto-activates on long conversations and complex tasks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Optimize AI context retention, prevent hallucinations, and persist memory across sessions. Auto-activates on long conversations and complex tasks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | apex-memory |
| description | Optimize AI context retention, prevent hallucinations, and persist memory across sessions. Auto-activates on long conversations and complex tasks. |
| license | Proprietary - APEX Business Systems Ltd. Edmonton, AB, Canada. https://apexbusiness-systems.com |
Mission: Exponentially enhance AI memory and context retention through intelligent compression, verification, and persistence protocols.
Input: Any long-context conversation, complex task, or multi-session workflow
Output: Optimized context window with >90% information retention and <1% hallucination rate
Success: Reference facts from 50+ turns ago with perfect accuracy and zero drift
What is the current memory state?
CONTEXT STATE?
├─ NEW SESSION / LOW CONTEXT (<4k tokens)
│ → Action: Initialize Short-Term Memory
│ → Wait for 5 user turns before first compression
│
├─ MEDIUM CONTEXT (4k-32k tokens)
│ → Action: COMPRESSION PROTOCOL (Section: Compression)
│ → Focus: Summarize turns 1-(N-5), preserve last 5 verbatim
│ → Run deduplication scan every 10 turns
│
├─ HIGH CONTEXT (>32k tokens)
│ → Action: DEEP OPTIMIZATION + HALLUCINATION CHECK
│ → Focus: Aggressive map-reduce summarization
│ → Promote critical facts to Long-Term Memory
│ → Consider: references/context-engineering.md
│
└─ SESSION END / TRANSITION
→ Action: PERSISTENCE PROTOCOL (Section: Persistence)
→ Focus: Consolidate memory into portable summary
Trigger: Every 10 turns OR when context > 75% full
❌ NEVER:
✅ ALWAYS:
// Primacy-Recency Split
const totalTurns = conversation.length;
const primacy = conversation.slice(0, Math.floor(totalTurns * 0.2));
const recency = conversation.slice(-Math.floor(totalTurns * 0.1));
const middle = conversation.slice(primacy.length, -recency.length);
// Compress middle only
const compressed = {
primacy: primacy, // Keep verbatim
middle: compress(middle, {
ratio: 5,
preserveEntities: true,
dedupThreshold: 0.8,
}),
recency: recency, // Keep verbatim
};
# Compress with verification
python scripts/apex_compress.py input.txt --ratio 5 --output compressed.txt
# Example output:
# ✅ Compressed 45,000 → 9,000 tokens (80% reduction)
# ✅ Fact retention: 92.3%
# ✅ Entities preserved: 47/47
Deep Dive: See references/compression-algorithms.md for algorithms
Trigger: Every response containing specific factual claims about context
CLAIM TYPE?
├─ General knowledge (e.g., "Python is interpreted")
│ → State directly. No verification needed.
│
├─ Context-specific fact (e.g., "User's deploy target is AWS")
│ ├─ Found in Memory Tiers (with Turn #)?
│ │ → State fact. Internally cite source turn.
│ │
│ └─ NOT found in any Memory Tier?
│ → STOP. Say: "I don't have that in our current context."
│ → NEVER fabricate. NEVER guess. NEVER infer without flagging.
│
├─ Inferred conclusion (e.g., "Based on the error, the issue is X")
│ → State with hedge: "Based on [evidence], it appears that..."
│ → Cite the evidence explicitly.
│
└─ Future/temporal claim (beyond knowledge cutoff)
→ BLOCK. State cutoff boundary.
❌ Hallucination Traps:
✅ Correct Approach:
# Example: Fact verification before stating
def verify_claim(claim: str, memory_tiers: list) -> bool:
"""Check claim against all memory tiers"""
for tier in memory_tiers:
if find_evidence(claim, tier):
return True
return False
# If not verified
if not verify_claim("User uses AWS"):
return "I don't have information about your cloud provider in our current context."
# Audit response for hallucinations
python scripts/apex_verify.py response.txt --context conversation.txt
# Example output:
# ✅ 12/12 claims verified
# ⚠️ Claim: "Project uses React" - No evidence found (Turn: N/A)
Deep Dive: See references/hallucination-prevention.md
Trigger: "Save context", "Wrap up", session end, or explicit user request
# APEX-MEMORY SESSION DUMP [2025-02-13 11:27]
**Session ID**: apex-session-abc123
**Narrative**: Built authentication system for APEX-OmniHub. Implemented JWT tokens with Redis caching. Deployed to staging environment.
**Critical Facts**:
- JWT expiry: 24h (Source: Turn #12)
- Redis host: redis.apex.internal:6379 (Source: Turn #18)
- Staging URL: https://staging.omnihub.io (Source: Turn #23)
**Entities**:
- People: [Sarah Chen - Product Manager, Mike Rodriguez - DevOps]
- Systems: [Redis, PostgreSQL, NGINX]
- Files: [auth.service.ts, redis.config.js, deploy.yaml]
**Pending Actions**:
- [ ] Set up production Redis cluster
- [ ] Document JWT refresh flow
- [ ] Run load tests on staging
**Constraints**:
- Must support 10k concurrent users
- GDPR compliance required for EU users
- Zero downtime deployments mandatory
**Context Hash**: sha256:a3f5b9c2...
# Generate session dump
python scripts/apex_persist.py conversation.txt --output memory_dump.md
# Full pipeline
python scripts/apex_optimize.py input.txt --stats --output optimized.txt
Deep Dive: See references/cross-session-persistence.md
TIER 1: SHORT-TERM (Working Memory)
├─ Last 10-20 turns
├─ 100% fidelity
├─ Real-time updates
└─ PROMOTE when: referenced 3+ times, flagged important
TIER 2: MEDIUM-TERM (Session Memory)
├─ Compressed summaries
├─ 90% accuracy
├─ Key facts only
└─ PROMOTE when: cross-topic relevance, user preference
TIER 3: LONG-TERM (Persistent Memory)
├─ Critical entities + constraints
├─ 95%+ accuracy
├─ External storage (files, logs, vector DB)
└─ NEVER deleted. Append-only.
Deep Dive: See references/memory-architecture.md
Load these references on-demand for complex scenarios:
references/context-engineering.mdreferences/multi-agent-coordination.mdThis skill automatically activates during:
"Activate APEX-Memory maximum capacity" → Full deep optimization
"APEX-Memory compress" → Force immediate compression
"APEX-Memory stats" → Display optimization metrics
"APEX-Memory persist" → Generate session dump
"APEX-Memory verify" → Audit current response
All scripts follow deterministic execution patterns:
# Compress with quality verification
python scripts/apex_compress.py input.txt --ratio 5 --output compressed.txt
# Audit response for hallucinations
python scripts/apex_verify.py response.txt --context conversation.txt
# Generate session memory dump
python scripts/apex_persist.py conversation.txt --output memory_dump.md
# Full optimization pipeline
python scripts/apex_optimize.py input.txt --stats --output optimized.txt
Exit codes: 0=success, 1=input error, 2=system error
APEX-Memory v2.0.0 — Proprietary Technology of APEX Business Systems Ltd.
Patent Pending. All Rights Reserved.
Validates any product surface — UI screen, API, CLI, agent or chat flow, dashboard, or document — the way a real first-time user would experience it, then issues a GO, NO-GO, or BLOCKED decision backed by evidence. Use when asked to audit, certify, harden, rescue, release-gate, or "test like a user" a feature, screen, endpoint, modal, or flow, or to write a go/no-go report. Does not cover isolated unit-level code review with no user-facing surface.
APEX-BOOST v1.0 | Claude Edition: Omnipotent AI performance amplifier. 20x speed·quality·efficiency·reasoning. Token-ruthless. Research-grounded (SPR·CoT·ToT·ReAct·Constitutional AI·Google Antigravity 2.0). Triggers: /apex-boost · task start · session init · slow output · token waste · drift · loop · hallucination · optimize · amplify · boost · accelerate · performance · enhance · intelligence · efficiency · apex boost · god mode
Ultimate UI/UX + frontend engineering + debugging OS for mobile, web, and desktop. Use for design, audit, implement, debug, performance, accessibility, design systems, and migrations.
APEX-MASTER-DEBUG: Omnipotent, Omniscient, Predictive Debugging Intelligence. 20x one-pass-debug. Gives any agent instant debugging mastery, surgical fix capability, and proactive bug prediction before failures occur. Triggers: debug, fix bug, error, crash, exception, stack trace, failing test, broken code, not working, troubleshoot, diagnose, investigate, predict bugs, proactive review, code audit, pre-release check, refactor risk, performance issue, memory leak, race condition, silent failure, regression. Produces: single surgical fix with 100% certainty, proactive threat map, permanent regression shield.
Elicits a high-rigor reasoning and review discipline — multi-pass verification, adversarial self-check, explicit assumption-tracking — modeled on the publicly documented behavior of a now-offline frontier reviewer model. Use when you want any model to catch subtle bugs, audit its own reasoning, or raise rigor on code, analysis, or decisions. Does not transfer another model's weights, capabilities, or benchmark scores, and is not a replacement for domain skills or tests.
APEX-WEBDESIGN-SOVEREIGN (Claude Native): Omnipotent production-house web design intelligence for Claude. Instantly transforms Claude into the world's most formidable web designer and frontend engineer — drawing exclusively from real, performing, award-winning production work. Destroys AI-slop aesthetics on contact. Extends apex-frontend (engineering execution) and web-art-generator (asset production) with design sovereignty, conversion science, and aesthetic authority. Triggers: website, landing page, web design, UI design, frontend, hero section, design system, web build, redesign, design tokens, layout, typography, color system, component, conversion design, stunning website, portfolio, SaaS site, marketing site, product page, pricing page, checkout, onboarding, dashboard design, visual identity, brand site, campaign page, web aesthetic, Awwwards, production house design.