The interesting part is not the subject matter — it is that writes are validated at the edge, relationships are readable from both directions, and search is delegated to Postgres full-text indexing rather than reimplemented. If you are looking for a template for putting your own relational data behind an assistant, this is a more complete one than most.
A Go server over a Postgres movie database. Movies and actors are full records with validation, they can be linked to each other, and the search tools go beyond title matching into decades, rating ranges and similarity.
- add_movie, get_movie, update_movie and delete_movie, with year and rating bounds enforced on write
- add_actor, get_actor, update_actor and delete_actor
- search_movies across title, director, genre, year range and rating range in one call
- search_by_decade and search_by_rating_range for the questions people actually ask
- search_similar_movies for finding the next thing to watch
- search_actors by name, and list_top_movies for the ranked list
- link_actor_to_movie and unlink_actor_from_movie to maintain the cast
- get_movie_cast and get_actor_movies — the relationship read from either end
- movies://database/all and movies://database/stats as resources, plus the poster collection
PostgreSQL and Go — the database connection comes from DB_HOST, DB_PORT, DB_NAME, DB_USER and DB_PASSWORD, or a single DATABASE_URL. A Docker-based setup is provided if you would rather not install Postgres yourself. Full-text search relies on Postgres indexes, so the database does the work rather than the server.
