This document provides detailed guidance on customizing and extending Qwello to meet specific organizational needs, covering custom entity types, relationship types, external system integration, API usage, and plugin development.
Custom Entity Types
Qwello's knowledge graph system supports the creation of custom entity types to represent domain-specific concepts and objects.
Entity Type Definition
Custom entity types are defined through configuration files that specify their properties and behaviors:
Custom relationship types must be registered with the system:
// relationship-type-registry.ts
import { RelationshipTypeRegistry } from '@qwello/core';
import customRelationshipTypes from './custom-relationship-types.json';
export function registerCustomRelationshipTypes() {
const registry = RelationshipTypeRegistry.getInstance();
for (const relType of customRelationshipTypes.relationshipTypes) {
registry.register(relType);
}
console.log(`Registered ${customRelationshipTypes.relationshipTypes.length} custom relationship types`);
}
Relationship Type Usage
Custom relationship types can be used to connect entities:
// Example of creating a relationship with a custom type
const manufacturingRelationship = {
source: 'org123', // ID of an organization entity
target: 'prod456', // ID of a product entity
type: 'manufactures',
attributes: {
since: '2020-03-15',
facility: 'Frankfurt Plant'
}
};
// Example of querying relationships by custom type
const manufacturingRelationships = await knowledgeGraphService.findRelationships({
type: 'manufactures',
attributes: {
facility: 'Frankfurt Plant'
}
});
Integration with External Systems
Qwello can be integrated with external systems to exchange data and enhance functionality.
Integration Architecture
The integration architecture supports various integration patterns:
graph TD
A[Qwello] --> B[Integration Layer]
B --> C[REST API Connectors]
B --> D[Webhook Handlers]
B --> E[Message Queue Connectors]
B --> F[File-Based Integrations]
C --> G[External REST APIs]
D --> H[Webhook Consumers]
E --> I[Message Queues]
F --> J[File Systems/Storage]
// Example of document management API usage
const apiClient = new QwelloApiClient('https://api.qwello.example.com', 'your-api-key');
// Upload a document
const uploadResponse = await apiClient.post('documents/upload', {
file: fileBuffer, // Base64 encoded file content
filename: 'strategic-plan-2025.pdf',
metadata: {
title: 'Strategic Plan 2025',
author: 'Executive Team',
department: 'Strategy',
tags: ['strategy', 'planning', '2025']
}
});
const documentId = uploadResponse.id;
// Get document status
const documentStatus = await apiClient.get(`documents/${documentId}/status`);
// Get document knowledge graph
const knowledgeGraph = await apiClient.get(`documents/${documentId}/knowledge-graph`);
Knowledge Graph API
Interact with knowledge graphs through the API:
// Example of knowledge graph API usage
const apiClient = new QwelloApiClient('https://api.qwello.example.com', 'your-api-key');
// Get all entities of a specific type
const products = await apiClient.get('knowledge-graph/entities?type=product');
// Get entity by ID
const entity = await apiClient.get(`knowledge-graph/entities/${entityId}`);
// Create a new entity
const newEntity = await apiClient.post('knowledge-graph/entities', {
type: 'product',
name: 'New Product Line',
attributes: {
productId: 'NPL-2025',
category: 'Hardware',
price: 299.99
}
});
// Create a relationship
const newRelationship = await apiClient.post('knowledge-graph/relationships', {
source: organizationId,
target: newEntity.id,
type: 'manufactures',
attributes: {
since: '2025-01-01',
facility: 'Main Plant'
}
});
Plugin Development
Qwello supports plugins to extend functionality and integrate with external systems.
Plugin Architecture
The plugin architecture follows a modular design:
graph TD
A[Qwello Core] --> B[Plugin Manager]
B --> C[Plugin Registry]
C --> D[Plugin 1]
C --> E[Plugin 2]
C --> F[Plugin 3]
D --> G[Plugin API]
E --> G
F --> G
G --> H[Qwello Services]
When customizing and extending Qwello, follow these best practices to ensure maintainability, performance, and compatibility:
Entity Type Design
Consistent Naming: Use clear, consistent naming conventions for entity types and attributes
Attribute Planning: Define attributes carefully, considering search and filtering needs
Color Coding: Choose visually distinct colors for different entity types
Icon Selection: Select meaningful icons that represent the entity concept
Documentation: Document the purpose and usage of custom entity types
Integration Development
Error Handling: Implement robust error handling for all external integrations
Retry Logic: Add retry mechanisms for transient failures
Circuit Breaking: Implement circuit breakers to prevent cascading failures
Logging: Include comprehensive logging for troubleshooting
Security: Follow security best practices for authentication and data protection
Plugin Development
Isolation: Ensure plugins operate in isolation without interfering with each other
Performance: Optimize plugin performance to minimize impact on the core system
Versioning: Maintain compatibility with the Qwello API version
Testing: Thoroughly test plugins across different scenarios
Documentation: Provide clear documentation for plugin installation and usage
By following these guidelines and leveraging Qwello's extensibility features, organizations can customize the platform to meet their specific needs while maintaining a robust and maintainable implementation.