Back to Home
sib-swiss icon

sparql-llm

Verified Safe

by sib-swiss

Overview

This project provides tools for Large Language Model (LLM)-powered SPARQL query generation over specific knowledge graphs, including a chat interface for user interaction and a Model Context Protocol (MCP) server for tool exposure.

Installation

Run Command
uv run sparql-llm --http --port 8888

Environment Variables

  • CHAT_API_KEY
  • LOGS_API_KEY
  • OPENAI_API_KEY
  • OPENROUTER_API_KEY
  • LANGFUSE_HOST
  • LANGFUSE_PUBLIC_KEY
  • LANGFUSE_SECRET_KEY
  • VECTORDB_URL
  • SETTINGS_FILEPATH
  • AZURE_INFERENCE_CREDENTIAL
  • AZURE_INFERENCE_ENDPOINT

Security Notes

The system avoids hardcoded secrets by relying on environment variables for API keys. It employs DOMPurify for frontend HTML sanitization. A significant security feature is the automatic validation of generated SPARQL queries against endpoint schemas (VoID descriptions), which helps mitigate SPARQL injection risks. However, the complexity of federated SPARQL queries and the reliance on external VoID descriptions mean that sophisticated or unforeseen query patterns could potentially bypass validation if the schemas are incomplete or flawed. The `httpx` client follows redirects for external SPARQL endpoints, a potential SSRF vector if `endpoint_url` could be maliciously manipulated beyond the configured list.

Similar Servers

Stats

Interest Score45
Security Score8
Cost ClassMedium
Avg Tokens5000
Stars77
Forks11
Last Update2025-11-27

Tags

LLMSPARQLKnowledge GraphChatbotRAG