@flowrag/core
v1.8.1
Published
π Core interfaces, types, and schema definition for FlowRAG
Maintainers
Readme
@flowrag/core
Interfaces, schema definition, and types for FlowRAG.
Installation
npm install @flowrag/coreUsage
Schema Definition
import { defineSchema } from '@flowrag/core';
const schema = defineSchema({
entityTypes: ['SERVICE', 'DATABASE', 'PROTOCOL'],
relationTypes: ['USES', 'PRODUCES', 'CONSUMES'],
});
schema.isValidEntityType('SERVICE'); // true
schema.normalizeEntityType('UNKNOWN'); // 'Other'Custom Fields
const schema = defineSchema({
entityTypes: ['SERVICE', 'DATABASE'],
relationTypes: ['USES', 'PRODUCES'],
entityFields: {
status: { type: 'enum', values: ['active', 'deprecated'], default: 'active' },
},
relationFields: {
syncType: { type: 'enum', values: ['sync', 'async'] },
},
});Interfaces
KVStorageβ key-value storage (documents, chunks, cache)VectorStorageβ vector embeddings for semantic searchGraphStorageβ knowledge graph (entities, relations, traversal)Embedderβ text to vector embeddingsLLMExtractorβ entity/relation extraction via LLMRerankerβ post-retrieval result reranking
License
MIT
