> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cognee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Legacy Pipeline Operations

> Staged add, cognify, addAndCognify, search, and memify calls for explicit control over the @cognee/cognee-ts pipeline.

Use these lower-level operations when you need explicit staged control over the
pipeline. For most applications, prefer `remember()` and `recall()` from the
[Memory API](/typescript/memory-api).

## add

Ingest one or more data items into a named dataset.

```ts theme={null}
// Text
await c.add({ type: "text", text: "…" }, "my-dataset");

// File
await c.add({ type: "file", path: "/abs/path/to/doc.txt" }, "my-dataset");

// URL
await c.add({ type: "url", url: "https://example.com/article" }, "my-dataset");

// Binary (name is required for MIME detection)
await c.add({ type: "binary", bytes: buffer, name: "report.pdf" }, "my-dataset");

// Multiple items at once
await c.add([
  { type: "text", text: "First document" },
  { type: "file", path: "/abs/path/two.txt" },
], "my-dataset");
```

## cognify

Extract entities and relationships into the knowledge graph.

```ts theme={null}
await c.cognify("my-dataset");

// With options
await c.cognify("my-dataset", {
  chunkSize: 512,
  summarization: true,
  triplet: true,       // also index triplet embeddings (enables TRIPLET_COMPLETION search)
});
```

## addAndCognify

Ingest and extract in a single call.

```ts theme={null}
const { add, cognify } = await c.addAndCognify(
  { type: "text", text: "…" },
  "my-dataset"
);
```

## search

Query the knowledge graph directly. Defaults to `GRAPH_COMPLETION`.

```ts theme={null}
const result = await c.search("What is the capital of France?");

// With options
const result = await c.search("summarise recent events", {
  searchType: "SUMMARIES",
  topK: 5,
  datasets: ["news"],
});
```

All 15 search types are supported (SCREAMING\_SNAKE\_CASE):
`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`.

## memify

Index triplet embeddings from the existing knowledge graph. Enables
`TRIPLET_COMPLETION` search. Idempotent.

```ts theme={null}
await c.memify();
```
