Fix CF-271: Add fallback text search to archive_search

When LiteLLM embedding service is unavailable, archive_search now gracefully falls back to PostgreSQL text search (ILIKE) instead of returning an error. Also adds dotenv support for proper credential loading.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-01-19 13:14:29 +02:00
parent 1231835e02
commit 6c497ec6c5
6 changed files with 87 additions and 7 deletions

View File

@@ -9,6 +9,25 @@
* ssh -L 5433:localhost:5432 -i ~/.ssh/hetzner_mash_deploy root@46.224.188.157 -N &
*/
// Load environment variables from .env file
import dotenv from 'dotenv';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const envPath = join(__dirname, '..', '.env');
const result = dotenv.config({ path: envPath, override: true });
// Log environment loading status (goes to MCP server logs)
if (result.error) {
console.error('Failed to load .env from:', envPath, result.error);
} else {
console.error('Loaded .env from:', envPath);
console.error('LLM_API_KEY present:', !!process.env.LLM_API_KEY);
console.error('LLM_API_URL:', process.env.LLM_API_URL);
}
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
import {