---
title: Documents and Nodes | LlamaIndex OSS Documentation
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.

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


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

## API Reference

- [Document](/typescript/framework-api-reference/classes/document/index.md)
- [TextNode](/typescript/framework-api-reference/classes/textnode/index.md)
