Skip to content
idapixl edited this page Mar 16, 2026 · 2 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.

What plugins are available?

9 official plugins, all auto-discovered when installed:

Plugin What it adds
@fozikio/tools-threads Thought threads
@fozikio/tools-journal Session journaling
@fozikio/tools-content Content pipeline
@fozikio/tools-evolution Identity evolution
@fozikio/tools-social Social cognition
@fozikio/tools-graph Graph analysis
@fozikio/tools-maintenance Memory maintenance
@fozikio/tools-vitals Health metrics
@fozikio/tools-reasoning Cognitive reasoning

Install any of them: npm install @fozikio/tools-threads

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 cortex-engine) and your .mcp.json is configured. Restart your MCP client after config changes. For plugins, install them in the same project directory.

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