Implement semantic embeddings and duplicate review

This commit is contained in:
2026-07-19 18:06:47 +02:00
parent fd4fd744e0
commit e8764262a3
42 changed files with 3808 additions and 79 deletions

View File

@@ -0,0 +1,50 @@
use serde::{Deserialize, Serialize};
#[derive(
Debug,
Clone,
PartialEq,
Serialize,
Deserialize,
diesel::Queryable,
diesel::Selectable,
diesel::Insertable,
diesel::AsChangeset,
)]
#[diesel(
table_name = crate::db::schema::embedding_keys,
check_for_backend(diesel::sqlite::Sqlite),
treat_none_as_default_value = false
)]
pub struct EmbeddingKey {
pub label: i64,
pub post_id: String,
pub project_id: String,
pub content_hash: String,
pub vector: Vec<u8>,
}
#[derive(
Debug,
Clone,
PartialEq,
Eq,
Serialize,
Deserialize,
diesel::Queryable,
diesel::Selectable,
diesel::Insertable,
diesel::AsChangeset,
)]
#[diesel(
table_name = crate::db::schema::dismissed_duplicate_pairs,
check_for_backend(diesel::sqlite::Sqlite),
treat_none_as_default_value = false
)]
pub struct DismissedDuplicatePair {
pub id: String,
pub project_id: String,
pub post_id_a: String,
pub post_id_b: String,
pub dismissed_at: i64,
}

View File

@@ -1,4 +1,5 @@
mod chat;
mod embedding;
mod event;
mod generation;
mod import;
@@ -12,6 +13,7 @@ mod tag;
mod template;
pub use chat::{ChatConversation, ChatMessage, ChatRole, NewChatConversation, NewChatMessage};
pub use embedding::{DismissedDuplicatePair, EmbeddingKey};
pub use event::DomainEvent;
pub use generation::{
DbNotification, DomainEntity, GeneratedFileHash, NotificationAction, NotificationEntity,