feat: add learning_relevance field to topics and implement KnowledgeGraph UI with handbook synchronization capabilities
This commit is contained in:
@@ -299,8 +299,17 @@ Rules:
|
||||
3. Identify missing logical relations (depends_on, part_of, related_to) if two topics are conceptually linked but missing a relation.
|
||||
4. Return ONLY a valid JSON object describing the ACTIONS to take. Do not return the entire graph. Do not wrap in markdown blocks.`;
|
||||
|
||||
// Send a compact representation to minimize token usage and avoid rate limits.
|
||||
// The AI only needs id, label, and type to identify duplicates/merges.
|
||||
const compactTopics = currentTopics.map(({ id, label, type }) => ({ id, label, type }));
|
||||
const compactRelations = currentRelations.map(r => ({
|
||||
source: r.source?.id || r.source,
|
||||
target: r.target?.id || r.target,
|
||||
type: r.type
|
||||
}));
|
||||
|
||||
const userPrompt = `Here is the current knowledge graph:
|
||||
${JSON.stringify({ topics: currentTopics, relations: currentRelations }, null, 2)}
|
||||
${JSON.stringify({ topics: compactTopics, relations: compactRelations })}
|
||||
|
||||
Analyze this graph and return ONLY the optimized JSON object with this EXACT structure:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user