Need to hook Python into a local graph database
Connect to a local Neo4j database from Python using the Bolt protocol
What did I believe in March, and what do I believe now?
A graph of entities and relationships, each edge stamped with when it became true and when it stopped, built automatically from documents and conversations.
A vector store can tell you what is similar. It cannot tell you that a fact replaced another fact, or when. → This chapter builds memory as entities and relationships with validity intervals, so the system can answer questions about change rather than only about content — which is what "remembering" actually means for a person or an organisation. → It also builds the personal knowledge graph version, over plain markdown files you own, which turns out to be the one most people keep using.
Memory with time in it. Entities and edges carrying validity intervals, so a superseded fact is superseded rather than merely outnumbered — and a system that can answer "what changed since March" instead of only "what is similar to this".
When facts change and the change matters: people, projects, decisions, prices, org charts — anything where the old value is not simply wrong but historical.
An entity extractor, an edge store with bi-temporal validity, a resolution step for duplicates, and a query layer that understands "as of".
The frameworks are open source; the graph database underneath may not be. The markdown-file variant costs nothing at all.
Graph extraction is an LLM job and it makes mistakes with confidence. A graph nobody inspects accumulates plausible edges that were never true.
A bi‑temporal knowledge graph stores each edge with a validity window (when the fact was true) and provenance timestamps, letting it distinguish current facts from outdated ones, unlike a plain vector store that only ranks by similarity.
Separate similarity retrieval from change tracking and see why a vector store cannot represent “this fact replaced that one”
Markdown files with frontmatter, bracketed‑category observation lines and verb‑prefixed wikilink relations encode entities for the graph tool.
Produce three markdown files that define entities, observations and relations readable by the graph tool
Validity intervals are four timestamps on each edge – valid‑from, valid‑to, observed‑at and ingested‑at – that define when a fact is true and where it came from, enabling point‑in‑time queries.
Answer what was believed in March and what replaced it by applying validity intervals
The cognify extractor creates EntityNode and EntityEdge objects linked to the newly added episode, recording provenance for each fact.
Insert a paragraph into the system and view the entities and relations it generates
The build_context command traverses wikilinks across markdown notes to assemble a combined answer.
Create a knowledge graph from your notes that an assistant can query without installing a separate database
A checklist of three conditions—merged identity across documents, historic value relevance, and change‑focused queries—guides the decision to use a graph.
Choose whether to use a graph database for a specific project using a short checklist
Edge verification involves opening an edge’s source episode and checking whether the statement was directly quoted or inferred, determining its trustworthiness.
Prevent unverified edges from contaminating future queries by spot‑checking after each ingestion batch
Need to hook Python into a local graph database
Connect to a local Neo4j database from Python using the Bolt protocol
Separate person, channel and OS records
Build a minimal knowledge graph with a few Cypher MERGE commands
Need to know when a fact was true and when the system believed it
A bitemporal model stores two timestamps on each node or relationship: world validity (when the fact was true in reality) and system validity (when the AI system considered it true). This lets you query both historical truth and the system's belief history, enabling precise fact invalidation and audit trails.
My markdown notes are scattered
By parsing a directory of markdown files, extracting entities with LLM prompts, and storing them as nodes with timestamps, you create a personal knowledge graph that records when each note was authored/updated, enabling queries like “what did I believe in March versus now”.
Need to keep old facts without deleting them
Instead of deleting nodes/relationships when information becomes obsolete, set an ‘invalidUntil’ or ‘validTo’ timestamp. This preserves history for audit and lets agents reason about why a fact was superseded.
Unstructured timestamped logs
Gravity takes episodes (text plus a reference timestamp) and uses an LLM to extract entities, relations, and the associated time interval. It then creates nodes and edges in Neo4j with validity periods, turning unstructured logs into a temporal KG automatically.
Want to know where someone worked in a given year
Because each edge stores a validity interval, you can ask the graph for information that was true during any historical window. The Gravity search tool translates a natural‑language time constraint into a Cypher range filter.
Old statements stay in my knowledge graph
When a new episode contradicts an existing fact, Gravity marks the previous edge as ended by setting its 'valid_to' timestamp. This keeps the graph consistent without manual cleanup.
Need to see how relationships change over time
Graffiti can ingest both structured and unstructured data, automatically creating nodes and edges while attaching start‑end timestamps to each relationship. These validity intervals let the graph record when facts become true and when they are superseded, enabling queries about how information changes over time.
Find out what I believed in March vs now
Graffiti’s hybrid search combines semantic BM25 scoring with graph‑based distance weighting, and you can restrict queries to a focal node and a specific time window. By specifying the validity interval in the query, the system returns only relationships that were true at that moment, revealing how facts evolved.
The same set on /recipes, filtered by tool and role.
Ask, share, or report — over on the Heidelberg AI community forum.