Feature/rag: Finish vector db, raw course detail fetching and database update - #40
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds infrastructure for storing detailed course information and enables PostgreSQL pgvector support to prepare for future vector-based (RAG) features. The PR introduces a new CourseDetail model with a one-to-one relationship to Course, two Alembic migrations (vector extension + course_details table), switches the Docker DB image to pgvector/pgvector:pg17, and wires a sync_course_details call into the existing course sync flow.
Changes:
- Enable
vectorPostgreSQL extension and addpgvectorPython dependency. - Introduce
CourseDetailmodel +course_detailsmigration. - Hook detailed course content syncing into
sync_courses_to_db.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| alembic/versions/8d4ef55a141e_enable_vector_extension.py | New migration enabling the vector extension. |
| alembic/versions/cf0848b8624d_add_course_details.py | New migration creating the course_details table with FK to courses. |
| alembic/script.py.mako | Updates migration template with typed revision identifiers. |
| database/models.py | Adds CourseDetail model and one-to-one Course.detail relationship. |
| docker-compose.yml | Switches DB image to pgvector/pgvector:pg17. |
| internal/course_fetcher.py | Imports and invokes sync_course_details after extras merge. |
| pyproject.toml | Adds pgvector>=0.3.6 dependency. |
| uv.lock | Renames virtual project and locks pgvector/numpy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pull Request: #40
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…ange Pull Request: #40
This was referenced May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for storing detailed course information and enables the use of PostgreSQL's
vectorextension for future vector-based features. The main changes include new database models and migrations for course details, updates to the Docker database service to includepgvector, and modifications to the data synchronization process to handle the new details.Database and extension support:
8d4ef55a141e) to enable the PostgreSQLvectorextension, allowing for vector operations in the database. (alembic/versions/8d4ef55a141e_enable_vector_extension.py)pgvector/pgvector:pg17image, ensuring the database supports the required extension. (docker-compose.yml)pgvectorPython package as a dependency. (pyproject.toml)Course details feature:
CourseDetailmodel and established a one-to-one relationship withCourse, enabling storage of objectives, content, books, teaching methods, and grading policy. (database/models.py)cf0848b8624d) to add thecourse_detailstable with the necessary fields and constraints. (alembic/versions/cf0848b8624d_add_course_details.py)Data synchronization:
sync_course_details. (internal/course_fetcher.py)Alembic template improvement:
alembic/script.py.mako)