Files
HCFS/n8n-context-relevancy-curator.json
Claude Code 0a92dc3432 Complete HCFS Phase 2: Production API & Multi-Language SDK Ecosystem
Major Phase 2 Achievements:
 Enterprise-grade FastAPI server with comprehensive middleware
 JWT and API key authentication systems
 Comprehensive Python SDK (sync/async) with advanced features
 Multi-language SDK ecosystem (JavaScript/TypeScript, Go, Rust, Java, C#)
 OpenAPI/Swagger documentation with PDF generation
 WebSocket streaming and real-time updates
 Advanced caching systems (LRU, LFU, FIFO, TTL)
 Comprehensive error handling hierarchies
 Batch operations and high-throughput processing

SDK Features Implemented:
- Promise-based JavaScript/TypeScript with full type safety
- Context-aware Go SDK with goroutine safety
- Memory-safe Rust SDK with async/await
- Reactive Java SDK with RxJava integration
- .NET 6+ C# SDK with dependency injection support
- Consistent API design across all languages
- Production-ready error handling and caching

Documentation & Testing:
- Complete OpenAPI specification with interactive docs
- Professional Sphinx documentation with ReadTheDocs styling
- LaTeX-generated PDF manuals
- Comprehensive functional testing across all SDKs
- Performance validation and benchmarking

Project Status: PRODUCTION-READY
- 2 major phases completed on schedule
- 5 programming languages with full feature parity
- Enterprise features: authentication, caching, streaming, monitoring
- Ready for deployment, academic publication, and commercial licensing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 14:07:45 +10:00

196 lines
5.7 KiB
JSON

{
"name": "Context Curator",
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "context-curator",
"responseMode": "onReceived",
"options": {}
},
"name": "Bzzz Webhook",
"type": "n8n-nodes-base.webhook",
"typeVersion": 1,
"position": [250, 300]
},
{
"parameters": {
"functionCode": "const path = $json[\"path\"] || \"\";\n\n// Simple deterministic rules (expand later)\nconst rules = [\n { pattern: /node_modules/, decision: { relevance: \"exclude\", reason: \"node_modules irrelevant\" } },\n { pattern: /.*\\.log$/, decision: { relevance: \"exclude\", reason: \"log file\" } },\n { pattern: /.*\\.css$/, decision: { relevance: \"include\", roles: [\"frontend\"], reason: \"CSS → frontend\" } },\n { pattern: /.*\\.sql$/, decision: { relevance: \"include\", roles: [\"backend\"], reason: \"SQL → backend\" } }\n];\n\n// Look for match\nlet match = null;\nfor (const rule of rules) {\n if (rule.pattern.test(path)) {\n match = rule.decision;\n break;\n }\n}\n\nreturn [{ json: { matched: !!match, decision: match, path } }];"
},
"name": "Deterministic Rules",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [500, 300]
},
{
"parameters": {
"conditions": {
"boolean": [],
"number": [],
"string": [
{
"value1": "={{$json[\"matched\"]}}",
"operation": "isEqual",
"value2": "true"
}
]
}
},
"name": "Matched?",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [750, 300]
},
{
"parameters": {
"functionCode": "return [{ json: {\n action: \"context_rule.add\",\n rule: {\n target: $json.path,\n condition: { role: $json.decision?.roles || [] },\n action: {\n relevance: $json.decision?.relevance || \"exclude\",\n scope: \"local\"\n },\n metadata: {\n reason: $json.decision?.reason || \"Deterministic rule match\"\n }\n }\n} }];"
},
"name": "Build Decision (Deterministic)",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [1000, 200]
},
{
"parameters": {
"functionCode": "return [{ json: {\n prompt: `You are the Context Curator for a multi-agent AI system. Analyze this discovery and decide which agent roles it is relevant to, whether to include, exclude, or escalate, and draft a Context Rule DSL snippet.\\n\\nPath: ${$json.path}\\n\\nMetadata: ${JSON.stringify($json.metadata || {})}`\n} }];"
},
"name": "Build Model Prompt",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [1000, 400]
},
{
"parameters": {
"resource": "chat",
"operation": "create",
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": "You are the Context Curator for a multi-agent system. Decide on relevance, roles, and generate a Context Rule JSON."
},
{
"role": "user",
"content": "={{$json[\"prompt\"]}}"
}
]
},
"name": "Call Curator Model",
"type": "n8n-nodes-openai.chat",
"typeVersion": 1,
"position": [1250, 400],
"credentials": {
"openAIApi": "OpenAI API"
}
},
{
"parameters": {
"functionCode": "// Parse model response (assume model replies with JSON rule)\nlet rule;\ntry {\n rule = JSON.parse($json.choices[0].message.content);\n} catch (e) {\n rule = { error: \"Model response parse error\", raw: $json };\n}\n\nreturn [{ json: { action: \"context_rule.add\", rule } }];"
},
"name": "Parse Model Output",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [1500, 400]
},
{
"parameters": {
"url": "http://hive.local/api/context",
"method": "POST",
"jsonParameters": true,
"options": {},
"body": "={{$json}}"
},
"name": "Send Decision to Hive",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [1750, 300]
}
],
"connections": {
"Bzzz Webhook": {
"main": [
[
{
"node": "Deterministic Rules",
"type": "main",
"index": 0
}
]
]
},
"Deterministic Rules": {
"main": [
[
{
"node": "Matched?",
"type": "main",
"index": 0
}
]
]
},
"Matched?": {
"main": [
[
{
"node": "Build Decision (Deterministic)",
"type": "main",
"index": 0
}
],
[
{
"node": "Build Model Prompt",
"type": "main",
"index": 0
}
]
]
},
"Build Decision (Deterministic)": {
"main": [
[
{
"node": "Send Decision to Hive",
"type": "main",
"index": 0
}
]
]
},
"Build Model Prompt": {
"main": [
[
{
"node": "Call Curator Model",
"type": "main",
"index": 0
}
]
]
},
"Call Curator Model": {
"main": [
[
{
"node": "Parse Model Output",
"type": "main",
"index": 0
}
]
]
},
"Parse Model Output": {
"main": [
[
{
"node": "Send Decision to Hive",
"type": "main",
"index": 0
}
]
]
}
}
}