Skip to content

Feature/rag: Finish vector db, raw course detail fetching and database update - #40

Merged
Spig100 merged 8 commits into
masterfrom
feature/rag
May 26, 2026
Merged

Feature/rag: Finish vector db, raw course detail fetching and database update#40
Spig100 merged 8 commits into
masterfrom
feature/rag

Conversation

@Spig100

@Spig100 Spig100 commented May 26, 2026

Copy link
Copy Markdown
Collaborator

This pull request introduces support for storing detailed course information and enables the use of PostgreSQL's vector extension for future vector-based features. The main changes include new database models and migrations for course details, updates to the Docker database service to include pgvector, and modifications to the data synchronization process to handle the new details.

Database and extension support:

  • Added a new Alembic migration (8d4ef55a141e) to enable the PostgreSQL vector extension, allowing for vector operations in the database. (alembic/versions/8d4ef55a141e_enable_vector_extension.py)
  • Updated the Docker Compose configuration to use the pgvector/pgvector:pg17 image, ensuring the database supports the required extension. (docker-compose.yml)
  • Added the pgvector Python package as a dependency. (pyproject.toml)

Course details feature:

  • Added a new CourseDetail model and established a one-to-one relationship with Course, enabling storage of objectives, content, books, teaching methods, and grading policy. (database/models.py)
  • Created an Alembic migration (cf0848b8624d) to add the course_details table with the necessary fields and constraints. (alembic/versions/cf0848b8624d_add_course_details.py)

Data synchronization:

  • Updated the course synchronization logic to also sync detailed course content by calling a new function, sync_course_details. (internal/course_fetcher.py)

Alembic template improvement:

  • Improved the Alembic migration script template for better type annotations and clarity. (alembic/script.py.mako)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 vector PostgreSQL extension and add pgvector Python dependency.
  • Introduce CourseDetail model + course_details migration.
  • 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.

Comment thread internal/course_fetcher.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Comment thread internal/course_detail_fetcher.py Outdated
Comment thread internal/course_fetcher.py
Comment thread internal/course_detail_fetcher.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated no new comments.

@Spig100
Spig100 merged commit 38f462e into master May 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants