Files
ra-h-os/app/api/nodes/[id]/edges/route.ts
T
“BeeRad” 733d1c3407 Initial commit: RA-H Open Source Edition
Local-first knowledge management system with BYO API keys.

Features:
- 3-panel UI (Nodes | Focus | Helpers)
- SQLite + sqlite-vec for vector search
- Agent system (Easy/Hard mode orchestrators)
- Content extraction (YouTube, PDF, web)
- Integrate workflow for connection discovery
- Dimension system with auto-assignment

Tech stack:
- Next.js 15 + TypeScript + Tailwind CSS
- Anthropic (Claude) + OpenAI (GPT) via Vercel AI SDK

Setup:
  npm install && npm rebuild better-sqlite3
  scripts/dev/bootstrap-local.sh
  npm run dev

MIT License
2025-12-15 16:14:28 +11:00

38 lines
1.0 KiB
TypeScript

import { NextRequest, NextResponse } from 'next/server';
import { edgeService } from '@/services/database';
export const runtime = 'nodejs';
export async function GET(
request: NextRequest,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
const nodeId = parseInt(id, 10);
if (isNaN(nodeId)) {
return NextResponse.json({
success: false,
error: 'Invalid node ID'
}, { status: 400 });
}
const connections = await edgeService.getNodeConnections(nodeId);
console.log('[api/nodes/[id]/edges] node', nodeId, 'returned connections:', connections.length);
return NextResponse.json({
success: true,
data: connections,
count: connections.length
});
} catch (error) {
console.error('Error fetching node edges:', error);
return NextResponse.json({
success: false,
error: error instanceof Error ? error.message : 'Failed to fetch node edges'
}, { status: 500 });
}
}