记忆

cortex-memory

试用

Persistent memory for AI agents. Knowledge survives across sessions: recall past decisions, track evolving beliefs, detect contradictions via NLI, and build a knowledge graph over time. 60 tools over MCP, with FSRS spaced-repetition scheduling and spreading-activation retrieval. Runs locally on SQLite and Ollama, so no cloud account is needed.

它能做什么

Persistent cognitive memory for AI agents — query, record, review, and consolidate knowledge across sessions with spreading activation, FSRS scheduling, and NLI contradiction detection.

技能文档

Cortex Memory

Persistent memory engine for AI agents. Knowledge survives across sessions — recall what you learned last week, track evolving beliefs, detect contradictions, and build a knowledge graph over time.

Source: github.com/Fozikio/cortex-engine (MIT) | npm

Prerequisites

This skill requires cortex-engine running as an MCP server. Install it separately before using this skill:

npm install -g @fozikio/cortex-engine

Install the scoped package, unpinned. The unscoped cortex-engine on npm is the old name and is deprecated — but old versions of it still resolve, so pinning one installs an ancient engine that works just well enough to hide the problem. Always use @fozikio/cortex-engine, and let it take the latest.

Then initialize and start:

fozikio init my-agent    # scaffold a workspace
fozikio up               # start ollama + nli, wait until they answer
fozikio serve            # start the MCP server (stdio)

If anything goes wrong, fozikio doctor diagnoses the install and tells you how to fix it.

Runs locally with SQLite + Ollama. No cloud accounts needed. The skill instructions below are read-only — they teach your agent how to use cortex tools, they don't execute anything.

Managing the services

cortex-engine 1.4.0+ ships a service supervisor, so you do not have to babysit Ollama:

CommandWhat it does
fozikio upstart every service and wait until it actually answers
fozikio statusservice health (HTTP probe, not PID liveness); exits 1 if unhealthy
fozikio doctordiagnose the install and say how to fix what is broken
fozikio dashboardlive service and memory view
fozikio downstop services it started

status and up use an HTTP probe rather than checking whether a process exists, because a wedged process still holds the port. They also adopt rather than kill: if fozikio did not start a process, it will not stop it — which matters when the Ollama desktop app or another agent already owns :11434.

Core Loop

Read before you write. Always check what you already know before adding more.

query("authentication architecture decisions")

Be specific. query("JWT token expiry policy") beats query("auth"). Results include relevance scores and connected concepts.

Explore around a result:

neighbors(memory_id)

Record

Facts — things you confirmed:

observe("The API rate limits at 1000 req/min per API key, not per user")

Questions — unresolved:

wonder("Why does the sync daemon stall after 300k seconds?")

Hypotheses — unconfirmed ideas:

speculate("Connection pooling might fix the timeout issues")

Update beliefs

believe(concept_id, "Revised understanding based on new evidence", "reason")

Track work across sessions

ops_append("Finished auth refactor, tests passing", project="api-v2")
ops_query(project="api-v2")  # pick up where you left off

Memory-Grounded Reviews

Review code or designs by comparing against accumulated knowledge:

  1. Ground: query("the domain being reviewed") — load past decisions and patterns
  2. Compare: Does the work align with or diverge from established patterns?
  3. Record: observe() new patterns, wonder() about unclear choices, believe() updated understanding
  4. Output:
## Review — Grounded in Memory

### Aligned with known patterns
- [matches cortex context]

### Divergences
- [what differs, intentional or accidental]

### New patterns to capture
- [novel approaches worth observing]

Session Pattern

  1. Start: query() the topic you're working on
  2. During: observe() facts, wonder() questions as they come up
  3. End: ops_append() what you did and what's unfinished
  4. Periodically: dream() to consolidate memories (compress, abstract, prune)

Available Tools

60 tools across 13 categories. Run fozikio tools for the full list with descriptions.

CategoryCountTools
memory11context, federated_query, feedback, neighbors, observe, query, query_cross, recall, retrieve, speculate, wonder
consolidation5abstract, digest, dream, ruminate, wander
beliefs4belief, believe, contradict, validate
ops3ops_append, ops_query, ops_update
threads4thread_create, thread_resolve, thread_update, threads_list
journal5evolution_list, evolution_resolve, evolve, journal_read, journal_write
social4social_draft, social_read, social_score, social_update
content3content_create, content_list, content_update
graph4link, resolve, suggest_links, suggest_tags
vitals2vitals_get, vitals_set
agents2agent_invoke, intention
maintenance5find_duplicates, forget, goal_set, notice, surface
meta8consolidation_status, graph_report, predict, query_explain, retrieval_audit, sleep_pressure, stats, suggest

Beyond the basics

  • threads — multi-session explorations. A thread is something you want to keep thinking about, distinct from an ops log entry recording what happened.
  • journal / evolution — identity change over time. evolve() proposes a shift; evolution_resolve() applies, rejects, or reverts it, so the ledger reflects what was actually adopted rather than only what was suggested.
  • beliefscontradict() adjudicates whether an observation genuinely conflicts with an existing memory (via NLI, falling back to the LLM) and records a CONTRADICTION or TENSION signal rather than silently overwriting.
  • metasleep_pressure() and consolidation_status() tell you whether dream() is overdue; retrieval_audit() and query_explain() show why a query returned what it did.

相关技能

Map of every agentmemory MCP tool, what each does, and its parameters. Use when choosing which memory tool to call, when a tool name or argument is unclear,...

Unlimited organized memory for your AI agent. Store, search, and organize projects, contacts, decisions, and knowledge across categories. Never lose context...

Long-term memory for AI agents. Your AI remembers everything — preferences, decisions, context — across sessions, forever.

45 次安装

Persistent memory across sessions — local-first, no account needed. Automatically recalls past decisions, code, and tasks before each prompt, and saves session checkpoints. Also provides manual tools for searching, recording, and querying memory via Bash commands.

38 次安装

Query the agent's knowledge graph for entities, relationships, and statistics. Enables natural language exploration of accumulated session memory without she...