Agentic Memory

API Reference

Reference for the hosted agent-memory CLI and MCP tools exposed over OAuth.

Hosted CLI commands

Global env: AM_HOSTED_BASE_URL, AM_API_TOKEN. Config: ~/.config/agent-memory/cli.json.

agent-memory login --api-key <key>

Persist your account API key for hosted requests. Set AM_HOSTED_BASE_URL=https://backend.agentmemorylabs.com before logging in.

agent-memory init --managed

Create .agentic-memory/config.json in the current repo and bind it to managed hosting. Run from the repository root.

agent-memory doctor [--json]

Fail-closed readiness checks — auth, backend reachability, and project config. Exit 0 means ready to index and search.

agent-memory index [--full] [--no-wait] [--json]

Snapshot the repo and start a managed code-index job on Ladybug. Waits for completion by default; use --no-wait to return the job id immediately.

agent-memory index-watch --job-id <id>

Poll a code-index job until it reaches a terminal state. Pair with index --no-wait for long-running repos.

agent-memory search --query "..."

Unified semantic search across indexed code (and connected memory modules when enabled).

agent-memory mcp setup [--profile setup|steady-state|both]

Print MCP client wiring for hosted OAuth endpoints. Use --profile setup for frictionless Cursor onboarding at mcp.agentmemorylabs.com.

agent-memory status

Snapshot of server and CLI configuration — useful when debugging login or base URL issues.

Full install walkthrough: Quickstart.

MCP tools (hosted)

Available through OAuth MCP mounts — no local stdio server required.

search_codebase(query, limit=5, as_of=None)

Semantically search the codebase. Optionally filter by temporal validity with as_of.

get_file_dependencies(file_path)

Returns files this file imports and files that import it.

trace_execution_path(start_symbol, max_depth=2)

Trace a function's likely execution neighborhood on demand.

search_all_memory(query, as_of=None)

Search across code, research, and conversations in one call.

search_conversations(query, limit=5, as_of=None)

Semantic search over past conversation turns.

add_message(role, content, session_id)

Store a new message in conversation memory.

Client setup: MCP Integration.

Legacy CLI (historical)

The Python agentic-memory CLI used local Neo4j and a stdio MCP server. These commands are not the hosted production path.

agentic-memory init — interactive Neo4j wizard

agentic-memory index — local structural ingestion

agentic-memory watch — continuous file monitoring

agentic-memory serve — local stdio MCP on port 8000 (replaced by hosted OAuth MCP)

See Self-Hosted Legacy for the full historical stack.