CLI Reference
Command-line interface for neo4j-agent-memory extraction and schema management.
Commands
extract
Extract entities from text or files.
neo4j-agent-memory extract [OPTIONS] TEXT
Options
| Option | Default | Description |
|---|---|---|
|
none |
Read text from file instead |
|
|
Extractor to use: |
|
all |
Entity types to extract (can repeat) |
|
|
Output format: |
|
|
Confidence threshold (0.0-1.0) |
|
|
Domain schema: |
|
|
Show extraction details |
Examples
# Extract from text
neo4j-agent-memory extract "John Smith works at Acme Corp in New York"
# Extract from file
neo4j-agent-memory extract --file document.txt
# Pipe from stdin
echo "Sarah lives in London" | neo4j-agent-memory extract -
# Use specific extractor
neo4j-agent-memory extract --extractor llm "..."
# Filter entity types
neo4j-agent-memory extract -t Person -t Organization "..."
# JSON output
neo4j-agent-memory extract --format json "..."
# Use domain schema
neo4j-agent-memory extract --schema podcast "..."
Output Formats
Table (default):
┏━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━┓
┃ Entity ┃ Type ┃ Subtype ┃ Confidence ┃
┡━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━┩
│ John Smith │ PERSON │ INDIVIDUAL │ 0.95 │
│ Acme Corp │ ORGANIZATION │ COMPANY │ 0.92 │
│ New York │ LOCATION │ CITY │ 0.88 │
└────────────────┴──────────────┴─────────────┴─────────────┘
JSON:
{
"entities": [
{"name": "John Smith", "type": "PERSON", "subtype": "INDIVIDUAL", "confidence": 0.95},
{"name": "Acme Corp", "type": "ORGANIZATION", "subtype": "COMPANY", "confidence": 0.92}
],
"metadata": {
"extractor": "gliner",
"schema": "poleo",
"duration_ms": 234
}
}
JSON Lines:
{"name": "John Smith", "type": "PERSON", "subtype": "INDIVIDUAL", "confidence": 0.95}
{"name": "Acme Corp", "type": "ORGANIZATION", "subtype": "COMPANY", "confidence": 0.92}
schemas
Manage entity extraction schemas stored in Neo4j.
schemas list
List all schemas in the database.
neo4j-agent-memory schemas list [OPTIONS]
| Option | Default | Description |
|---|---|---|
|
|
Neo4j connection URI |
|
|
Neo4j username |
|
required |
Neo4j password |
|
|
Output format: |
stats
Show memory statistics from Neo4j.
neo4j-agent-memory stats [OPTIONS]
| Option | Default | Description |
|---|---|---|
|
|
Neo4j connection URI |
|
|
Neo4j username |
|
required |
Neo4j password |
|
|
Output format: |
Example
neo4j-agent-memory stats --password $NEO4J_PASSWORD
Output:
Memory Statistics
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Short-Term Memory
Conversations: 42
Messages: 1,234
Long-Term Memory
Entities: 567
PERSON: 234
ORGANIZATION: 123
LOCATION: 89
OBJECT: 45
EVENT: 76
Preferences: 23
Facts: 156
Reasoning Memory
Traces: 89
Steps: 445
Tool Calls: 312
mcp serve
Start the MCP server for Claude Desktop and other MCP hosts.
neo4j-agent-memory mcp serve [OPTIONS]
Options
| Option | Default | Description |
|---|---|---|
|
|
Neo4j connection URI (env: |
|
|
Neo4j username (env: |
|
required |
Neo4j password (env: |
|
|
Neo4j database name (env: |
|
|
MCP transport ( |
|
|
Host for network transports. |
|
|
Port for network transports. |
|
|
Tool profile: |
|
|
|
|
none |
User ID for |
|
|
Token threshold for observational memory compression. |
|
disabled |
Disable automatic preference detection. |
|
none |
LLM provider string, e.g. |
|
none |
API key override for the LLM provider (env: |
|
none |
Base URL override (vLLM, Ollama, internal endpoint). |
|
none |
Embedding provider string, e.g. |
|
none |
Override embedding dimensions for unknown models. |
Examples
# Default (OpenAI embeddings, OpenAI gpt-4o-mini extractor).
neo4j-agent-memory mcp serve --password mypw
# Anthropic + local sentence-transformers, no OpenAI dependency.
neo4j-agent-memory mcp serve \
--password mypw \
--llm anthropic/claude-3-5-sonnet-latest \
--embedding BAAI/bge-small-en-v1.5
# Local vLLM endpoint via LiteLLM.
neo4j-agent-memory mcp serve \
--password mypw \
--llm openai/llama-3.3-70b-instruct \
--llm-api-base https://llms.internal.corp/v1
# Core profile (fewer tools), per-day session strategy.
neo4j-agent-memory mcp serve \
--password mypw \
--profile core \
--session-strategy per_day \
--user-id alice
Environment Variables
The CLI respects these environment variables:
# Neo4j connection (avoids passing --password)
export NEO4J_URI=bolt://localhost:7687
export NEO4J_USER=neo4j
export NEO4J_PASSWORD=password
# OpenAI (for LLM extractor or OpenAI provider strings)
export OPENAI_API_KEY=sk-...
# v0.3+ provider configuration
export NAM_LLM=anthropic/claude-3-5-sonnet-latest
export NAM_LLM_API_KEY=$ANTHROPIC_API_KEY
export NAM_EMBEDDING=BAAI/bge-small-en-v1.5
See Also
-
Configure Entity Extraction - Pipeline configuration
-
Domain Schemas Reference - Available schemas
-
Extractor Classes Reference - Python API