Spaces:
Paused
Paused
| import * as dotenv from 'dotenv'; | |
| import * as path from 'path'; | |
| dotenv.config({ path: path.resolve(process.cwd(), 'apps/backend/.env') }); | |
| import { knowledgeAcquisition } from '../services/KnowledgeAcquisitionService.js'; | |
| import { neo4jAdapter } from '../adapters/Neo4jAdapter.js'; | |
| import { getPgVectorStore } from '../platform/vector/PgVectorStoreAdapter.js'; | |
| async function main() { | |
| console.log('π Starting ingestion of Target I01 (Nuuday Design Guide)...'); | |
| try { | |
| // Initialize connections | |
| console.log('π Connecting to databases...'); | |
| const vectorStore = getPgVectorStore(); | |
| await vectorStore.initialize(); | |
| // Run ingestion | |
| const result = await knowledgeAcquisition.acquireSingleTarget('I01'); | |
| if (result && result.success) { | |
| console.log('β Ingestion Successful!'); | |
| console.log('-----------------------------------'); | |
| console.log(`π Source ID: ${result.sourceId}`); | |
| console.log(`π§© Chunks: ${result.chunks}`); | |
| console.log(`π·οΈ Entities: ${result.entitiesExtracted}`); | |
| console.log(`π’ Vectors: ${result.vectorsStored}`); | |
| console.log(`πΈοΈ Graph Nodes: ${result.graphNodesCreated}`); | |
| console.log(`β±οΈ Duration: ${result.duration}ms`); | |
| console.log('-----------------------------------'); | |
| } else { | |
| console.error('β Ingestion Failed'); | |
| if (result) { | |
| console.error('Errors:', result.errors); | |
| } else { | |
| console.error('Target I01 not found in KNOWLEDGE_TARGETS.json'); | |
| } | |
| } | |
| } catch (error) { | |
| console.error('π₯ Fatal Error:', error); | |
| } finally { | |
| // Cleanup | |
| await neo4jAdapter.close(); | |
| process.exit(0); | |
| } | |
| } | |
| main(); | |