Skip to content

Try It — Knowledge Graph Quick Start

Terminal window
docker run -d --name neo4j \
-p 7474:7474 -p 7687:7687 \
-e NEO4J_AUTH=neo4j/codegraph \
neo4j:5

Verify it’s running: open http://localhost:7474 in your browser.

Terminal window
export NEO4J_PASSWORD=codegraph
export OPENAI_API_KEY=sk-...
Terminal window
cd /path/to/your/project
iw init
Terminal window
iw run docs/*.md --track open --provider openai -i -v

What happens:

  1. Documents are chunked (~16k chars/chunk)
  2. OpenAI extracts entity-relationship triples per chunk
  3. Entities and predicates are canonicalized
  4. Cross-document entities are deduplicated

The -i flag enables incremental caching — re-runs skip unchanged files.

Terminal window
iw persist --latest -v
Terminal window
iw query "What are the main components?" -s my-project
iw query "What decisions were made about the database?" -s my-project -v
Terminal window
iw query --cypher "MATCH (n:Canon:Entity) RETURN n.name, n.type LIMIT 20"
iw query --cypher "MATCH ()-[r:CANON_REL]->() RETURN r.predicate, count(*) ORDER BY count(*) DESC"
Terminal window
# Topic-based
iw context "authentication architecture" -s my-project
# Entity-seeded (expand 3 hops from a specific entity)
iw context -e "React" --hops 3 -s my-project
Terminal window
iw impact src/auth.ts -s my-project

Traces which entities, decisions, and risks are affected by changing a file.

Terminal window
iw doc-health -s my-project

Detects stale references, structural drift, and contradictions.

  • Use smart-mock provider for testing without API costs: --provider smart-mock
  • The --from-fx flag lets you re-run only canonicalization: --from-fx <run-id>
  • Output as JSON for programmatic use: -f json -o results.json