Skip to content
idapixl edited this page Jul 30, 2026 · 3 revisions

FAQ

General

What is cortex-engine?

A cognitive memory layer for AI agents. It gives your agent persistent memory that survives across sessions. Observations, beliefs, reflections, and dream consolidation. Stored locally (SQLite) or in the cloud (Firestore), retrieved via semantic search.

How is this different from RAG?

RAG retrieves documents to augment prompts. Cortex is a living memory system. Memories have strength that decays over time (FSRS). Beliefs have confidence that can be strengthened or contradicted. The agent doesn't just search a corpus. It builds understanding.

Does it only work with Claude?

No. cortex-engine is an MCP server. It works with any MCP-compatible client: Claude Code, Claude Desktop, Cursor, Windsurf, and others. You can also use it as a TypeScript library in any Node.js project.

Do I need Google Cloud?

No. The defaults are fully local: SQLite for storage, built-in embeddings (runs in-process). You only need Google Cloud if you want Firestore (cloud storage) or Vertex AI (cloud embeddings).

Is it free?

cortex-engine is MIT licensed and free to use. The default setup (SQLite + built-in embeddings) has zero cost. Cloud options (Firestore, Vertex AI) have their own pricing but both include free tiers.

Technical

How are embeddings generated?

By default, cortex uses a built-in transformer model via @huggingface/transformers (runs in-process, ~50MB download on first use). You can switch to Ollama (nomic-embed-text) for faster local embeddings, or Vertex AI (text-embedding-004) for cloud deployments.

Can multiple agents share a cortex?

Yes. Use namespaces for isolated memory per agent, or share the same namespace for shared memory. Works with both SQLite (local) and Firestore (cloud). See Configuration for multi-agent setup.

How does dream consolidation work?

When you call dream(), cortex:

  1. Finds clusters of related memories
  2. Merges near-duplicates
  3. Generates abstractions from patterns
  4. Decays low-strength, low-access memories (FSRS)
  5. Strengthens frequently-accessed memories

Think of it like sleep. The agent processes what it's learned and consolidates it.

What are reflex rules?

Safety guardrails defined as YAML files. They ship with cortex-engine and are installed to reflex-rules/ when you run npx fozikio init. Rules can block dangerous commands, warn about debug code, or enforce cognitive habits. Powered by @fozikio/reflex.

Do I need to install plugins?

No. As of v1.0.0 all 59 cognitive tools are built into cortex-engine core.

The nine @fozikio/tools-* packages (threads, journal, content, evolution, social, graph, maintenance, vitals, reasoning) were absorbed into the engine and are now deprecated — the versions on npm are frozen and unmaintained. Don't install them; you already have those tools.

A 12-tool core set is active by default. Enable the rest per-namespace via npx fozikio config, and see the full list with npx fozikio tools or the Tool Reference.

Third-party plugin authoring is still supported — see Plugin Authoring.

Troubleshooting

"Permission denied" on Firestore

Check that your service account has the Cloud Datastore User role, or that Application Default Credentials are set up correctly.

Embeddings are slow on first run

The built-in embedding model downloads on first use (~50MB). Subsequent runs use the cached model. If you need faster embeddings, use Ollama locally.

"Tool not found" in MCP client

Make sure cortex-engine is installed (npm install @fozikio/cortex-engine) and your .mcp.json is configured. Restart your MCP client after config changes. If the tool you want isn't in the 12-tool default core set, enable its category with npx fozikio config — it ships with the engine, so there's nothing extra to install.

SQLite "database is locked"

This happens when multiple processes try to write to the same cortex.db file simultaneously. Use Firestore for multi-process setups, or ensure only one MCP server instance runs at a time.

Clone this wiki locally