Skip to main content

Agentic KG local flows

This walkthrough shows the local development path for the Graphiti + Docling + agentic maintenance slice. It is intentionally offline-first: the notebook uses small fakes to demonstrate the same envelopes and operator gates without requiring Neo4j, Ollama, Celery, or a running AlphaSwarm stack.

Why​

Use this when validating the shape of a knowledge-graph ingestion or maintenance flow before connecting live services:

  • parse document blocks with a Docling-first parser chain;
  • convert blocks into PermissionedDataPoint envelopes with provenance;
  • remember them as tenant/corpus-scoped Graphiti episodes;
  • query KB recall and pass cited context into Graph-RAG;
  • inspect default-off kg.* maintenance workflow specs.

Run the notebook​

Download or open the notebook artifact:

From this repo, validate it locally with:

python -m jupyter nbconvert --execute --to notebook --inplace static/notebooks/agentic-kg-local-flows.ipynb

The default execution path is offline and should complete without network access. The notebook also includes a gated live Graphiti smoke cell that instantiates GraphitiMemoryEngine, writes tutorial episodes, and performs recall against local Neo4j plus an Ollama-compatible OpenAI endpoint. That path remains disabled unless RUN_LIVE_GRAPHITI=1 is set after the operator starts Neo4j and Ollama and installs alphaswarm-kb[graphiti].

Verify​

  • Notebook execution prints offline tutorial checks passed.
  • Every remembered episode uses a namespace shaped like tenant:<tenant_id>:corpus:<corpus_name>.
  • Graph context contains provenance citations from the parsed document.
  • All kg.* maintenance schedules are disabled by default.
  • The quarantine review assistant exposes only summarize and recommend; promotion stays human-gated.

What next​

After the offline flow passes, run the targeted repo gates in alphaswarm_kb and alphaswarm_agents, then enable a single live smoke profile with local Neo4j and Ollama before promoting any scheduled maintenance workflow.