CLI Reference
Command-line interface for neo4j-agent-memory extraction and schema management.
Commands
extract
Extract entities from text or files.
neo4j-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-memory extract "John Smith works at Acme Corp in New York"
# Extract from file
neo4j-memory extract --file document.txt
# Pipe from stdin
echo "Sarah lives in London" | neo4j-memory extract -
# Use specific extractor
neo4j-memory extract --extractor llm "..."
# Filter entity types
neo4j-memory extract -t Person -t Organization "..."
# JSON output
neo4j-memory extract --format json "..."
# Use domain schema
neo4j-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-memory schemas list [OPTIONS]
| Option | Default | Description |
|---|---|---|
|
|
Neo4j connection URI |
|
|
Neo4j username |
|
required |
Neo4j password |
|
|
Output format: |
stats
Show memory statistics from Neo4j.
neo4j-memory stats [OPTIONS]
| Option | Default | Description |
|---|---|---|
|
|
Neo4j connection URI |
|
|
Neo4j username |
|
required |
Neo4j password |
|
|
Output format: |
Example
neo4j-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
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)
export OPENAI_API_KEY=sk-...
See Also
-
Configure Entity Extraction - Pipeline configuration
-
Domain Schemas Reference - Available schemas
-
Extractor Classes Reference - Python API