From 06eb97482594c6d0d5d0ca0904b1548b866f1ec6 Mon Sep 17 00:00:00 2001 From: RaymondVerhoef Date: Sun, 17 May 2026 18:20:29 +0200 Subject: [PATCH] feat: add Anthropic API client and knowledge graph extraction pipeline --- src/lib/api.js | 2 +- src/lib/extractionPipeline.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/api.js b/src/lib/api.js index 689bf79..daf22e2 100644 --- a/src/lib/api.js +++ b/src/lib/api.js @@ -33,7 +33,7 @@ export const anthropicApi = { }, body: JSON.stringify({ model: model, - max_tokens: 4000, + max_tokens: 8192, temperature: 0, system: systemPrompt, messages: [{ role: 'user', content: userMessage }] diff --git a/src/lib/extractionPipeline.js b/src/lib/extractionPipeline.js index 0801a62..bb16818 100644 --- a/src/lib/extractionPipeline.js +++ b/src/lib/extractionPipeline.js @@ -4,6 +4,7 @@ import * as db from './db'; const SYSTEM_PROMPT = `You are an AI knowledge extractor for Respellion, an IT company built on radical transparency. You receive a source text. Your task is to extract core concepts, roles, and processes, and return them as a structured JSON Knowledge Graph. Facts should be integrated into the descriptions of the other labels and NOT be extracted as unique topics. +CRITICAL: To ensure the response fits within limits, extract a maximum of 15 key topics and their most important relations. Keep descriptions very concise. ALWAYS return a valid JSON object in the following format: {