AniOntology AI: Ontology-Driven Anime Knowledge Graph with Explainable Recommendations

Knowledge Graph NLP Recommendation System Full Stack Ontology (OWL/RDF)
Architecture
AniOntology ingestion, graph, and serving architecture diagram
Recommendation Engine & Graph Explorer
Cytoscape.js knowledge graph explorer demo
View on GitHub Try the Live Demo

AniOntology AI models the anime ecosystem as a semantic knowledge graph. Metadata from AniList, MAL, Jikan, and AnimeThemes is ingested and loaded into Neo4j, then formalised into a proper OWL/RDF ontology — a TBox class hierarchy (Anime ⊆ CreativeWork, emotion/genre taxonomies) plus an ABox builder that serialises instance assertions from the graph into Turtle, so the dataset can be reasoned over with standard semantic web tooling (SPARQL, Protégé, OWL reasoners) rather than just queried.

On top of the graph, all-MiniLM-L6-v2 sentence embeddings and HuggingFace sentiment/emotion models (distilbert-sst2 + a 6-emotion classifier) derive EVOKES_EMOTION edges from review text. A FastAPI backend exposes 20 endpoints — search, analytics, ontology introspection, and recommendations — consumed by a Next.js 16 frontend with six pages, including a Cytoscape.js graph explorer for visually navigating the knowledge graph and a "Why?" panel that explains each recommendation.

The recommendation engine implements five Netflix-inspired techniques: multi-signal graph traversal scoring (genre/studio/voice-actor/tag/emotion overlap), vector similarity over the 384-dim embeddings via Neo4j's native vector index, hybrid scoring that blends both with a sentiment quality boost and popularity penalty, MMR diversity reranking to reduce genre repetition, and multi-seed session-aware fusion across up to 10 seed anime.

Deployed at scale on free tiers: ~3,370 anime, 122,615 SIMILAR_TO edges precomputed at a 0.65 genre-Jaccard threshold — deliberately stricter than the code default of 0.25 (which would produce ~1.1M edges) to stay under Neo4j AuraDB Free's 400,000-relationship cap, leaving comfortable headroom for the ~75k structural and ~1k emotion edges. Backend on Hugging Face Spaces (Docker), frontend on GitHub Pages.
Built with
Neo4j OWL/RDF (RDFLib) FastAPI Next.js 16 TypeScript Tailwind CSS Cytoscape.js Recharts SentenceTransformers HuggingFace Transformers Docker Hugging Face Spaces GitHub Pages

Five-technique recommendation engine (graph scoring, vector similarity, hybrid, MMR diversity, multi-seed fusion) with a live explainability panel surfacing the shared genres, studios, voice actors, and tags behind every recommendation.