Document loaders
Document Store Loader
The Document Store Loader is a node used for loading data from pre-configured document stores. It allows users to retrieve documents or concatenated text from a selected document store.
Node Details
- Name: documentStore
- Type: Document
- Version: 1.0
- Category: Document Loaders
- Base Classes: Document
Input Parameters
- Select Store (selectedStore):
- Type: asyncOptions
- Load Method: listStores
- Description: Allows the user to select from a list of available document stores.
Outputs
-
Document:
- Name: document
- Description: Array of document objects containing metadata and pageContent
- Base Classes: Document, json
-
Text:
- Name: text
- Description: Concatenated string from pageContent of documents
- Base Classes: string, json
Functionality
- The node first retrieves a list of available document stores using the
listStores
method. - Once a store is selected, it fetches all document chunks associated with that store from the database.
- It then processes these chunks into Document objects, including both the page content and metadata.
- Depending on the selected output type, it either:
- Returns an array of Document objects
- Concatenates the page content of all documents into a single string, handling escape characters
Usage
This node is particularly useful for:
- Retrieving pre-processed and stored documents for further analysis or processing
- Accessing document metadata along with content
- Quickly obtaining the full text content of multiple documents in a single string
Technical Details
- Utilizes TypeORM for database interactions
- Implements the INode interface for compatibility with the larger system
- Uses the Document class from LangChain for standardized document handling
- Handles asynchronous operations for database queries and data processing
Note
The node requires a properly configured database connection (appDataSource) and correctly set up database entities to function properly.