Documents
Documents are the primary content unit used by BindAI Knowledge for working with external information. The Knowledge system provides document abstractions and processing components that can load, process, split, enrich, and prepare external content for retrieval. Documents can ultimately become searchable knowledge that agents can use as context during execution.Documents and BindAI
A document represents external information that an application wants to make available to its Knowledge system. Examples include:- Markdown files
- Text files
- Documentation
- Product manuals
- Knowledge-base content
- Application-generated content
- Structured application data
- Other supported external sources
Document Processing
A Knowledge document can pass through several processing stages.Document Loading
Document loaders are responsible for obtaining content from a source and converting it into Knowledge-compatible document data. Conceptually:Ingestion
Document ingestion prepares source content for use by the Knowledge system. A typical ingestion flow is:Parsing
Parsing converts source content into a form that can be processed as Knowledge. For example:Document Content
A document’s content represents the information that should be made available to downstream Knowledge components. Conceptually:Metadata
Metadata provides additional information about a document. Examples include:Document Chunking
Large documents are normally divided into smaller chunks before retrieval. For example:Why Chunk Documents?
Sending an entire large document to a language model for every question can be inefficient. Chunking allows a retrieval system to select only relevant sections.Chunk Metadata
Chunks can retain metadata from their source document. Conceptually:Embeddings
Documents or document chunks can be transformed into embeddings for vector-based retrieval. The general flow is:Document Retrieval
Once documents have been processed, their chunks can participate in retrieval. A simplified flow is:- Vector retrieval
- BM25 retrieval
- Hybrid retrieval
- Metadata filtering
- Reranking
Vector Document Retrieval
Vector retrieval uses embeddings to find semantically similar document chunks. For example:BM25 Document Retrieval
BM25 provides lexical retrieval based on terms and relevance. It can be useful when exact terminology matters.Hybrid Document Retrieval
Hybrid retrieval combines lexical and semantic retrieval.Metadata Filtering
Metadata can be used to restrict which documents or chunks participate in retrieval. For example:- Tenant isolation
- Document categories
- Versions
- Access scopes
- Content types
Reranking Document Results
Initial retrieval can return multiple candidate chunks. Reranking can then improve their ordering.Documents and Knowledge Pipelines
Documents can be processed through Knowledge pipelines. A typical ingestion pipeline is:Documents and Agents
Processed documents become useful to an agent through Knowledge retrieval. A typical runtime flow is:Documents and Tools
Documents and tools can coexist. Tools are useful when an agent needs to perform an operation such as:- Fetching a live document
- Calling an external document API
- Reading application-specific files
- Performing an external search
- Updating a document system
Documents and Memory
Documents and Memory serve different purposes.
For example:
- A product manual belongs in Knowledge.
- A user’s preferred response format may belong in Memory.
Document Collections
Applications can organize documents into logical collections. For example:Document Updates
Knowledge data may need to be reprocessed when source documents change. A typical update flow is:Document Deletion
When a source document is removed or should no longer be available, its derived knowledge data should also be considered for removal. Conceptually:Supported Sources
BindAI’s Knowledge architecture is designed to work with document loaders and processing components. Supported source types depend on the loaders implemented and configured by the application. Possible source categories include:- Text content
- Markdown
- Structured content
- Application-generated documents
- External content supported by an installed loader
Document Format Strategy
Different source formats may require different processing strategies. For example:Document Quality
Document quality directly affects retrieval quality. Important considerations include:- Clean source content
- Appropriate parsing
- Sensible chunk sizes
- Useful metadata
- Consistent document identifiers
- Appropriate embedding models
- Correct retrieval configuration
Document Security
Documents may contain sensitive information. Applications should consider:- Access control
- Tenant isolation
- Metadata filtering
- Source permissions
- Secure storage
- Credential management
- Retention policies
- Document deletion
Document Pipeline Example
A complete conceptual ingestion process looks like:Best Practices
- Use Knowledge for external or reference information.
- Keep document loading separate from retrieval where practical.
- Choose parsers appropriate to the source format.
- Use chunking strategies appropriate to the document structure.
- Preserve useful source metadata.
- Keep document identifiers stable.
- Use embedding models compatible with the configured retrieval storage.
- Test retrieval using realistic questions.
- Reprocess documents when important source content changes.
- Track document provenance.
- Enforce tenant and access boundaries.
- Do not rely on metadata filtering as the only authorization mechanism.
- Avoid storing unnecessary sensitive information.
- Keep document ingestion reproducible.
- Separate Knowledge retrieval from tools that perform live operations.
Current Project Status
BindAI currently provides a concrete Knowledge layer with document-processing capabilities. The implemented architecture includes:- Document abstractions
- Document loading
- Ingestion pipelines
- Parsing
- Chunking
- Metadata
- Embedding integration
- Retrieval
- BM25 retrieval
- Vector retrieval
- Hybrid retrieval
- Metadata filtering
- Reranking
- Conversational retrieval
- Knowledge pipelines
- Agent Knowledge integration
