Skip to content

Cold Start Pipeline

When the graph is empty, Context Chain has no value. The cold start pipeline builds initial content in layers.

Layer 0: Code Structure (Joern CPG)

Joern parses your codebase and builds the structural backbone:

  • Function / class / module nodes
  • Call relationships (edges)
  • API endpoint definitions
  • Import/export relationships

Pure structure, no decisions — but provides anchoring targets for everything that follows.

bash
# From Dashboard: System → Generate CPG
# Or from CLI:
joern-parse /path/to/src --output data/project.cpg.bin
joern --script joern/extract-code-entities.sc \
  --param cpgFile=data/project.cpg.bin \
  --param outFile=data/project.json
npm run ingest:cpg -- --file data/project.json

Layer 1: Decision Extraction

The analyze_function building block reads each function, queries the graph for caller/callee context, and asks the LLM to extract decisions.

bash
# From Dashboard: Quick Scan → pick a repo → Scan
# Or from CLI:
npm run analyze -- --repo my-repo
npm run analyze -- --repo my-repo --continue    # resume if interrupted

All decisions are marked confidence: auto_generated. Quality improves as session ingestion adds real conversation-extracted decisions over time.

Layer 2: Decision Relationships

After extraction, connect related decisions:

bash
npm run connect

This processes PENDING_COMPARISON edges — groups decisions, analyzes relationships via LLM, and creates CAUSED_BY, DEPENDS_ON, CONFLICTS_WITH edges.

Pipeline Order

1. docker compose up -d           # Start Memgraph
2. npm run dashboard              # Start Dashboard
3. System → Add repo + Generate CPG + Full Setup
4. Quick Scan or npm run analyze  # Extract decisions
5. npm run connect                # Build relationships

Steps 4 and 5 can be interrupted and resumed at any time.

Released under the Apache 2.0 License.