Knowledge Base
Documentation for the Knowledge Base Service
Knowledge Base Service
The Knowledge Base Service provides a centralized repository for managing and accessing personal data through files and documents. This service enables document storage, retrieval, and management while integrating with the AI backend for intelligent search capabilities.
Architecture Overview
The Knowledge Base Service is built on a Node.js backend with ArangoDB for graph-based data persistence. The service consists of several key components:
- Record Management - Core document storage and metadata handling
- File Storage Integration - Connects with external storage services
- Event Broadcasting - Kafka-based events for system integration
- AI Indexing - Automatic content indexing for search capabilities
The service integrates with these components:
- Storage Service - Handles actual file storage and versioning
- AI Backend - Processes and indexes content for search
- Enterprise Search - Provides search capabilities across the knowledge base
- IAM Service - Handles user authentication and authorization
- Configuration Manager - Manages application settings
Data Models
Records
Records represent the core entities in the knowledge base:
- Metadata about stored content (name, type, source)
- References to physical files in storage
- Versioning information
- Indexing status and history
File Records
File Records contain file-specific metadata:
- File format information (extension, MIME type)
- Size and storage information
- Access URLs and paths
- Checksum and integrity information
Knowledge Base
Knowledge Base represents a collection of records:
- Organizational grouping of records
- Permission structure
- Metadata about the collection
Record API
The Record API enables management of documents and files in the knowledge base.
Create Records
Upload and create new records in the knowledge base.
Get Records
Retrieve all records in the knowledge base with filtering and pagination.
Get Record By ID
Retrieve a specific record by its ID.
Update Record
Update a record with new data or file content.
Delete Record
Soft-delete a record by setting its deleted flag.
Archive Record
Archive a record to move it to archived state.
Unarchive Record
Restore a record from archived state.
Stream Record Content
Stream the actual file content of a record.
Reindex Record
Force reindexing of a record by the AI backend.
Event System
The Knowledge Base Service broadcasts events through Kafka to notify other services about record changes. These events trigger actions like content indexing, search updates, and audit logging.
Event Types
Event Type | Description |
---|---|
newRecord | Triggered when a new record is created |
updateRecord | Triggered when a record is updated |
deletedRecord | Triggered when a record is deleted |
reindexRecord | Triggered when a record needs reindexing |
Event Payload Structure
New Record Event
Update Record Event
Deleted Record Event
Integration with AI Indexing
When a record is created or updated, the Knowledge Base Service:
- Stores the file metadata in ArangoDB
- Uploads the file content to the Storage Service
- Publishes a Kafka event with the file metadata and download URL
- The AI Backend consumes these events and:
- Downloads the file content
- Extracts text and structured data
- Processes the content for search indexing
- Updates the indexing status in the Knowledge Base
This integration enables Enterprise Search to provide intelligent search capabilities across the entire knowledge base.