CineGraph
A movie assistant for factual questions, film recommendations and image retrieval.
Overview
CineGraph is a movie assistant built for the University of Zurich AI Core curriculum. It uses a local RDF knowledge graph to connect films with people, genres and other attributes, so one agent can answer factual questions, recommend films and retrieve images.
Developed with Leyla Khasiyeva.
What I built
- Entity and relation resolution that maps names and wording to graph labels and canonical relations.
- SPARQL queries over the local graph, with a TransE embedding fallback when no graph answer is found.
- A recommender that scores films with weighted Jaccard over metadata, optionally blended with embedding similarity.
- Image retrieval for posters, portraits and scenes, answered through a command line interface or Speakeasy.
CLI / Speakeasy message
agent.py · interactive_agent.py
main.py: CLI without embeddings
Responser.generate_response()
Label maps → image intent first → other request routing
Person / company / language rewrites can select the factual branch.
↓ One route per request
Images
- Entity + person / film type
- IMDb ID → image map
- Poster, portrait or scene
- Speakeasy image token
Local inputsRDF graph · images.json
Recommendations
- Metadata: Weighted Jaccard
- Optional embedding cosine similarity
- Constraints → ranked film titles
- No seeds: theme matching
Local inputsGraph · ratings · entity vectors
Factual questions
- Entity + relation → SPARQL
- Graph answer → return directly
↓ No answer, and vectors loaded?
TransE fallback
Head + relation → nearest entity
Entity + relation vectors
Local inputsLocal RDF graph + label maps
↓ Route returns its result
Return to CLI / Speakeasy
- Formatted answer
- Ranked titles
- Image token
- Explanatory message
Request flow from core/responser.py; the three routes are alternative paths, not consecutive stages.
Results
- Three request routes in one agent: factual questions, recommendations and images.
- Evaluation checks cover SPARQL prompts with expected answers, plus regex and robustness scripts for media, rate limiting, concurrency and timeouts.
- A 6-page evaluation report (8 December 2025) documents the implemented routes and worked examples.
Limits
- The checks are focused scripts, not a full agent benchmark.