agentleFS
FozikioFozikio/cortex-engine/skills/cortex-memory/SKILL.md

cortex-memory

Skill51 starsChanged 8 months agoMITView on GitHub

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

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. FilippoPilo/cortex-connector★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

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

    line 33
  2. Distinctive:

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

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Search

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.
  • beliefs — contradict() 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.
  • meta — sleep_pressure() and consolidation_status() tell you whether dream() is overdue; retrieval_audit() and query_explain() show why a query returned what it did.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.