πŸš€ Join our Agentic AI Hackathon in San Francisco, May 16th! Apply now
Home< BlogDeep Dives
Apr 14, 2026
4 minutes read

Agents Don't Need Another Protocol. They Need a Good CLI.

David Myriel
David MyrielAI Researcher

Your agent forgets everything between sessions. Every conversation starts from zero. Past outcomes, user preferences, resolved issues β€” gone. You're building a system that can reason but can't learn.

The fix isn't a bigger context window or a better retrieval plugin. It's persistent memory. And the simplest way to give an agent memory is a CLI.

We built Cognee as an open-source memory engine for AI agents. Here's why we put a terminal interface in front of it β€” and why that choice makes your agent faster, cheaper, and better over time.

LLMs already know how to use a CLI

LLMs are trained on billions of lines of terminal interactions. Commands, flags, outputs, man pages β€” these patterns are deep in the weights. When an agent sees cognee-cli recall "deployment history", it doesn't need a schema to understand what that does.

Protocol-based tools work differently:

GitHub's MCP server loads 43 tool definitions β€” roughly 44,000 tokens β€” before the agent asks a single question. A CLI loads zero. The agent pays only for what it reads.

That difference is measurable. ScaleKit's benchmarks (75 runs, March 2026) found that 800 tokens of CLI tips reduced tool calls and latency by a third each β€” the single biggest efficiency gain in their study. Your agent keeps more of its context window for actual reasoning instead of burning it on tool definitions.

Four commands give your agent persistent memory

An agent that can run these four commands has cross-session, graph-structured memory. No SDK integration. No server to run. No schema to inject.

We named them remember, recall, improve, forget instead of database verbs like add, search, enrich, delete β€” because an LLM reading a system prompt that says "use cognee-cli to remember facts and recall context" parses that instantly. The entire interface fits in 37 tokens of system prompt:

This is the entire integration. No SDK. No config files. No server.

Here's what each command does for you.

remember stores knowledge. It runs the full pipeline β€” entity extraction, relationship detection, graph construction β€” in a single call. No separate "add then process" step. One command, and the data is in your knowledge graph. (The full pipeline is covered in our architecture post.)

recall retrieves context. If a session ID is present, it checks session cache first β€” fast path, no graph traversal. No match? It falls through to the full knowledge graph with semantic search. Your agent gets the best available context without deciding where to look.

forget deletes what shouldn't persist. Memory without a deletion mechanism is a liability.

improve is the reason we built a knowledge graph instead of a document store. After your agent acts on recalled context, it can record whether that context was useful (cognee-cli feedback add <session> <id> --score 5). When improve runs, it adjusts weights across the graph β€” nodes behind good answers get reinforced, nodes behind poor answers get dampened.

The result: your agent's memory gets better over time without you editing anything. Day 100 is measurably better than day 1. Same agent, same prompt, same model β€” what changes is the quality of what it recalls.

Note: Most agent memory is static β€” store chunks, retrieve chunks, get the same results regardless of whether they helped last time. improve closes that loop.

Try it

Two commands from zero to a working knowledge graph. The architecture underneath β€” graph store, vector index, 14 search modes, multi-tenant isolation β€” is covered in our architecture post. The self-improving feedback loop builds on what Veljko described in Building Self-Improving Skills.

The code is at github.com/topoteretes/cognee.

Join the Discord community: Discord

Cognee is the fastest way to start building reliable Al agent memory.

Latest

Separate memories for organization, agent and user: Support AI Agent Use-Case
Most support teams don't have a support problem β€” they have a context problem. Here's how we built a support agent on top of cognee using user, agent, and organization memory.
Memory as a Decorator
Deep DivesApr 28, 2026

Memory as a Decorator

Adding memory to agentic workflows used to mean restructuring your stack. One decorator changes that. We ran 198 simulated sales conversations β€” and the results make a strong case for structured memory.
Cognee's CLI Replaces MCP OAuth in 100 Lines
MCP has real auth built in. CLI doesn't β€” or so the claim goes. The Claude Code plugin that wraps cognee-cli runs a full register-login-token handshake before the first command fires.