Tool

Load Gitbook documentation into LlamaIndex for RAG

Load and convert content from a GitBook space into LlamaIndex documents.

Works with gitbookllamaindex

72
Spark score
out of 100
Updated 2 days ago
Version 0.14.23

Add to Favorites

Why it matters

Extract and convert documentation content from Gitbook spaces into structured documents that can be indexed and queried by LlamaIndex for retrieval-augmented generation workflows.

Outcomes

What it gets done

01

Connect to Gitbook API using authentication token

02

Fetch all content from a specified Gitbook space by ID

03

Convert Gitbook pages into LlamaIndex document format

04

Attach metadata fields like path, title, description, and parent to documents

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/li-reader-readers-gitbook | bash

Overview

LlamaIndex Readers Integration: Gitbook

A LlamaIndex reader that loads content from a GitBook space via its API and converts it into documents. Use to index a GitBook-hosted documentation space for search or question-answering.

What it does

The Simple Gitbook Reader loads data from a GitBook space, collecting and converting its content into documents usable by LlamaIndex. It gives a straightforward path from a documentation site hosted on GitBook to an indexable set of documents, without a custom scraper.

SimpleGitbookReader is initialized with a GitBook API token, and load_data takes the target space_id plus an optional metadata_names list controlling which fields get attached as document metadata - available options are path, title, description, and parent, letting the resulting documents carry structural context about where each piece of content sits within the GitBook space.

When to use - and when NOT to

Use it when you need to index the contents of a GitBook-hosted documentation space into LlamaIndex - for example to build a search or Q&A system over product docs. Use metadata_names when downstream retrieval or filtering needs to know a document's path, title, description, or parent within the space's structure, not just its text. Do not use it for content outside GitBook; this reader is scoped specifically to a GitBook space via its API.

Capabilities

load_data fetches all content from a given GitBook space ID and converts it into LlamaIndex documents, optionally attaching path, title, description, or parent metadata per document.

How to install

pip install llama-index-readers-gitbook

Requires a GitBook API token.

Who it's for

Developers who maintain documentation on GitBook and want its content indexed into LlamaIndex for search or question-answering, with optional structural metadata preserved.

Source README

LlamaIndex Readers Integration: Gitbook

Overview

Simple Gitbook Reader allows loading data from a gitbook space. It collects & converts contents from gitbook space into documents used by LlamaIndex.

Installation

You can install Gitbook Reader via pip:

pip install llama-index-readers-gitbook

Usage

from llama_index.readers.gitbook import SimpleGitbookReader

### Initialize SimpleGitbookReader
reader = SimpleGitbookReader(
    api_token="<Gitbook API Token>",  # Gitbook API Token
)

### load data from Gitbook
documents = reader.load_data(
    space_id="<Gitbook Space Id>",  # Id of the gitbook space
    metadata_names=None,  # Names of the fields to add to metadata attribute (available: 'path', 'title', 'description', 'parent')
)

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.