Expand description
Persistence layer for entities, relationships and their junction tables.
The entity graph mirrors the conceptual content of memories: entities
holds nodes, relationships holds typed edges and memory_entities and
memory_relationships connect each memory to the graph slice it emitted.
Structs§
- Entity
Node - Linha de entidade com dados suficientes para exportação/consulta de grafo.
- NewEntity
- Input payload used to upsert a single entity.
- NewRelationship
- Input payload used to upsert a typed relationship between entities.
- Relationship
Row - Estrutura representando uma relação existente.
Functions§
- create_
or_ fetch_ relationship - Cria uma relação se não existir (retorna action=“created”) ou retorna a relação existente (action=“already_exists”) com peso atualizado.
- delete_
entities_ by_ ids - Deleta entidades e seus vetores associados. Retorna o número de entidades removidas.
- delete_
relationship_ by_ id - Remove uma relação pelo id e limpa memory_relationships.
- find_
entity_ id - Busca a entidade por nome e namespace. Retorna o id se existir.
- find_
orphan_ entity_ ids - Localiza entidades órfãs: sem vínculo em memory_entities e sem relações.
- find_
relationship - Busca uma relação específica por (source_id, target_id, relation).
- increment_
degree - knn_
search - link_
memory_ entity - link_
memory_ relationship - list_
entities - Lista entidades, filtrando por namespace se fornecido.
- list_
relationships_ by_ namespace - Lista relações filtradas por namespace (das entidades de origem/destino).
- recalculate_
degree - Recalcula o campo
degreede uma entidade. - upsert_
entity - Upserts an entity and returns its primary key.
- upsert_
entity_ vec - Replaces the vector row for an entity in
vec_entities. - upsert_
relationship - Upserts a typed relationship between two entity ids.