pub struct EntityStore { /* private fields */ }Expand description
Store para operaciones con entidades.
Implementations§
Source§impl EntityStore
impl EntityStore
pub fn new(conn: Arc<Mutex<Connection>>) -> Self
Sourcepub fn extract_and_save(&self, memory: &Memory) -> Result<Vec<MemoryEntity>>
pub fn extract_and_save(&self, memory: &Memory) -> Result<Vec<MemoryEntity>>
Extrae y guarda entidades del contenido de una memoria. Usa heurísticas basadas en patrones (no LLM) para extracción inicial.
Sourcepub fn extract_entities_from_text(text: &str) -> Vec<(String, String, f32)>
pub fn extract_entities_from_text(text: &str) -> Vec<(String, String, f32)>
Extrae entidades del contenido de una memoria usando heurísticas. Extrae entidades de un texto plano (sin guardar).
pub fn extract_entities( memory: &Memory, ) -> Vec<(String, EntityType, f32, Option<String>)>
Sourcepub fn save_entities(
&self,
memory_id: Uuid,
entities: &[(String, EntityType, f32, Option<String>)],
) -> Result<Vec<MemoryEntity>>
pub fn save_entities( &self, memory_id: Uuid, entities: &[(String, EntityType, f32, Option<String>)], ) -> Result<Vec<MemoryEntity>>
Guarda entidades en la base de datos.
Sourcepub fn search_entities(
&self,
query: &str,
entity_type: Option<&EntityType>,
limit: u32,
) -> Result<Vec<EntitySearchResult>>
pub fn search_entities( &self, query: &str, entity_type: Option<&EntityType>, limit: u32, ) -> Result<Vec<EntitySearchResult>>
Busca entidades por nombre (parcial).
Sourcepub fn get_memory_entities(&self, memory_id: Uuid) -> Result<Vec<MemoryEntity>>
pub fn get_memory_entities(&self, memory_id: Uuid) -> Result<Vec<MemoryEntity>>
Obtiene todas las entidades de una memoria.
Sourcepub fn get_memory_links(
&self,
memory_id: Uuid,
limit: u32,
) -> Result<Vec<(EntityLink, String)>>
pub fn get_memory_links( &self, memory_id: Uuid, limit: u32, ) -> Result<Vec<(EntityLink, String)>>
Obtiene los entity links de una memoria.
Sourcepub fn frequent_entities(
&self,
project: &str,
limit: u32,
) -> Result<Vec<(String, EntityType, u32)>>
pub fn frequent_entities( &self, project: &str, limit: u32, ) -> Result<Vec<(String, EntityType, u32)>>
Obtiene los nombres de entidad más frecuentes en un proyecto.
Auto Trait Implementations§
impl Freeze for EntityStore
impl RefUnwindSafe for EntityStore
impl Send for EntityStore
impl Sync for EntityStore
impl Unpin for EntityStore
impl UnsafeUnpin for EntityStore
impl UnwindSafe for EntityStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more