Air-gapped or budget-conscious? Use
neo4j-agent-memorywith no LLM provider — local embeddings, local NER, no API keys.
This example shows how to wire MemorySettings for environments where you can't (or don't want to) call an LLM. The key is llm=None plus a non-LLM extractor and a local embedder.
⚠️ Neo4j Labs ProjectThis example is part of
neo4j-agent-memory, a Neo4j Labs project. It is actively maintained but not officially supported. APIs may change. Community support is available via the Neo4j Community Forum.
- Air-gapped or offline deployments where outbound API calls aren't allowed.
- Cost-sensitive workloads where every LLM call counts.
- Deterministic test environments where you want zero variability from a remote model.
- Bootstrapping a new project before you've decided on an LLM vendor.
llm=None— explicit opt-out. Validated at construction time.- Provider-string shorthand for local embeddings —
"sentence-transformers/all-MiniLM-L6-v2"resolves toSentenceTransformersProviderviafrom_provider. No external API calls. ExtractorType.PIPELINEwithenable_llm_fallback=False— multi-stage spaCy + GLiNER pipeline, no LLM rescue.- Configuration-time validation — if you pair
llm=Nonewith an extractor that requires an LLM,MemorySettingsraises aValidationErrornaming both fields rather than failing later at runtime.
settings = MemorySettings(
neo4j=Neo4jConfig(...),
llm=None, # explicit opt-out
embedding="sentence-transformers/all-MiniLM-L6-v2",# local embeddings
extraction=ExtractionConfig(
extractor_type=ExtractorType.PIPELINE,
enable_spacy=True,
enable_gliner=True,
enable_llm_fallback=False, # required when llm=None
),
)pip install "neo4j-agent-memory[extraction,sentence-transformers]"
python -m spacy download en_core_web_smA running Neo4j 5.x. Set NEO4J_URI / NEO4J_PASSWORD if you're not using bolt://localhost:7687 with the default password.
python main.pyYou'll see a printed memory context built without a single call to OpenAI, no API key required.
- How-to guide:
docs/modules/ROOT/pages/how-to/running-without-an-llm.adoc. - Reference:
docs/modules/ROOT/pages/reference/extractors.adoc— extractor menu, when to add LLM rescue, GLiNER schema choices.
Verified against neo4j-agent-memory v0.1.2 / v0.2-dev on 2026-05-03.