HippoAgent — entity-first recall (hippo_entity_get)
Quando l'utente chiede "che sai di X?" / "ricordami chi è Y?" /
"dammi tutto su Z", chiama hippo_entity_get(name=<X>) PRIMA di
rispondere da memoria interna. Il tool ritorna l'entity canonica
(risolvendo eventuali alias) + la lista di fact collegati, da un
knowledge graph SQLite persistente.
⚠️ Quando ATTIVARE (trigger)
Pattern lessicali che attivano il skill:
- Italiano: "che sai di X", "cosa ricordi di Y", "dammi tutto
su Z", "chi è W", "ricostruisci ciò che sappiamo di V",
"abbiamo discusso di U", "informazioni su T", "storia di S".
- English: "what do you know about X", "tell me about Y",
"facts about Z", "who is W", "history of V", "what have we said
about U", "summarize what we know on T".
- Implicito: l'utente menziona un nome Capitalized (persona,
paper, repo, progetto interno) e ti aspetti che ne sappia qualcosa.
Risoluzione automatica alias: lookup di "S. Tonegawa" trova
l'entity canonica "Tonegawa" se è stato registrato l'alias.
Case + Unicode-safe: "müller", "MÜLLER", "Müller" trovano
tutti la stessa entity. Anche NFC vs NFD (unicodedata.normalize
forma decomposta vs composta) sono trattati come uguali.
NON serve per:
- Claim factual da validare ("X is Y") →
hippo_validate_claim
- Ricerca su episodi/dialoghi su un topic →
hippo_search,
hippo_recall
- Ricerca su fact per topic-namespace →
hippo_facts_search,
hippo_facts_list
- Saluti, chat casuale, opinioni
Flow
1. Identifica il nome dell'entity nella domanda (Capitalized,
eventualmente con prefisso "S." / "Dr." / titolo).
2. hippo_entity_get(name="<entity>")
3. Read payload:
{
"entity": { "id": "...", "canonical_name": "...", "type": "..." }
| None,
"aliases": ["...", "..."],
"facts": ["fact_id_1", "fact_id_2", ...]
}
4. Act:
┌─ entity is None → "Non ho memoria di <name> nel KG. Vuoi
│ che cerchi episodi correlati?
│ (`hippo_search`)"
├─ entity, facts == [] → "Ho il nodo <canonical_name> (id=...,
│ type=...) ma nessun fatto direttamente
│ linkato. Posso cercare con
│ `hippo_facts_search` o `hippo_recall`."
└─ entity, facts ≠ [] → Leggi i fact con `hippo_facts_list`
(passando i fact_id ottenuti) per
ricostruire la conoscenza completa,
poi rispondi citando i fact_id come
evidenza.
Output semantics
| campo |
tipo |
semantica |
entity |
dict | None |
None = entity sconosciuta. Dict = {id, canonical_name, type} |
entity.id |
str |
UUID 12-char, primary key SQLite, usalo per hippo_entity_link (futuro P2.a addendum) |
entity.canonical_name |
str |
Nome canonico (la forma "ufficiale", es. "Tonegawa") |
entity.type |
str |
Tag libero, es. "person", "paper", "repo", "project", "concept" — può essere "" |
aliases |
list[str] |
Tutte le forme alternative registrate (es. ["S. Tonegawa", "Susumu Tonegawa"]) |
facts |
list[str] |
fact_id collegati all'entity tramite tabella entity_facts. Vuota se nessun link |
Parametri
name: str — il nome o alias da cercare. Trim + Unicode NFC +
case-fold automatici dal backend.
Esempi concreti
Esempio 1 — entity trovata con facts
User: "cosa ricordi di Tonegawa?"
hippo_entity_get(name="Tonegawa")
→ {
"entity": {
"id": "a8f3c9d12e4b",
"canonical_name": "Tonegawa",
"type": "person"
},
"aliases": ["S. Tonegawa", "Susumu Tonegawa"],
"facts": ["f_tonegawa_nobel_1987", "f_tonegawa_engram_2014"]
}
Azione: chiama hippo_facts_list(fact_ids=["f_tonegawa_nobel_1987", "f_tonegawa_engram_2014"]) per leggere le proposizioni complete,
poi rispondi:
Tonegawa (Susumu Tonegawa, person) — 2 fact in memoria:
- Nobel Prize 1987 per immunology (V(D)J recombination)
[f_tonegawa_nobel_1987]
- Lavori sull'engram a MIT 2014 [f_tonegawa_engram_2014]
Alias noti: "S. Tonegawa", "Susumu Tonegawa".
Esempio 2 — alias risolve a canonical
User: "dammi tutto su S. Tonegawa"
hippo_entity_get(name="S. Tonegawa")
→ {
"entity": {"id": "a8f3c9d12e4b", "canonical_name": "Tonegawa", ...},
"aliases": [...],
"facts": [...]
}
L'alias è risolto trasparentemente: stesso id dell'entity canonica.
Esempio 3 — entity sconosciuta
User: "che sai di Marie Curie?"
hippo_entity_get(name="Marie Curie")
→ {"entity": None, "aliases": [], "facts": []}
Risposta corretta (onesta):
Non ho memoria di Marie Curie nel knowledge graph entity-centric.
Posso cercare episodi correlati con hippo_search("Marie Curie")
o fatti con hippo_facts_search?
NON CONFABULARE una risposta basata su training data — l'utente
ha chiesto cosa c'è in memoria persistente, non cosa sa il modello.
Esempio 4 — entity nota, zero fact linkati
User: "abbiamo discusso di NeuroFlask?"
hippo_entity_get(name="NeuroFlask")
→ {
"entity": {"id": "...", "canonical_name": "NeuroFlask", "type": "repo"},
"aliases": [],
"facts": []
}
Risposta:
Il nodo entity "NeuroFlask" esiste nel KG (type=repo) ma non ha
fatti direttamente linkati. Probabilmente è stato menzionato in
episodi senza che facts/triple siano state estratte (l'auto-
extraction OpenIE è P2.c, non ancora attiva). Vuoi che cerchi negli
episodi con hippo_search?
Esempio 5 — Unicode case-fold + NFC
User: "che sai di müller?" (lowercase, NFC)
User store-side: hippo_entity_get(name="MÜLLER") o
name="Müller" o anche forma NFD u+combining-diaeresis →
tutti risolvono allo stesso id. Backend usa unicodedata.normalize
("NFC", s).strip().lower() su una colonna name_norm indicizzata
UNIQUE (schema v4).
Limitazioni note (P2.a)
- No edges: non c'è ancora
entity_edges (predicate + weight),
quindi nessuna navigazione multi-hop tipo "entity vicine di X" o
"fact che connettono X a Y". P2.b lo aggiungerà con
hippo_entity_neighbors + hippo_ppr_retrieve (HippoRAG-style
Personalized PageRank).
- No auto-extraction: le entity e i link entity↔fact non vengono
estratti automaticamente dagli episodi. Per ora vanno inseriti
manualmente con script di seed. P2.c esporrà
hippo_extract_entities(text) LLM-based con json.loads strict.
- No type schema: il campo
type è una stringa libera
("person", "paper", ...). Non ci sono vincoli o gerarchie.
- Solo lookup esatto: cerca per
canonical_name o alias
con match Unicode case-insensitive. Nessun fuzzy match,
nessuna espansione semantica. "Schroedinger" NON matcha
"Schrödinger" (Ö vs OE è translitterazione, fuori scope).
- Population seed-only: il KG è popolato manualmente fino a P2.c.
Cost
- Zero LLM call.
- Sub-50ms su corpus ~500 entity (SQLite WAL + UNIQUE INDEX su
name_norm).
- Free in hosted mode (read on local SQLite + Python str ops).
Quando NON chiamarlo
- Claim factual da validare ("X did Y in YEAR") →
hippo_validate_claim
- Ricerca topic-based su fact ("fatti su engram") →
hippo_facts_search(query="engram")
- Ricerca episodica su dialoghi/sessioni ("quando abbiamo parlato di
Dominic") →
hippo_search o hippo_recall
- Domanda generica senza nome Capitalized ("che lavoro ho fatto ieri")
→
hippo_episode_list + hippo_session_recap
- Chat casuale, saluti, opinioni, output codice
Combinazioni utili
- Entity + tutti i suoi fact:
hippo_entity_get(name) →
prendi facts[] → hippo_facts_list(fact_ids=facts) per le
proposizioni complete.
- Entity + episodi correlati (workaround per assenza di edges):
hippo_entity_get(name) → leggi i fact_id → per ogni fact_id
chiama hippo_lineage_trace(start_id=fact_id, kind="fact", direction="backward") per arrivare agli episodi sorgente.
- Disambigua un nome:
hippo_entity_get ritorna gli aliases —
utile per capire come l'utente potrebbe averlo chiamato in altre
sessioni.
Storia
P2.a della roadmap Engram-amplifies-Claude (cycle #70).
Commit 54a0c35 (2026-05-15): MVP iniziale, engram/entity_kg.py,
3 tabelle SQLite (entities + entity_aliases + entity_facts),
10 RED→GREEN test, tool MCP hippo_entity_get.
Commit 12fa4ff (2026-05-15 notte tarda): hardening
multi-round critic-driven. 5 round adversariali consecutivi con
critic-orchestrator hanno scoperto 6 bug reali e li hanno
forzati a essere fixati:
- Race condition check-then-insert non atomico (8 thread paralleli
→ 2-8 duplicate). Fix:
BEGIN IMMEDIATE + UNIQUE INDEX su
name_norm + IntegrityError fallback re-SELECT.
- Cross-alias dedupe contract violation. Fix: SELECT
canonical-only (no JOIN su alias durante
store).
- Empty
canonical_name bypass. Fix: strip + ValueError.
- Unicode case-folding bug (SQLite
LOWER() ASCII-only:
MÜLLER/Müller diventavano 2 entity). Fix: colonne
name_norm/alias_norm Python-side via str.lower()
full-Unicode + migration v3 backfill + dedup duplicate
pre-existenti.
- NFC vs NFD form-folding bypass. Fix:
unicodedata.normalize("NFC", ...) in _norm() + migration
v4 re-backfill.
- Migration v4 IntegrityError su DB v3 con duplicate NFC+NFD.
Fix: DROP UNIQUE INDEX a inizio v4, UPDATE+dedup, ricreare
UNIQUE alla fine.
Schema finale v4: entities(id, canonical_name, name_norm, type, created_at) con UNIQUE su name_norm + entity_aliases
con alias_norm + entity_facts (PRIMARY KEY composito,
idempotente via INSERT OR IGNORE).
Test coverage: 17/17 PASS (10 base + 7 critic-driven). Full
pytest 2451 PASS 0 fail.
Spec: docs/specs/p2-entity-centric-kg.md (commit 48678a2).
Test: tests/test_entity_kg.py.
Cosa arriva dopo (NON ANCORA disponibile)
- P2.b (next):
hippo_entity_neighbors(entity_id, k, hops) +
hippo_ppr_retrieve(query_entities, damping=0.5, k=20) per
recall multi-hop tipo HippoRAG. Dipendenza: networkx (prpack).
- P2.c:
hippo_extract_entities(text, mode="ner+triple")
LLM-based 2-step (NER → triple) con json.loads strict, NO
parser eseguibile su LLM output. Hook automatico in
hippo_record_episode quando l'episodio è abbastanza ricco.
- P2.b/c addendum:
hippo_entity_link(fact_id, entities[])
per manual override e seed pipeline.
1---
2name: hippoagent-entity-recall
3description: >-
4 When the user asks "cosa ricordi di X?", "dammi tutto su Y", "chi è Z?",
5 "cosa abbiamo detto di W?", "ricostruisci ciò che sai di
6 [Capitalized name or known alias]", call hippo_entity_get(name) BEFORE
7 answering. Triggers also on "what do you know about X", "tell me about Y",
8 "facts about Z", "history of W". The tool returns entity+aliases+facts
9 from a persistent SQLite KG (P2.a entity-centric KG, schema v4,
10 Unicode-safe). Lookup is case-insensitive Unicode (Müller/MÜLLER/müller
11 same match) and resolves aliases ("S. Tonegawa" → canonical "Tonegawa"),
12 returning the list of fact_id linked to the entity. If entity is None,
13 declare honestly "non ho memoria di X" — do NOT confabulate from training
14 data. If entity exists but facts == [], declare "ho il nodo entity ma
15 nessun fatto collegato" and suggest hippo_facts_search or hippo_recall.
16 Zero LLM cost, sub-50ms on ~500 entity corpus, free in hosted mode.
17 Backend SQLite WAL + UNIQUE INDEX on name_norm Python-normalized
18 (NFC + str.lower, NOT SQLite ASCII-only LOWER). Entity-first recall —
19 complements hippo_facts_search (topic-based) and hippo_recall (semantic
20 episode) with a third modality, graph node lookup. ANTI-PATTERN: do NOT
21 use for factual claim validation ("Tonegawa won Nobel in 2014") — that's
22 hippo_validate_claim. Do NOT use for topic-based episode/dialog search —
23 that's hippo_search or hippo_recall.
24metadata:
25 source: https://skillmd.com/skills/aibot88/hippoagent-entity-recall
26---
27
28# HippoAgent — entity-first recall (hippo_entity_get)
29
30Quando l'utente chiede "che sai di X?" / "ricordami chi è Y?" /
31"dammi tutto su Z", chiama `hippo_entity_get(name=<X>)` PRIMA di
32rispondere da memoria interna. Il tool ritorna l'entity canonica
33(risolvendo eventuali alias) + la lista di fact collegati, da un
34knowledge graph SQLite persistente.
35
36## ⚠️ Quando ATTIVARE (trigger)
37
38Pattern lessicali che attivano il skill:
39
40- **Italiano**: "che sai di X", "cosa ricordi di Y", "dammi tutto
41 su Z", "chi è W", "ricostruisci ciò che sappiamo di V",
42 "abbiamo discusso di U", "informazioni su T", "storia di S".
43- **English**: "what do you know about X", "tell me about Y",
44 "facts about Z", "who is W", "history of V", "what have we said
45 about U", "summarize what we know on T".
46- **Implicito**: l'utente menziona un nome Capitalized (persona,
47 paper, repo, progetto interno) e ti aspetti che ne sappia qualcosa.
48
49**Risoluzione automatica alias**: lookup di "S. Tonegawa" trova
50l'entity canonica "Tonegawa" se è stato registrato l'alias.
51
52**Case + Unicode-safe**: "müller", "MÜLLER", "Müller" trovano
53tutti la stessa entity. Anche NFC vs NFD (`unicodedata.normalize`
54forma decomposta vs composta) sono trattati come uguali.
55
56**NON serve** per:
57- Claim factual da validare ("X is Y") → `hippo_validate_claim`
58- Ricerca su episodi/dialoghi su un topic → `hippo_search`,
59 `hippo_recall`
60- Ricerca su fact per topic-namespace → `hippo_facts_search`,
61 `hippo_facts_list`
62- Saluti, chat casuale, opinioni
63
64## Flow
65
66```
671. Identifica il nome dell'entity nella domanda (Capitalized,
68 eventualmente con prefisso "S." / "Dr." / titolo).
692. hippo_entity_get(name="<entity>")
703. Read payload:
71 {
72 "entity": { "id": "...", "canonical_name": "...", "type": "..." }
73 | None,
74 "aliases": ["...", "..."],
75 "facts": ["fact_id_1", "fact_id_2", ...]
76 }
774. Act:
78 ┌─ entity is None → "Non ho memoria di <name> nel KG. Vuoi
79 │ che cerchi episodi correlati?
80 │ (`hippo_search`)"
81 ├─ entity, facts == [] → "Ho il nodo <canonical_name> (id=...,
82 │ type=...) ma nessun fatto direttamente
83 │ linkato. Posso cercare con
84 │ `hippo_facts_search` o `hippo_recall`."
85 └─ entity, facts ≠ [] → Leggi i fact con `hippo_facts_list`
86 (passando i fact_id ottenuti) per
87 ricostruire la conoscenza completa,
88 poi rispondi citando i fact_id come
89 evidenza.
90```
91
92## Output semantics
93
94| campo | tipo | semantica |
95|---|---|---|
96| `entity` | dict \| None | None = entity sconosciuta. Dict = `{id, canonical_name, type}` |
97| `entity.id` | str | UUID 12-char, primary key SQLite, usalo per `hippo_entity_link` (futuro P2.a addendum) |
98| `entity.canonical_name` | str | Nome canonico (la forma "ufficiale", es. "Tonegawa") |
99| `entity.type` | str | Tag libero, es. `"person"`, `"paper"`, `"repo"`, `"project"`, `"concept"` — può essere `""` |
100| `aliases` | list[str] | Tutte le forme alternative registrate (es. `["S. Tonegawa", "Susumu Tonegawa"]`) |
101| `facts` | list[str] | `fact_id` collegati all'entity tramite tabella `entity_facts`. Vuota se nessun link |
102
103## Parametri
104
105- `name: str` — il nome o alias da cercare. Trim + Unicode NFC +
106 case-fold automatici dal backend.
107
108## Esempi concreti
109
110### Esempio 1 — entity trovata con facts
111
112User: "cosa ricordi di Tonegawa?"
113
114```
115hippo_entity_get(name="Tonegawa")
116→ {
117 "entity": {
118 "id": "a8f3c9d12e4b",
119 "canonical_name": "Tonegawa",
120 "type": "person"
121 },
122 "aliases": ["S. Tonegawa", "Susumu Tonegawa"],
123 "facts": ["f_tonegawa_nobel_1987", "f_tonegawa_engram_2014"]
124 }
125```
126
127Azione: chiama `hippo_facts_list(fact_ids=["f_tonegawa_nobel_1987",
128"f_tonegawa_engram_2014"])` per leggere le proposizioni complete,
129poi rispondi:
130
131> Tonegawa (Susumu Tonegawa, person) — 2 fact in memoria:
132> 1. Nobel Prize 1987 per immunology (V(D)J recombination)
133> [f_tonegawa_nobel_1987]
134> 2. Lavori sull'engram a MIT 2014 [f_tonegawa_engram_2014]
135> Alias noti: "S. Tonegawa", "Susumu Tonegawa".
136
137### Esempio 2 — alias risolve a canonical
138
139User: "dammi tutto su S. Tonegawa"
140
141```
142hippo_entity_get(name="S. Tonegawa")
143→ {
144 "entity": {"id": "a8f3c9d12e4b", "canonical_name": "Tonegawa", ...},
145 "aliases": [...],
146 "facts": [...]
147 }
148```
149
150L'alias è risolto trasparentemente: stesso `id` dell'entity canonica.
151
152### Esempio 3 — entity sconosciuta
153
154User: "che sai di Marie Curie?"
155
156```
157hippo_entity_get(name="Marie Curie")
158→ {"entity": None, "aliases": [], "facts": []}
159```
160
161Risposta corretta (onesta):
162
163> Non ho memoria di Marie Curie nel knowledge graph entity-centric.
164> Posso cercare episodi correlati con `hippo_search("Marie Curie")`
165> o fatti con `hippo_facts_search`?
166
167**NON CONFABULARE** una risposta basata su training data — l'utente
168ha chiesto cosa c'è in *memoria persistente*, non cosa sa il modello.
169
170### Esempio 4 — entity nota, zero fact linkati
171
172User: "abbiamo discusso di NeuroFlask?"
173
174```
175hippo_entity_get(name="NeuroFlask")
176→ {
177 "entity": {"id": "...", "canonical_name": "NeuroFlask", "type": "repo"},
178 "aliases": [],
179 "facts": []
180 }
181```
182
183Risposta:
184
185> Il nodo entity "NeuroFlask" esiste nel KG (type=repo) ma non ha
186> fatti direttamente linkati. Probabilmente è stato menzionato in
187> episodi senza che facts/triple siano state estratte (l'auto-
188> extraction OpenIE è P2.c, non ancora attiva). Vuoi che cerchi negli
189> episodi con `hippo_search`?
190
191### Esempio 5 — Unicode case-fold + NFC
192
193User: "che sai di müller?" (lowercase, NFC)
194
195User store-side: `hippo_entity_get(name="MÜLLER")` o
196`name="Müller"` o anche forma NFD u+combining-diaeresis →
197tutti risolvono allo stesso `id`. Backend usa `unicodedata.normalize`
198`("NFC", s).strip().lower()` su una colonna `name_norm` indicizzata
199UNIQUE (schema v4).
200
201## Limitazioni note (P2.a)
202
203- **No edges**: non c'è ancora `entity_edges` (predicate + weight),
204 quindi nessuna navigazione multi-hop tipo "entity vicine di X" o
205 "fact che connettono X a Y". P2.b lo aggiungerà con
206 `hippo_entity_neighbors` + `hippo_ppr_retrieve` (HippoRAG-style
207 Personalized PageRank).
208- **No auto-extraction**: le entity e i link entity↔fact non vengono
209 estratti automaticamente dagli episodi. Per ora vanno inseriti
210 manualmente con script di seed. P2.c esporrà
211 `hippo_extract_entities(text)` LLM-based con `json.loads` strict.
212- **No type schema**: il campo `type` è una stringa libera
213 (`"person"`, `"paper"`, ...). Non ci sono vincoli o gerarchie.
214- **Solo lookup esatto**: cerca per `canonical_name` o alias
215 con match Unicode case-insensitive. Nessun fuzzy match,
216 nessuna espansione semantica. "Schroedinger" NON matcha
217 "Schrödinger" (Ö vs OE è translitterazione, fuori scope).
218- **Population seed-only**: il KG è popolato manualmente fino a P2.c.
219
220## Cost
221
222- Zero LLM call.
223- Sub-50ms su corpus ~500 entity (SQLite WAL + UNIQUE INDEX su
224 `name_norm`).
225- Free in hosted mode (read on local SQLite + Python str ops).
226
227## Quando NON chiamarlo
228
229- Claim factual da validare ("X did Y in YEAR") → `hippo_validate_claim`
230- Ricerca topic-based su fact ("fatti su engram") →
231 `hippo_facts_search(query="engram")`
232- Ricerca episodica su dialoghi/sessioni ("quando abbiamo parlato di
233 Dominic") → `hippo_search` o `hippo_recall`
234- Domanda generica senza nome Capitalized ("che lavoro ho fatto ieri")
235 → `hippo_episode_list` + `hippo_session_recap`
236- Chat casuale, saluti, opinioni, output codice
237
238## Combinazioni utili
239
240- **Entity + tutti i suoi fact**: `hippo_entity_get(name)` →
241 prendi `facts[]` → `hippo_facts_list(fact_ids=facts)` per le
242 proposizioni complete.
243- **Entity + episodi correlati** (workaround per assenza di edges):
244 `hippo_entity_get(name)` → leggi i fact_id → per ogni fact_id
245 chiama `hippo_lineage_trace(start_id=fact_id, kind="fact",
246 direction="backward")` per arrivare agli episodi sorgente.
247- **Disambigua un nome**: `hippo_entity_get` ritorna gli `aliases` —
248 utile per capire come l'utente potrebbe averlo chiamato in altre
249 sessioni.
250
251## Storia
252
253P2.a della roadmap Engram-amplifies-Claude (cycle #70).
254- Commit `54a0c35` (2026-05-15): MVP iniziale, `engram/entity_kg.py`,
255 3 tabelle SQLite (`entities` + `entity_aliases` + `entity_facts`),
256 10 RED→GREEN test, tool MCP `hippo_entity_get`.
257- Commit `12fa4ff` (2026-05-15 notte tarda): **hardening
258 multi-round critic-driven**. 5 round adversariali consecutivi con
259 critic-orchestrator hanno scoperto 6 bug reali e li hanno
260 forzati a essere fixati:
261 1. Race condition check-then-insert non atomico (8 thread paralleli
262 → 2-8 duplicate). Fix: `BEGIN IMMEDIATE` + `UNIQUE INDEX` su
263 `name_norm` + IntegrityError fallback re-SELECT.
264 2. Cross-alias dedupe contract violation. Fix: SELECT
265 canonical-only (no JOIN su alias durante `store`).
266 3. Empty `canonical_name` bypass. Fix: strip + `ValueError`.
267 4. Unicode case-folding bug (SQLite `LOWER()` ASCII-only:
268 MÜLLER/Müller diventavano 2 entity). Fix: colonne
269 `name_norm`/`alias_norm` Python-side via `str.lower()`
270 full-Unicode + migration v3 backfill + dedup duplicate
271 pre-existenti.
272 5. NFC vs NFD form-folding bypass. Fix:
273 `unicodedata.normalize("NFC", ...)` in `_norm()` + migration
274 v4 re-backfill.
275 6. Migration v4 IntegrityError su DB v3 con duplicate NFC+NFD.
276 Fix: DROP UNIQUE INDEX a inizio v4, UPDATE+dedup, ricreare
277 UNIQUE alla fine.
278
279 Schema finale v4: `entities(id, canonical_name, name_norm,
280 type, created_at)` con UNIQUE su `name_norm` + `entity_aliases`
281 con `alias_norm` + `entity_facts` (PRIMARY KEY composito,
282 idempotente via INSERT OR IGNORE).
283
284 Test coverage: 17/17 PASS (10 base + 7 critic-driven). Full
285 pytest 2451 PASS 0 fail.
286
287- Spec: `docs/specs/p2-entity-centric-kg.md` (commit `48678a2`).
288- Test: `tests/test_entity_kg.py`.
289
290## Cosa arriva dopo (NON ANCORA disponibile)
291
292- **P2.b** (next): `hippo_entity_neighbors(entity_id, k, hops)` +
293 `hippo_ppr_retrieve(query_entities, damping=0.5, k=20)` per
294 recall multi-hop tipo HippoRAG. Dipendenza: `networkx` (prpack).
295- **P2.c**: `hippo_extract_entities(text, mode="ner+triple")`
296 LLM-based 2-step (NER → triple) con `json.loads` strict, NO
297 parser eseguibile su LLM output. Hook automatico in
298 `hippo_record_episode` quando l'episodio è abbastanza ricco.
299- **P2.b/c addendum**: `hippo_entity_link(fact_id, entities[])`
300 per manual override e seed pipeline.