cognee-ts provides Node.js bindings for the
cognee-rs AI-memory SDK, built with
Neon. It is published on npm as
@cognee/cognee-ts.remember (ingest + extract in one call) →
recall (source-aware retrieval). These wrap the lower-level
add → cognify → search stages, which remain available when you
need finer control.
Installation
Quick start
Constructor
settings is an optional object (or JSON string) that overrides env-derived
defaults. Keys are the canonical Settings field names (llmModel,
embeddingProvider, vectorDbProvider, etc.). Absent keys keep their
env-variable or compiled-in default.
Config
Usec.config to change settings after construction. Granular setters are
synchronous and take effect immediately (the engines are lazily rebuilt on the
next pipeline call).
Pipeline operations
add
Ingest one or more data items into a named dataset.cognify
Extract entities and relationships into the knowledge graph.addAndCognify
Ingest and extract in a single call.Search and recall
search
Query the knowledge graph. Defaults toGRAPH_COMPLETION.
GRAPH_COMPLETION, SUMMARIES, CHUNKS, RAG_COMPLETION, TRIPLET_COMPLETION,
GRAPH_SUMMARY_COMPLETION, CYPHER, NATURAL_LANGUAGE, GRAPH_COMPLETION_COT,
GRAPH_COMPLETION_CONTEXT_EXTENSION, FEELING_LUCKY, FEEDBACK, TEMPORAL,
CODING_RULES, CHUNKS_LEXICAL.
recall
Session-first routing: checks session QA history before falling back to graph search.Memory operations
remember
Composite add + cognify with an optional improvement pass.memify
Index triplet embeddings from the existing knowledge graph. EnablesTripletCompletion search. Idempotent.
improve
Run the four-stage session-graph bridge pipeline.rememberEntry
Store a typed memory entry ("qa", "trace", or "feedback") in a session.
Datasets
Sessions
Notebooks
Users and pipeline-run admin
Data lifecycle
Cloud: serve / disconnect
serve and disconnect are module-level functions (not instance methods)
because they operate on global cloud state.
Visualisation
visualization feature compiled into the native addon.
Initialisation and observability
await c.ownerId(), returning the owner UUID used for
deterministic, per-tenant ID generation.
Set COGNEE_BINDING_SUPPRESS_LOGS=1 before requireing the module to skip the
auto-installed stderr subscriber if your host manages the logging pipeline.
Environment variables
| Variable | Purpose |
|---|---|
OPENAI_URL | LLM API base URL (OpenAI-compatible endpoint). |
OPENAI_TOKEN | LLM API key. |
OPENAI_MODEL | LLM model name (default: gpt-4o-mini). |
EMBEDDING_PROVIDER | Embedding provider: openai, ollama, onnx, mock. |
EMBEDDING_MODEL | Embedding model name. |
EMBEDDING_DIMENSIONS | Embedding vector dimensions. |
EMBEDDING_ENDPOINT | Embedding API base URL (falls back to OPENAI_URL). |
EMBEDDING_API_KEY | Embedding API key (falls back to OPENAI_TOKEN). |
MOCK_EMBEDDING | Set true to use zero-vector mock embeddings (no model download). |
COGNEE_BINDING_SUPPRESS_LOGS | Suppress the auto-installed stderr fmt subscriber. |
COGNEE_HOST_SDK | Suppress binding-armed analytics when the host is an embedding SDK. |
TELEMETRY_DISABLED, ENV | Standard analytics opt-outs for setupTelemetryAnalytics(). |
RUST_LOG, LOG_LEVEL | tracing-subscriber env-filter level overrides. |
COGNEE_LOG_*, LOG_FILE_NAME | Consumed by setupLogging(). |
OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_SERVICE_NAME, OTEL_* | Consumed by setupTelemetry(). |
Low-level pipeline API
The original pipeline engine API is available under thepipeline namespace:
cognee-ts:
Next Steps
cognee-ts on npm
Package page, versions, and the full README with runnable examples.
Rust SDK
The underlying cognee-rs engine and its CLI.