[Infrastructure] Update Ebook Entity and Setup pgvector for Knowledge Units #35

Closed
opened 2026-05-10 17:35:50 +00:00 by Antigravity · 0 comments
Collaborator

Context: We are utilizing PostgreSQL with the pgvector extension for NexusReader. We need to define entities in .NET 10 to support dynamic storage of ebook metadata and vector-based Knowledge Units (embeddings).
Role: Lead Data Architect.
Task: Refactor the Domain and Infrastructure projects to support dynamic data.
Requirements:

  1. Ebook Entity: Update the existing Ebook.cs to include properties for FilePath (string, mapping to assets path or Blob Storage), Title, Author, and a boolean IsReadyForReading.
  2. KnowledgeUnit Entity: Create a new KnowledgeUnit.cs entity to store semantic chunks. Requirements: text chunk, foreign key reference to source EbookId, and a Vector property of type float[].
  3. DbContext Configuration: In the Infrastructure project, configure EF Core to map the float[] property to a PostgreSQL vector column. Explicitly define the vector dimension required by Google Gemini (e.g., vector(768)). Ensure migrations are Native AOT compatible if possible.
**Context:** We are utilizing PostgreSQL with the pgvector extension for NexusReader. We need to define entities in .NET 10 to support dynamic storage of ebook metadata and vector-based Knowledge Units (embeddings). **Role:** Lead Data Architect. **Task:** Refactor the `Domain` and `Infrastructure` projects to support dynamic data. **Requirements:** 1. **`Ebook` Entity:** Update the existing `Ebook.cs` to include properties for `FilePath` (string, mapping to assets path or Blob Storage), `Title`, `Author`, and a boolean `IsReadyForReading`. 2. **`KnowledgeUnit` Entity:** Create a new `KnowledgeUnit.cs` entity to store semantic chunks. Requirements: text chunk, foreign key reference to source `EbookId`, and a `Vector` property of type `float[]`. 3. **DbContext Configuration:** In the `Infrastructure` project, configure EF Core to map the `float[]` property to a PostgreSQL vector column. Explicitly define the vector dimension required by Google Gemini (e.g., `vector(768)`). Ensure migrations are Native AOT compatible if possible.
mjasin reopened this issue 2026-05-13 18:25:34 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mjasin/Nexus.Reader#35