Document Stores
Document stores contain ingested document chunks, i.e. Nodes.
Available Document Stores
Section titled “Available Document Stores”- SimpleDocumentStore: A simple in-memory document store with support for persisting data to disk.
- PostgresDocumentStore: A PostgreSQL document store, see PostgreSQL Storage.
Check the LlamaIndexTS Github for the most up to date overview of integrations.
Using PostgreSQL as Document Store
Section titled “Using PostgreSQL as Document Store”npm i llamaindex @llamaindex/postgres
You can configure the schemaName
, tableName
, namespace
, and
connectionString
. If a connectionString
is not
provided, it will use the environment variables PGHOST
, PGUSER
,
PGPASSWORD
, PGDATABASE
and PGPORT
.
import { Document, VectorStoreIndex, storageContextFromDefaults } from "llamaindex";import { PostgresDocumentStore } from "@llamaindex/postgres";
const storageContext = await storageContextFromDefaults({ docStore: new PostgresDocumentStore(),});