---
title: Documents and Nodes
description: Data structure for storing data in LlamaIndex
---

`Document`s and `Node`s are the basic building blocks of data in LlamaIndexTS. While the API for these objects is similar, `Document` objects represent entire files, while `Node`s are smaller pieces of that original document, that are suitable for an LLM and Q&A.

```typescript
import { Document } from "llamaindex";

document = new Document({ text: "text", metadata: { key: "val" } });
```

## API Reference

- [Document](/docs/api/classes/Document)
- [TextNode](/docs/api/classes/TextNode)
