OxiRS Chat
AI-powered conversational interface for RDF knowledge graphs with RAG and natural language to SPARQL
Overview
oxirs-chat provides an intelligent conversational interface for querying and
exploring RDF datasets. It combines Large Language Models (LLMs) with
Retrieval-Augmented Generation (RAG) to enable natural language queries over
semantic data, automatic SPARQL generation, and contextual explanations.
Key capabilities:
- Natural Language to SPARQL — Convert plain-English questions to SPARQL.
- RAG Integration — Retrieve relevant triples from the knowledge graph and pass them as context to the LLM.
- Multi-provider LLM — OpenAI and Anthropic out of the box; local providers configurable.
- Streaming responses — Word-by-word output via a channel-based API.
- Session persistence — Save and restore conversation sessions as JSON.
- Circuit breakers — Automatic fallback across LLM providers on failure.
- Schema introspection — Discover the RDF schema automatically to improve NL2SPARQL accuracy.
- Consciousness-inspired retrieval — Optional quantum-enhanced and consciousness-aware context assembly.
Installation
[]
= "0.3.1"
= "0.3.1"
= { = "1", = ["full"] }
= "1"
Optional features:
| Feature | Description |
|---|---|
llm-integration |
Enable extra LLM integration hooks |
nl2sparql |
Enable the NL-to-SPARQL subsystem |
excel-export |
Enable Excel (.xlsx) export of query results |
Quick Start
use ;
use ConcreteStore;
use Arc;
async
Documentation
| Document | Description |
|---|---|
| docs/tutorial.md | Step-by-step user guide: sessions, queries, LLM providers, retrieval depth, persistence |
| docs/admin.md | Deployment guide: topology, environment variables, logging, observability |
| API reference | Full rustdoc |
Examples
| Example | Description |
|---|---|
examples/kg_chat.rs |
Chat over a populated RDF dataset; demonstrates session + NL2SPARQL |
examples/rag_chat.rs |
Direct RAG engine retrieval + full pipeline via OxiRSChat |
examples/chat_advanced_features_demo.rs |
Collaboration, schema discovery, circuit breakers |
examples/streaming_demo.rs |
Word-by-word streaming response with progress stages |
Run any example with:
OPENAI_API_KEY=sk-...
Configuration Reference
ChatConfig (session)
use ChatConfig;
let config = ChatConfig ;
LLM provider selection
use ;
use ConcreteStore;
use Arc;
# async
RAG retrieval depth
use ;
let rag_config = RagConfig ;
Session Persistence
use ;
use ConcreteStore;
use Arc;
# async
Streaming Responses
use ;
use ConcreteStore;
use Arc;
# async
Environment Variables
| Variable | Description |
|---|---|
OPENAI_API_KEY |
OpenAI API key (provider disabled when absent) |
ANTHROPIC_API_KEY |
Anthropic API key (provider disabled when absent) |
RUST_LOG |
Log filter (e.g. info,oxirs_chat::rag=debug) |
Related Crates
oxirs-core— RDF data model and storeoxirs-vec— Vector search and HNSW indexesoxirs-embed— Knowledge graph embedding modelsoxirs-arq— SPARQL query engineoxirs-fuseki— SPARQL HTTP server
License
Apache-2.0 — see LICENSE-APACHE.
OxiRS Chat v0.3.1 — AI-powered conversational RDF interface by COOLJAPAN OU (Team Kitasan)