Embeddings are optional but unlock the most powerful retrieval tools in the Neocarta MCP server. When theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/neo4j-labs/neocarta/llms.txt
Use this file to discover all available pages before exploring further.
description fields of Table, Column, Schema, Database, and BusinessTerm nodes are embedded, the MCP server gains access to vector search and hybrid search tools that go far beyond keyword matching — letting agents discover relevant tables by meaning, not just by name.
Which Nodes Can Have Embeddings
Thedescription field of the following node labels can be embedded and stored as a vector property directly on each node in Neo4j:
| Node Label | Enables |
|---|---|
Database | Cross-database semantic search |
Schema | Schema-level vector search (get_context_by_schema_and_table_vector_search) |
Table | Table-level vector and hybrid search |
Column | Column-level vector and hybrid search |
BusinessTerm | Business-term-bridged hybrid search |
The vector index dimension is auto-detected from the model on first use (a one-shot probe call). You do not need to configure dimensions manually unless you want to request a smaller truncated size from a model that supports it.
Two Embedding Connectors
Neocarta ships two connectors for generating and storing embeddings. Both write vectors back to Neo4j, create the required vector indexes, and process only nodes that do not already have anembedding property — making reruns safe and incremental.
LiteLLMEmbeddingsConnector
Multi-provider via LiteLLM. Recommended for most users.
OpenAIEmbeddingsConnector
Direct OpenAI SDK. Use when you need full client control.
LiteLLMEmbeddingsConnector
LiteLLMEmbeddingsConnector routes embedding requests through LiteLLM, giving you a single interface to OpenAI, Azure OpenAI, Google Gemini, Cohere, Amazon Bedrock, Vertex AI, Ollama, HuggingFace, and more. Provider routing is driven entirely by the embedding_model string you pass.
The Neo4j driver to use for reading nodes and writing embeddings.
LiteLLM model identifier. Examples:
"text-embedding-3-small" (OpenAI), "gemini-embedding-001" (Google), "cohere/embed-english-v3.0" (Cohere).The Neo4j database to write embeddings to.
Requested vector dimension for models that support truncation (e.g.
text-embedding-3-large truncated to 1024). When None, the model’s native dimension is auto-detected. Models that don’t support truncation silently ignore this parameter.Extra keyword arguments forwarded verbatim to
litellm.embedding / litellm.aembedding — useful for api_key, api_base (LiteLLM Proxy or custom endpoints), or api_version.arun(node_labels=[...], batch_size=100)— async workflow; within each batch all API calls are issued concurrently viaasyncio.gatherfor significantly faster throughput on large graphs.run(node_labels=[...], batch_size=100)— synchronous workflow.
- Async (recommended)
- Sync
| Provider | Environment Variable(s) |
|---|---|
| OpenAI | OPENAI_API_KEY |
| Google Gemini | GEMINI_API_KEY |
| Cohere | COHERE_API_KEY |
| Azure OpenAI | AZURE_API_KEY, AZURE_API_BASE, AZURE_API_VERSION |
| Amazon Bedrock | AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME |
| LiteLLM Proxy / custom endpoint | Pass api_key / api_base via litellm_kwargs |
OpenAIEmbeddingsConnector
OpenAIEmbeddingsConnector wraps the OpenAI Python SDK directly and accepts a pre-built OpenAI or AsyncOpenAI client. Use this when you need a custom base URL, a specific retry policy, proxy configuration, or already have an OpenAI client wired up elsewhere in your application. Unlike LiteLLMEmbeddingsConnector, dimensions must be supplied explicitly.
The Neo4j driver.
Pre-built async OpenAI client. Required if
client is not provided.Pre-built sync OpenAI client. Required if
async_client is not provided.The OpenAI embedding model ID.
Embedding vector dimension. Must be explicitly provided — there is no auto-detection.
The Neo4j database to write embeddings to.
Using Embeddings with the CLI
The Neocarta CLI exposes embedding generation through the--embeddings flag on any connector command. The embedding model and optional dimension are configured with environment variables.
| Environment Variable | Default | Description |
|---|---|---|
EMBEDDING_MODEL | text-embedding-3-small | LiteLLM model ID used for embedding |
EMBEDDING_DIMENSIONS | auto-detected | Requested dimension for models that support truncation |
EMBEDDING_BATCH_SIZE | 100 | Number of nodes processed per API batch |
How It Works at Ingest Time
Understanding what happens under the hood helps you reason about reruns and index compatibility.Probe the model dimension
A single test string is embedded to discover the model’s native vector size. This sets the dimension used for all subsequent calls and for the Neo4j vector index.
Create vector indexes
A cosine-similarity vector index is created per node label (e.g.
table_vector_index, column_vector_index). Index creation is idempotent — it skips if the index already exists.Fetch unembedded nodes
Neocarta queries Neo4j for nodes of the target label where
description IS NOT NULL and embedding IS NULL. Only nodes missing an embedding are processed.Embed in batches
Node descriptions are sent to the embedding API in batches of
batch_size. The async connector issues all calls in a batch concurrently; the sync connector processes them sequentially.