feat(impression): add vector index skeleton

This commit is contained in:
2026-05-27 23:27:51 +08:00
parent fe6895d10b
commit a929b3e0e6
2 changed files with 15 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ public class ImpressionCore implements StateSerializable {
* Keyed by entity uuid. Subject can be revised or merged later, so it should not be used as the stable key. * Keyed by entity uuid. Subject can be revised or merged later, so it should not be used as the stable key.
*/ */
private final ConcurrentHashMap<String, Entity> knownEntitiesByUuid = new ConcurrentHashMap<>(); private final ConcurrentHashMap<String, Entity> knownEntitiesByUuid = new ConcurrentHashMap<>();
private final ImpressionVectorIndex vectorIndex = new ImpressionVectorIndex();
@CapabilityMethod @CapabilityMethod
public void updateRelation() { public void updateRelation() {
@@ -66,6 +67,7 @@ public class ImpressionCore implements StateSerializable {
Entity entity = new Entity(uuid, subject); Entity entity = new Entity(uuid, subject);
entity.load(); entity.load();
vectorIndex.sync(entity);
knownEntitiesByUuid.put(uuid, entity); knownEntitiesByUuid.put(uuid, entity);
} }
} }

View File

@@ -0,0 +1,13 @@
package work.slhaf.partner.core.cognition.impression;
public class ImpressionVectorIndex {
public void sync(Entity entity){
// TODO sync entity impressions/features with vector index.
}
public void upsert(String content, Entity.IndexableData indexableData){
// TODO update vector for content when embedding/vector client boundary is finalized.
}
}