πŸš€ Join our Agentic AI Hackathon in SF, April 25th! Apply now
< backDeep 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

Agents Don't Need Another Protocol. They Need a Good CLI.
Your agent forgets everything between sessions. The fix isn't a bigger context window β€” it's persistent memory via a CLI. Four commands give your agent cross-session, graph-structured memory.
Claude Code's Leak Reveals Anthropic's Obsession with Cognee
Anthropic accidentally exposed 500,000 lines of internal source code. Buried inside: engineers studying Cognee's memory architecture and wondering if they should just adopt it.
Expanding Custom Graph Models for Reliable Agent Memory & Retrieval
Learn how Custom Graph Models in cognee create a stable, domain-aware memory layer for agents β€” and how the Cascade feature progressively discovers missing schema from real data.