liveBook · Manning

Document database

As explained in Natural Language Processing in Action, Second Edition

A data store that organizes and retrieves records represented as documents, typically with flexible schemas.

A document database stores records as documents and exposes a consistent interface for writing, indexing, saving, and retrieving them. In Haystack, documents can be short text lines loaded from a CSV and stored in a vector database. section 10.3.9

A practical document-store workflow combines:

  • A FAISS index that trades search accuracy, speed, RAM, and CPU consumption. section 10.3.9

Indexing text for extractive question answering

Convert CSV lines into Haystack Documents, write them to a FAISSDocumentStore, update their embeddings, and connect the retriever to a reader. Use the default Flat index for recall, or experiment with HNSW when RAM or CPU is constrained.

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains document construction, indexing choices, embeddings, persistence, and pipeline wiring, but not database internals.
Examples
Uses CSV text lines, Haystack Documents, FAISSDocumentStore, and Flat or HNSW indexes.
What it assumes
Assumes basic Python and text data, while demonstrating document objects, indexing, embeddings, and pipeline components.
What you can do after
Operate/configure a Haystack document store and connect it to a retriever-reader question-answering pipeline.
How it connects
Connects document storage with vector databases, embeddings, retrievers, readers, and extractive question answering.

Also explained in

Compare how 3 books explain document database →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.