knowledgebase overhaul

This commit is contained in:
overcuriousity
2025-07-20 22:59:08 +02:00
parent e7800724bb
commit e78e738295
21 changed files with 2575 additions and 1582 deletions

View File

@@ -51,6 +51,7 @@ interface ToolsData {
interface CompressedToolsData extends Omit<ToolsData, 'tools'> {
tools: any[];
concepts: any[]; // NEW: Add concepts for AI background knowledge
}
let cachedData: ToolsData | null = null;
@@ -128,21 +129,30 @@ export async function getToolsData(): Promise<ToolsData> {
return cachedRandomizedData;
}
// Get compressed data for AI (removes projectUrl and statusUrl, excludes concepts)
// Get compressed data for AI (excludes concepts from tools, but includes them separately for background knowledge)
export async function getCompressedToolsDataForAI(): Promise<CompressedToolsData> {
if (!cachedCompressedData) {
const data = await getToolsData();
// Filter out concepts and compress remaining tools
// Separate tools and concepts
const compressedTools = data.tools
.filter(tool => tool.type !== 'concept') // Exclude concepts from AI
.filter(tool => tool.type !== 'concept') // Exclude concepts from tool recommendations
.map(tool => {
const { projectUrl, statusUrl, ...compressedTool } = tool;
return compressedTool;
});
// Extract concepts for background knowledge - keep essential fields only
const concepts = data.tools
.filter(tool => tool.type === 'concept')
.map(concept => {
const { projectUrl, statusUrl, platforms, accessType, license, ...compressedConcept } = concept;
return compressedConcept;
});
cachedCompressedData = {
tools: compressedTools,
concepts: concepts,
domains: data.domains,
phases: data.phases,
'domain-agnostic-software': data['domain-agnostic-software']