---
layout: feature
title: Knowledge Graph
headline: Explore Connections, Not Just Results
description: Interactive graph visualization of document connections across your local knowledge base. Explore wiki links, markdown links, and semantic similarity, then jump straight into the source note.
keywords: knowledge graph, graph view, note graph, document graph, wiki links visualization, local knowledge graph, zettelkasten graph
icon: graph
slug: graph-view
permalink: /features/graph-view/
og_image: /assets/images/og/og-graph-view.png
benefits:
  - Interactive force-directed visualization
  - Wiki links, markdown links, and similarity edges
  - Filter by collection
  - Click nodes to navigate to documents
  - Zoom, pan, and explore
  - CLI and REST API access
commands:
  - "gno graph"
  - "gno graph --collection notes"
  - "gno serve # then /graph"
---

## Visualize Your Knowledge

See your document connections at a glance. The Knowledge Graph renders your notes as an interactive constellation—nodes are documents, edges are links between them.

![Knowledge Graph](/assets/screenshots/webui-graph.jpg)

## What You'll See

- **Wiki links**: `[[Document Name]]` connections shown as teal edges
- **Markdown links**: `[text](path.md)` shown as lighter edges
- **Similar documents**: Optional gold edges for semantically related notes (requires vector index)
- **Graph health**: Header stats expose top-degree hubs, unresolved links, and isolated documents

## Web UI

Access the graph at `http://localhost:3000/graph` after starting the server:

```bash
gno serve
```

### Navigation

- **Click** a node to navigate to that document
- **Hover** to see document title and connection count
- **Scroll** to zoom in/out
- **Drag** to pan the view
- Use the **+/-** buttons for zoom controls

### Filtering

- **Collection filter**: Focus on a single collection
- **Community filter**: Focus on one detected cluster
- **Similar toggle**: Show/hide semantic similarity edges (golden lines)

### Legend

The bottom-right legend shows edge types:

- Teal: Wiki links (`[[...]]`)
- Light teal: Markdown links (`[...](...)`)
- Gold: Similarity connections (when enabled)
- Community swatches: deterministic clusters for returned nodes

## CLI Access

Generate graph data from the command line:

```bash
# Full graph
gno graph

# Filter by collection
gno graph --collection notes

# Expand around one document
gno graph --neighbors gno://notes/auth.md

# Explain how two docs connect
gno graph --from gno://notes/a.md --to gno://notes/b.md

# JSON output
gno graph --json

# Include similarity edges
gno graph --similar

# Limit nodes/edges
gno graph --limit 500 --edge-limit 2000
```

### Options

| Flag             | Description                 | Default |
| ---------------- | --------------------------- | ------- |
| `--collection`   | Filter to single collection | all     |
| `--limit`        | Max nodes to return         | 2000    |
| `--edge-limit`   | Max edges to return         | 10000   |
| `--similar`      | Include similarity edges    | false   |
| `--threshold`    | Similarity threshold (0-1)  | 0.7     |
| `--linked-only`  | Exclude isolated nodes      | true    |
| `--neighbors`    | Show graph neighbors        | -       |
| `--from`, `--to` | Find shortest graph path    | -       |
| `--max-depth`    | Max path hops               | 6       |
| `--json`         | JSON output                 | false   |

## REST API

Programmatic access via HTTP:

```bash
# Basic graph
curl http://localhost:3000/api/graph

# With options
curl "http://localhost:3000/api/graph?collection=notes&includeSimilar=true&limit=1000"
```

### Query Parameters

| Param            | Description                | Default |
| ---------------- | -------------------------- | ------- |
| `collection`     | Filter to collection       | -       |
| `limit`          | Max nodes                  | 2000    |
| `edgeLimit`      | Max edges                  | 10000   |
| `includeSimilar` | Include similarity edges   | false   |
| `threshold`      | Similarity threshold (0-1) | 0.7     |
| `linkedOnly`     | Exclude isolated nodes     | true    |
| `similarTopK`    | Similar docs per node      | 5       |

### Response

```json
{
  "nodes": [
    {
      "id": "doc-123",
      "uri": "notes/my-note.md",
      "title": "My Note",
      "collection": "notes",
      "relPath": "my-note.md",
      "degree": 5,
      "communityId": "c1"
    }
  ],
  "links": [
    {
      "source": "doc-123",
      "target": "doc-456",
      "type": "wiki",
      "weight": 1,
      "confidence": "explicit",
      "audit": { "resolution": "exact-title", "matchCount": 1 }
    }
  ],
  "report": {
    "hubs": [],
    "bridgeCandidates": [],
    "isolated": { "total": 0, "examples": [] },
    "unresolvedLinks": {
      "total": 0,
      "byType": { "wiki": 0, "markdown": 0 }
    },
    "edgeTypes": { "wiki": 1, "markdown": 0, "similar": 0 },
    "edgeConfidence": {
      "explicit": 1,
      "inferred": 0,
      "ambiguous": 0,
      "similarity": 0
    },
    "audit": { "inferredEdges": 0, "ambiguousEdges": 0, "similarityEdges": 0 },
    "communities": {
      "total": 3,
      "algorithm": "deterministic-label-propagation",
      "skipped": false,
      "assignments": { "doc-123": "c1" },
      "top": []
    }
  },
  "meta": {
    "totalNodes": 150,
    "totalEdges": 320,
    "truncated": false
  }
}
```

## Use Cases

- **Knowledge exploration**: Discover unexpected connections
- **Documentation audit**: Find orphaned or poorly-connected docs
- **Research navigation**: Follow citation chains visually
- **Onboarding**: Help new team members understand doc structure
- **Content planning**: Identify gaps in your knowledge base

## Performance

The graph handles large collections efficiently:

- Default limits: 2000 nodes, 10000 edges
- Particle animations disabled for 500+ edges
- Lazy-loaded graph library (~250KB)
- Client-side caching for smooth navigation

For very large graphs, filter by collection or adjust limits.

## Getting Started

```bash
# Index your documents
gno index

# Start the web server
gno serve

# Open the graph
# http://localhost:3000/graph
```

Or via CLI:

```bash
gno graph --json | jq '.nodes | length'
# 142
```
