{"_id":"@cognee/cognee-ts","_rev":"5-2941c17feedbb0ee04936fa5c30209a7","name":"@cognee/cognee-ts","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@cognee/cognee-ts","version":"0.1.0","keywords":["ai","knowledge-graph","memory","rag","embeddings"],"license":"MIT OR Apache-2.0","_id":"@cognee/cognee-ts@0.1.0","maintainers":[{"name":"andrej_cognee","email":"andrej@topoteretes.com"},{"name":"dmytro_gordon","email":"dmytro@topoteretes.com"},{"name":"vkovac2","email":"veljko@topoteretes.com"},{"name":"cognee_","email":"vasilije@topoteretes.com"}],"homepage":"https://www.cognee.ai","bugs":{"url":"https://github.com/topoteretes/cognee-rs/issues"},"dist":{"shasum":"70511be0352da20fd7943edbe22b21a79b5cc80b","tarball":"https://registry.npmjs.org/@cognee/cognee-ts/-/cognee-ts-0.1.0.tgz","fileCount":66,"integrity":"sha512-U/bdhR5EDFSbnYMB3D+CAHr5fwBvXPkUjzraD63e6JbiY8VuN7XkROKvEfhzmfQYrc9JhJa/kqAhcoHxwSmnTg==","signatures":[{"sig":"MEUCIFlbBhgPCjka536Sun6XTYNhuiGcQoSRelaBY7+Wu44KAiEAmLokTmbLGvTVNmHIR7718PI6ifwe9EJ4e9tNdbTV5c8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":201092},"main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"e16f4ebade1d66214f6dd76b03a3d8d07f22ce7a","scripts":{"test":"jest --config jest.config.js","build":"npm run build:rust && npm run build:ts","example":"ts-node examples/add-cognify-search.ts","build:ts":"tsc","build:rust":"cd cognee-ts-neon && cargo build --release && cd .. && node scripts/copy-artifact.js release","postinstall":"node scripts/postinstall.js","example:config":"ts-node examples/config.ts","example:memify":"ts-node examples/memify-recall.ts","build:rust:debug":"cd cognee-ts-neon && cargo build && cd .. && node scripts/copy-artifact.js debug","example:datasets":"ts-node examples/datasets.ts","example:pipeline":"ts-node examples/pipeline-engine.ts","example:sessions":"ts-node examples/sessions.ts","example:visualize":"ts-node examples/visualize.ts"},"_npmUser":{"name":"dmytro_gordon","email":"dmytro@topoteretes.com"},"repository":{"url":"git+https://github.com/topoteretes/cognee-rs.git","type":"git"},"_npmVersion":"10.8.2","description":"Node.js bindings for the cognee AI-memory SDK","directories":{},"_nodeVersion":"20.20.2","dependencies":{"dotenv":"^16.6.1","@neon-rs/load":"^0.2.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","ts-jest":"^29.0.0","ts-node":"^10.9.0","typescript":"^5.4.0","@types/jest":"^29.5.0","@types/node":"^20.0.0"},"optionalDependencies":{"@cognee/neon-darwin-x64":"0.1.0","@cognee/neon-darwin-arm64":"0.1.0","@cognee/neon-linux-x64-gnu":"0.1.0","@cognee/neon-linux-x64-musl":"0.1.0","@cognee/neon-win32-x64-msvc":"0.1.0","@cognee/neon-linux-arm64-gnu":"0.1.0","@cognee/neon-linux-arm64-musl":"0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/cognee-ts_0.1.0_1782411034101_0.7258736092250515","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@cognee/cognee-ts","version":"0.1.1","keywords":["ai","knowledge-graph","memory","rag","embeddings"],"license":"MIT OR Apache-2.0","_id":"@cognee/cognee-ts@0.1.1","maintainers":[{"name":"andrej_cognee","email":"andrej@topoteretes.com"},{"name":"dmytro_gordon","email":"dmytro@topoteretes.com"},{"name":"vkovac2","email":"veljko@topoteretes.com"},{"name":"cognee_","email":"vasilije@topoteretes.com"}],"homepage":"https://www.cognee.ai","bugs":{"url":"https://github.com/topoteretes/cognee-rs/issues"},"dist":{"shasum":"be491cd69b1e1c052c00fda0cb745baf05ac3694","tarball":"https://registry.npmjs.org/@cognee/cognee-ts/-/cognee-ts-0.1.1.tgz","fileCount":66,"integrity":"sha512-02qG+prwwklLu+gc5+vAP/xOFap9QE1KuYUiGGbGd1vTsXHwJTun0aJ2SE/s+I6ZZqScJYUQ8NCeI3KSsUkYMA==","signatures":[{"sig":"MEUCICN7kfQbpAt1KOoOovTjDzr3oSwhH4v19VFogoO2BOPgAiEArcTzezyb88vBu8BW+0R+E2/36JMeGsRObl5QA9a3IPo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":201435},"main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"a86722e2d65058cb9ac94f955b367b2fb252fd75","scripts":{"test":"jest --config jest.config.js","build":"npm run build:rust && npm run build:ts","example":"ts-node examples/remember-recall.ts","build:ts":"tsc","build:rust":"cd cognee-ts-neon && cargo build --release && cd .. && node scripts/copy-artifact.js release","postinstall":"node scripts/postinstall.js","example:config":"ts-node examples/config.ts","example:memify":"ts-node examples/memify-recall.ts","build:rust:debug":"cd cognee-ts-neon && cargo build && cd .. && node scripts/copy-artifact.js debug","example:datasets":"ts-node examples/datasets.ts","example:pipeline":"ts-node examples/pipeline-engine.ts","example:sessions":"ts-node examples/sessions.ts","example:visualize":"ts-node examples/visualize.ts","example:add-cognify-search":"ts-node examples/add-cognify-search.ts"},"_npmUser":{"name":"dmytro_gordon","email":"dmytro@topoteretes.com"},"repository":{"url":"git+https://github.com/topoteretes/cognee-rs.git","type":"git"},"_npmVersion":"11.12.1","description":"Node.js bindings for the cognee AI-memory SDK","directories":{},"_nodeVersion":"25.9.0","dependencies":{"dotenv":"^16.6.1","@neon-rs/load":"^0.2.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","ts-jest":"^29.0.0","ts-node":"^10.9.0","typescript":"^5.4.0","@types/jest":"^29.5.0","@types/node":"^20.0.0"},"optionalDependencies":{"@cognee/neon-darwin-x64":"0.1.0","@cognee/neon-darwin-arm64":"0.1.0","@cognee/neon-linux-x64-gnu":"0.1.0","@cognee/neon-linux-x64-musl":"0.1.0","@cognee/neon-win32-x64-msvc":"0.1.0","@cognee/neon-linux-arm64-gnu":"0.1.0","@cognee/neon-linux-arm64-musl":"0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/cognee-ts_0.1.1_1782465610921_0.8301840142010726","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@cognee/cognee-ts","version":"0.1.2","keywords":["ai","knowledge-graph","memory","rag","embeddings"],"license":"MIT OR Apache-2.0","_id":"@cognee/cognee-ts@0.1.2","maintainers":[{"name":"andrej_cognee","email":"andrej@topoteretes.com"},{"name":"dmytro_gordon","email":"dmytro@topoteretes.com"},{"name":"vkovac2","email":"veljko@topoteretes.com"},{"name":"cognee_","email":"vasilije@topoteretes.com"}],"homepage":"https://www.cognee.ai","bugs":{"url":"https://github.com/topoteretes/cognee-rs/issues"},"dist":{"shasum":"931b268bf37dea6dea24635ffb470dd4b496a89c","tarball":"https://registry.npmjs.org/@cognee/cognee-ts/-/cognee-ts-0.1.2.tgz","fileCount":66,"integrity":"sha512-1CN9714nuVKz/rjis52z9CNGyAXHaWyzWUfC5+wKzHr1vZgioZHtnP6jyMnrwQ2MGkOXBZrdA+AHWEHUe2GEZA==","signatures":[{"sig":"MEYCIQCIrLMag9Yfp0i/HmungoVPnPDPe7w2P1b8gJL+TgkZsQIhAIS97SFGnwDrI4p5oGCF29F4dlQu+yTnVLAKCDRj4xsY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":206679},"main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"fceaddd1eda546c4d7cbbe9c47542fb6f2cbc023","scripts":{"test":"jest --config jest.config.js","build":"npm run build:rust && npm run build:ts","example":"ts-node examples/remember-recall.ts","build:ts":"tsc","build:rust":"cd cognee-ts-neon && cargo build --release && cd .. && node scripts/copy-artifact.js release","postinstall":"node scripts/postinstall.js","example:config":"ts-node examples/config.ts","example:memify":"ts-node examples/memify-recall.ts","build:rust:debug":"cd cognee-ts-neon && cargo build && cd .. && node scripts/copy-artifact.js debug","example:datasets":"ts-node examples/datasets.ts","example:pipeline":"ts-node examples/pipeline-engine.ts","example:sessions":"ts-node examples/sessions.ts","example:visualize":"ts-node examples/visualize.ts","example:add-cognify-search":"ts-node examples/add-cognify-search.ts"},"_npmUser":{"name":"dmytro_gordon","email":"dmytro@topoteretes.com"},"repository":{"url":"git+https://github.com/topoteretes/cognee-rs.git","type":"git"},"_npmVersion":"10.8.2","description":"Node.js bindings for the cognee AI-memory SDK","directories":{},"_nodeVersion":"20.20.2","dependencies":{"dotenv":"^16.6.1","@neon-rs/load":"^0.2.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","ts-jest":"^29.0.0","ts-node":"^10.9.0","typescript":"^5.4.0","@types/jest":"^29.5.0","@types/node":"^20.0.0"},"optionalDependencies":{"@cognee/neon-darwin-x64":"0.1.2","@cognee/neon-darwin-arm64":"0.1.2","@cognee/neon-linux-x64-gnu":"0.1.2","@cognee/neon-linux-x64-musl":"0.1.2","@cognee/neon-win32-x64-msvc":"0.1.2","@cognee/neon-linux-arm64-gnu":"0.1.2","@cognee/neon-linux-arm64-musl":"0.1.2"},"_npmOperationalInternal":{"tmp":"tmp/cognee-ts_0.1.2_1782494463901_0.7058005532089042","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@cognee/cognee-ts","version":"0.1.3","keywords":["ai","knowledge-graph","memory","rag","embeddings"],"license":"MIT OR Apache-2.0","_id":"@cognee/cognee-ts@0.1.3","maintainers":[{"name":"andrej_cognee","email":"andrej@topoteretes.com"},{"name":"dmytro_gordon","email":"dmytro@topoteretes.com"},{"name":"vkovac2","email":"veljko@topoteretes.com"},{"name":"cognee_","email":"vasilije@topoteretes.com"}],"homepage":"https://www.cognee.ai","bugs":{"url":"https://github.com/topoteretes/cognee-rs/issues"},"dist":{"shasum":"ee18d63339ea8149eddbd092b00d8df62ff17151","tarball":"https://registry.npmjs.org/@cognee/cognee-ts/-/cognee-ts-0.1.3.tgz","fileCount":66,"integrity":"sha512-N7ysLzpL7IjvBuQexJ4MIR01CDUnQyyabuMxZLlsuyiXjZzb6O7Rp6QmkqLAeVfFAt894Xb+O/F43VYJgT/5uA==","signatures":[{"sig":"MEQCIAGeLD/kRS2u5h9E3WdmnFBQBEBEmg1/EaYbXbnIsU4NAiA/GOqx3TvIM8LltVyslKm9AniJJt9FdJlERZv/X47Rnw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":206029},"main":"lib/index.js","types":"lib/index.d.ts","engines":{"node":">=16.0.0"},"gitHead":"615ca600b0dce94b98c83389eb9abd77c53c9ae8","scripts":{"test":"jest --config jest.config.js","build":"npm run build:rust && npm run build:ts","example":"ts-node examples/remember-recall.ts","build:ts":"tsc","build:rust":"cd cognee-ts-neon && cargo build --release && cd .. && node scripts/copy-artifact.js release","postinstall":"node scripts/postinstall.js","example:config":"ts-node examples/config.ts","example:memify":"ts-node examples/memify-recall.ts","build:rust:debug":"cd cognee-ts-neon && cargo build && cd .. && node scripts/copy-artifact.js debug","example:datasets":"ts-node examples/datasets.ts","example:pipeline":"ts-node examples/pipeline-engine.ts","example:sessions":"ts-node examples/sessions.ts","example:visualize":"ts-node examples/visualize.ts","example:add-cognify-search":"ts-node examples/add-cognify-search.ts"},"_npmUser":{"name":"dmytro_gordon","email":"dmytro@topoteretes.com"},"repository":{"url":"git+https://github.com/topoteretes/cognee-rs.git","type":"git"},"_npmVersion":"10.8.2","description":"Node.js bindings for the cognee AI-memory SDK","directories":{},"_nodeVersion":"20.20.2","dependencies":{"dotenv":"^16.6.1","@neon-rs/load":"^0.2.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.0.0","ts-jest":"^29.0.0","ts-node":"^10.9.0","typescript":"^5.4.0","@types/jest":"^29.5.0","@types/node":"^20.0.0"},"optionalDependencies":{"@cognee/neon-darwin-arm64":"0.1.3","@cognee/neon-linux-x64-gnu":"0.1.3","@cognee/neon-win32-x64-msvc":"0.1.3","@cognee/neon-linux-arm64-gnu":"0.1.3"},"_npmOperationalInternal":{"tmp":"tmp/cognee-ts_0.1.3_1783066561679_0.0915541246183531","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@cognee/cognee-ts","version":"0.2.0","description":"Node.js bindings for the cognee AI-memory SDK","license":"MIT OR Apache-2.0","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/topoteretes/cognee-rs.git"},"homepage":"https://www.cognee.ai","keywords":["ai","knowledge-graph","memory","rag","embeddings"],"main":"lib/index.js","types":"lib/index.d.ts","scripts":{"build:rust":"cd cognee-ts-neon && cargo build --release && cd .. && node scripts/copy-artifact.js release","build:rust:debug":"cd cognee-ts-neon && cargo build && cd .. && node scripts/copy-artifact.js debug","build:ts":"tsc","build":"npm run build:rust && npm run build:ts","postinstall":"node scripts/postinstall.js","test":"jest --config jest.config.js","example":"ts-node examples/remember-recall.ts","example:add-cognify-search":"ts-node examples/add-cognify-search.ts","example:memify":"ts-node examples/memify-recall.ts","example:datasets":"ts-node examples/datasets.ts","example:sessions":"ts-node examples/sessions.ts","example:config":"ts-node examples/config.ts","example:visualize":"ts-node examples/visualize.ts","example:pipeline":"ts-node examples/pipeline-engine.ts"},"engines":{"node":">=16.0.0"},"dependencies":{"@neon-rs/load":"^0.2.6","dotenv":"^16.6.1"},"optionalDependencies":{"@cognee/neon-darwin-arm64":"0.2.0","@cognee/neon-linux-arm64-gnu":"0.2.0","@cognee/neon-linux-x64-gnu":"0.2.0","@cognee/neon-win32-x64-msvc":"0.2.0"},"devDependencies":{"@types/jest":"^29.5.0","@types/node":"^20.0.0","jest":"^29.0.0","ts-jest":"^29.0.0","ts-node":"^10.9.0","typescript":"^5.4.0"},"_id":"@cognee/cognee-ts@0.2.0","gitHead":"400c4bc7a82868cdb90529c0890606f06b36c2e2","bugs":{"url":"https://github.com/topoteretes/cognee-rs/issues"},"_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-AFPcKa/xp5uNNMRPxZsjeo03Yypj9r0EW2PteVVU7KlN0Q87SloP+7AdSyD0tlirWUisCnUT82jb4JFhxiSeRg==","shasum":"841330f7b868ad3cc6d686d0612c274063c495c1","tarball":"https://registry.npmjs.org/@cognee/cognee-ts/-/cognee-ts-0.2.0.tgz","fileCount":66,"unpackedSize":209172,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCMGBV6UBcczT1/W3lbyFLQRf3InywXX6ah2VkvZlwyGwIgC7aNmDQ61+YpSRwCRTpnb3uLI/0xKTaj/U7l9YGkzyA="}]},"_npmUser":{"name":"dmytro_gordon","email":"dmytro@topoteretes.com"},"directories":{},"maintainers":[{"name":"andrej_cognee","email":"andrej@topoteretes.com"},{"name":"dmytro_gordon","email":"dmytro@topoteretes.com"},{"name":"vkovac2","email":"veljko@topoteretes.com"},{"name":"cognee_","email":"vasilije@topoteretes.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cognee-ts_0.2.0_1785436870540_0.35181922878495464"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-25T18:10:33.933Z","modified":"2026-07-30T18:41:10.979Z","0.1.0":"2026-06-25T18:10:34.275Z","0.1.1":"2026-06-26T09:20:11.051Z","0.1.2":"2026-06-26T17:21:04.104Z","0.1.3":"2026-07-03T08:16:01.808Z","0.2.0":"2026-07-30T18:41:10.695Z"},"bugs":{"url":"https://github.com/topoteretes/cognee-rs/issues"},"license":"MIT OR Apache-2.0","homepage":"https://www.cognee.ai","keywords":["ai","knowledge-graph","memory","rag","embeddings"],"repository":{"type":"git","url":"git+https://github.com/topoteretes/cognee-rs.git"},"description":"Node.js bindings for the cognee AI-memory SDK","maintainers":[{"name":"andrej_cognee","email":"andrej@topoteretes.com"},{"name":"dmytro_gordon","email":"dmytro@topoteretes.com"},{"name":"vkovac2","email":"veljko@topoteretes.com"},{"name":"cognee_","email":"vasilije@topoteretes.com"}],"readme":"# cognee-ts\n\nNode.js bindings for the [cognee-rs](https://github.com/topoteretes/cognee-rs)\nAI-memory SDK, built with [Neon](https://neon-bindings.com/).\n\nCognee transforms raw text, files, and URLs into a persistent, queryable knowledge graph.\nThe high-level API is **remember** (ingest + extract in one call) → **recall** (source-aware\nretrieval). These wrap the lower-level **add** → **cognify** → **search** stages, which remain\navailable when you need finer control.\n\n## Installation\n\n```bash\nnpm install @cognee/cognee-ts\n```\n\n## Quick start\n\n```ts\nimport { init, Cognee } from '@cognee/cognee-ts';\n\n// Boot the Rust async runtime (call once at process start).\ninit();\n\nconst c = new Cognee({\n  llmModel:   \"gpt-4o-mini\",\n  llmApiKey:  process.env.OPENAI_TOKEN,\n});\n\n// Warm up engines (builds embedding model, resolves default user).\nawait c.warm();\n\n// Ingest content and extract a knowledge graph in one call.\nawait c.remember({ type: \"text\", text: \"The quick brown fox jumps over the lazy dog.\" }, \"demo\");\n\n// Recall an answer with source-aware routing.\nconst recall = await c.recall(\"What does the fox do?\");\nconsole.log(recall.searchResponse?.result?.data);\n```\n\nFully-annotated runnable examples are available in the [`examples/`](examples/) directory.\n\n| Example | npm script | What it covers |\n|---|---|---|\n| [`remember-recall.ts`](examples/remember-recall.ts) | `npm run example` | High-level remember → recall pipeline |\n| [`add-cognify-search.ts`](examples/add-cognify-search.ts) | `npm run example:add-cognify-search` | Lower-level add → cognify → search pipeline |\n| [`memify-recall.ts`](examples/memify-recall.ts) | `npm run example:memify` | Triplet embeddings (memify) + session recall |\n| [`datasets.ts`](examples/datasets.ts) | `npm run example:datasets` | Dataset listing, status, deletion |\n| [`sessions.ts`](examples/sessions.ts) | `npm run example:sessions` | QA history, feedback, graph-context snapshots |\n| [`config.ts`](examples/config.ts) | `npm run example:config` | Programmatic config (LLM / embedding / DBs) |\n| [`visualize.ts`](examples/visualize.ts) | `npm run example:visualize` | Render knowledge graph to HTML |\n| [`pipeline-engine.ts`](examples/pipeline-engine.ts) | `npm run example:pipeline` | Low-level pipeline API (no credentials needed) |\n\nAll examples validate required env vars up front and exit 0 with a clear `SKIP`\nmessage when they are absent, so they can be run in CI without secrets.\n\n## Constructor\n\n```ts\nconst c = new Cognee(settings?)\n```\n\n`settings` is an optional object (or JSON string) that overrides env-derived defaults.\nKeys are the canonical Settings field names (`llmModel`, `embeddingProvider`,\n`vectorDbProvider`, etc.). Absent keys keep their env-variable or compiled-in default.\n\n## Config\n\nUse `c.config` to change settings after construction. Granular setters are synchronous\nand take effect immediately (the engines are lazily rebuilt on the next pipeline call).\n\n```ts\nc.config.setLlmModel(\"gpt-4o\");\nc.config.setLlmApiKey(process.env.OPENAI_TOKEN!);\nc.config.setEmbeddingProvider(\"openai\");\nc.config.setEmbeddingModel(\"text-embedding-3-small\");\n\n// Bulk setters (throw on unknown key or type mismatch) — one per subsystem:\nc.config.setLlmConfig({ model: \"gpt-4o\", temperature: 0.2 });\nc.config.setEmbeddingConfig({ provider: \"openai\", model: \"text-embedding-3-small\" });\nc.config.setVectorDbConfig({ provider: \"brute-force\" });\nc.config.setGraphDbConfig({ provider: \"kuzu\" });\n\n// Generic key-value setter:\nc.config.set(\"llmModel\", \"gpt-4o-mini\");\n\n// Read back the current config (secret fields are redacted):\nconst cfg = c.config.get();\nconsole.log(cfg);\n```\n\n## Pipeline operations\n\n### add\n\nIngest one or more data items into a named dataset.\n\n```ts\n// Text\nawait c.add({ type: \"text\", text: \"…\" }, \"my-dataset\");\n\n// File\nawait c.add({ type: \"file\", path: \"/abs/path/to/doc.txt\" }, \"my-dataset\");\n\n// URL\nawait c.add({ type: \"url\", url: \"https://example.com/article\" }, \"my-dataset\");\n\n// Binary (name is required for MIME detection)\nawait c.add({ type: \"binary\", bytes: buffer, name: \"report.pdf\" }, \"my-dataset\");\n\n// Multiple items at once\nawait c.add([\n  { type: \"text\", text: \"First document\" },\n  { type: \"file\", path: \"/abs/path/two.txt\" },\n], \"my-dataset\");\n```\n\n### cognify\n\nExtract entities and relationships into the knowledge graph.\n\n```ts\nawait c.cognify(\"my-dataset\");\n\n// With options\nawait c.cognify(\"my-dataset\", {\n  chunkSize: 512,\n  summarization: true,\n  triplet: true,       // also index triplet embeddings (enables TripletCompletion search)\n});\n```\n\n### addAndCognify\n\nIngest and extract in a single call.\n\n```ts\nconst { add, cognify } = await c.addAndCognify(\n  { type: \"text\", text: \"…\" },\n  \"my-dataset\"\n);\n```\n\n## Search and recall\n\n### search\n\nQuery the knowledge graph. Defaults to `GRAPH_COMPLETION`.\n\n```ts\nconst result = await c.search(\"What is the capital of France?\");\n\n// With options\nconst result = await c.search(\"summarise recent events\", {\n  searchType: \"SUMMARIES\",\n  topK: 5,\n  datasets: [\"news\"],\n});\n```\n\nAll 16 search types are supported (SCREAMING_SNAKE_CASE):\n`GRAPH_COMPLETION`, `SUMMARIES`, `CHUNKS`, `RAG_COMPLETION`, `TRIPLET_COMPLETION`,\n`GRAPH_SUMMARY_COMPLETION`, `CYPHER`, `NATURAL_LANGUAGE`, `GRAPH_COMPLETION_COT`,\n`GRAPH_COMPLETION_CONTEXT_EXTENSION`, `FEELING_LUCKY`, `FEEDBACK`, `TEMPORAL`,\n`CODING_RULES`, `CHUNKS_LEXICAL`, `HYBRID_COMPLETION`.\n\n### recall\n\nSession-first routing: checks session QA history before falling back to graph search.\n\n```ts\nconst result = await c.recall(\"What did we discuss?\", {\n  sessionId: \"session-uuid\",\n  scope: \"auto\",   // \"graph\" | \"session\" | \"trace\" | \"graph_context\" | \"all\"\n});\n```\n\n## Memory operations\n\n### remember\n\nComposite add + cognify with an optional improvement pass.\n\n```ts\nawait c.remember({ type: \"text\", text: \"…\" }, \"my-dataset\", {\n  selfImprovement: true,   // run memify after cognify\n  sessionId: \"session-id\", // session-only mode (no graph writes)\n});\n```\n\n### memify\n\nIndex triplet embeddings from the existing knowledge graph.\nEnables `TripletCompletion` search. Idempotent.\n\n```ts\nawait c.memify();\n```\n\n### improve\n\nRun the four-stage session-graph bridge pipeline.\n\n```ts\nawait c.improve({\n  datasetName: \"my-dataset\",\n  sessionIds: [\"session-uuid\"],\n});\n```\n\n### rememberEntry\n\nStore a typed memory entry (`\"qa\"`, `\"trace\"`, or `\"feedback\"`) in a session.\n\n```ts\nconst result = await c.rememberEntry(\n  { type: \"qa\", question: \"…\", answer: \"…\" },\n  \"my-dataset\",\n  \"session-uuid\",\n  { tenant: \"tenant-id\" }, // optional\n);\n```\n\n## Datasets\n\n```ts\nconst datasets   = await c.datasets.list();\nconst items      = await c.datasets.listData(datasetId);\nconst hasContent = await c.datasets.has(datasetId);\nconst statuses   = await c.datasets.status([id1, id2]);\n\nawait c.datasets.empty(datasetId);\nawait c.datasets.deleteData(datasetId, dataId);\nawait c.datasets.deleteAll();\n```\n\n## Sessions\n\n```ts\nconst entries = await c.sessions.get(\"session-uuid\", { lastN: 10 });\n\nawait c.sessions.addFeedback(\"session-uuid\", \"qa-uuid\", \"Great answer!\", 5);\nawait c.sessions.deleteFeedback(\"session-uuid\", \"qa-uuid\");\n\nconst ctx = await c.sessions.getGraphContext(\"session-uuid\");\nawait c.sessions.setGraphContext(\"session-uuid\", \"new context\");\n```\n\n## Notebooks\n\n```ts\n// List all notebooks for the current user.\nconst notebooks = await c.notebooks.list();\n\n// Create a new notebook with optional cells and deletability flag.\nconst nb = await c.notebooks.create(\"My Notes\", [], true);\n\n// Partially update a notebook (name, cells, or both).\nconst updated = await c.notebooks.update(nb.id, { name: \"Renamed Notes\" });\n\n// Delete a notebook — returns true if a row was removed.\nconst removed = await c.notebooks.delete(nb.id);\n```\n\n## Users and pipeline-run admin\n\n```ts\n// Resolve (or lazily create) the default user for this handle.\nconst user = await c.users.getOrCreateDefault();\n\n// Unblock a dataset stuck in \"running\" state so it can be re-cognified.\nawait c.users.resetPipelineRunStatus(datasetId, \"cognify_pipeline\");\n\n// Reset all pipeline-run statuses for a dataset at once.\nawait c.users.resetDatasetPipelineRunStatus(datasetId);\n```\n\n## Data lifecycle\n\n```ts\n// Forget a single item\nawait c.forget({ kind: \"item\", dataId: \"uuid\", dataset: { name: \"my-dataset\" } });\n\n// Forget an entire dataset\nawait c.forget({ kind: \"dataset\", dataset: { name: \"my-dataset\" } });\n\n// Forget everything\nawait c.forget({ kind: \"all\" });\n\n// Replace a data item (delete → re-add → re-cognify)\nawait c.update(\"old-data-uuid\", { type: \"text\", text: \"updated content\" }, \"my-dataset\");\n\n// Remove all files from storage (metadata DB untouched)\nawait c.pruneData();\n\n// Wipe graph, vector, metadata, and/or cache backends\nawait c.pruneSystem({ pruneGraph: true, pruneVector: true });\n```\n\n## Cloud: serve / disconnect\n\n`serve` and `disconnect` are module-level functions (not instance methods) because\nthey operate on global cloud state.\n\n```ts\nimport { serve, disconnect } from '@cognee/cognee-ts';\n\n// Direct mode (no Auth0 flow; headless-friendly)\nconst { serviceUrl } = await serve({ url: \"http://localhost:8000\", apiKey: \"key\" });\nconsole.log(\"Connected to\", serviceUrl);\n\n// Cloud mode (Auth0 device-code flow — requires a TTY)\nawait serve();\n\n// Tear down\nawait disconnect();\nawait disconnect({ wipeCredentials: true }); // also removes the local credential cache\n```\n\n## Visualisation\n\n```ts\n// Get the HTML string\nconst html = await c.visualize();\n\n// Write to a file (returns the absolute path)\nconst path = await c.visualizeToFile({ destinationPath: \"/tmp/graph.html\" });\n```\n\nRequires the `visualization` feature compiled into the native addon.\n\n## Initialisation and observability\n\n```ts\nimport {\n  init,\n  initWithThreads,\n  shutdown,\n  setupLogging,\n  setupTelemetry,\n  setupTelemetryAnalytics,\n} from '@cognee/cognee-ts';\n\n// Boot the Rust tokio runtime (required before any async op).\ninit();\n\n// Alternatively boot with a fixed worker-thread count.\ninitWithThreads(4);\n\n// Optional: add file logging (reads COGNEE_LOG_*, LOG_FILE_NAME, LOG_LEVEL).\nsetupLogging();\n\n// Optional: enable OTLP trace export (reads OTEL_* env vars).\nsetupTelemetry();\n\n// Optional: enable product-analytics emission (returns true if armed).\nconst armed = setupTelemetryAnalytics();\n\n// Tear the runtime down (e.g. before process exit).\nshutdown();\n```\n\nEach handle also exposes `await c.ownerId()`, returning the owner UUID used for\ndeterministic, per-tenant ID generation.\n\nSet `COGNEE_BINDING_SUPPRESS_LOGS=1` before `require`ing the module to skip the\nauto-installed stderr subscriber if your host manages the logging pipeline.\n\n## Environment variables\n\n| Variable | Purpose |\n|---|---|\n| `OPENAI_URL` | LLM API base URL (OpenAI-compatible endpoint). |\n| `OPENAI_TOKEN` | LLM API key. |\n| `OPENAI_MODEL` | LLM model name (default: `gpt-4o-mini`). |\n| `EMBEDDING_PROVIDER` | Embedding provider: `openai`, `ollama`, `onnx`, `mock`. |\n| `EMBEDDING_MODEL` | Embedding model name. |\n| `EMBEDDING_DIMENSIONS` | Embedding vector dimensions. |\n| `EMBEDDING_ENDPOINT` | Embedding API base URL (falls back to `OPENAI_URL`). |\n| `EMBEDDING_API_KEY` | Embedding API key (falls back to `OPENAI_TOKEN`). |\n| `MOCK_EMBEDDING` | Set `true` to use zero-vector mock embeddings (no model download). |\n| `COGNEE_BINDING_SUPPRESS_LOGS` | Suppress the auto-installed stderr fmt subscriber. |\n| `COGNEE_HOST_SDK` | Suppress binding-armed analytics when the host is an embedding SDK. |\n| `TELEMETRY_DISABLED`, `ENV` | Standard analytics opt-outs for `setupTelemetryAnalytics()`. |\n| `RUST_LOG`, `LOG_LEVEL` | `tracing-subscriber` env-filter level overrides. |\n| `COGNEE_LOG_*`, `LOG_FILE_NAME` | Consumed by `setupLogging()`. |\n| `OTEL_EXPORTER_OTLP_ENDPOINT`, `OTEL_SERVICE_NAME`, `OTEL_*` | Consumed by `setupTelemetry()`. |\n\n---\n\n## Appendix: low-level pipeline API\n\nThe original pipeline engine API is available under the `pipeline` namespace:\n\n```ts\nimport { pipeline, init } from '@cognee/cognee-ts';\n\ninit();\n\nconst task = pipeline.createTask((input: pipeline.CogneeValue, ctx: pipeline.TaskContext) => {\n  // process input …\n  return input;\n});\n\nconst p = new pipeline.Pipeline(\"my pipeline\");\np.addTask(new pipeline.TaskInfo(task));\n\nconst [result] = await p.execute([pipeline.CogneeValue.fromString(\"hello\")], ctx);\n```\n\nAll symbols previously exported from `@cognee/pipeline` are available at the top\nlevel of `@cognee/cognee-ts` for backward compatibility, and also under `pipeline.*`:\n\n```ts\nimport {\n  Pipeline,\n  TaskInfo,\n  createTask,\n  CogneeValue,\n  TaskContext,\n  RunHandle,\n  CancellationHandle,\n  CancellationToken,\n  createCancellationPair,\n  ProgressToken,\n  Watcher,\n  createWatcher,\n  createNoopWatcher,\n} from '@cognee/cognee-ts';\n```\n\n---\n\n## Migration guide\n\nRename the package and update imports:\n\n```diff\n- import { Pipeline } from '@cognee/pipeline';\n+ import { pipeline } from '@cognee/cognee-ts';\n+ const { Pipeline } = pipeline;\n```\n\nOr use the flat re-exports (still supported):\n\n```ts\nimport { Pipeline } from '@cognee/cognee-ts'; // flat legacy export — unchanged\n```\n\n---\n\n## References\n\n- Observability: [docs/observability/opentelemetry.md](../docs/observability/opentelemetry.md), [docs/observability/send_telemetry.md](../docs/observability/send_telemetry.md)\n- Python bindings: [python/README.md](../python/README.md)\n- C API bindings: [capi/README.md](../capi/README.md)\n- cognee-rs workspace: [README.md](../README.md)\n- Source: [cognee-rs](https://github.com/topoteretes/cognee-rs)\n","readmeFilename":"README.md"}