# How the Article-Analyzer Extracts Entities and Relationships from Wiki Articles in Understand Anything

> Discover how the article-analyzer extracts entities and relationships from wiki articles for Understand Anything. It parses markdown to identify concepts and statements, creating normalized JSON for your knowledge graph.

- Repository: [Egonex/Understand-Anything](https://github.com/Egonex-AI/Understand-Anything)
- Tags: how-to-guide
- Published: 2026-06-28

---

**The article-analyzer parses markdown wiki articles to identify named concepts without existing pages and explicit factual statements, emitting normalized JSON nodes with implicit semantic edges for the knowledge graph.**

The `article-analyzer` agent in the Egonex-AI/Understand-Anything repository serves as the core knowledge-extraction engine that transforms plain-text wiki articles into structured graph data. This specialized component automatically extracts entities and relationships from wiki articles by analyzing document structure and content, populating the global knowledge graph with typed nodes and weighted edges. Operating within the pipeline `knowledge-scanner → format-detector → article-analyzer → relationship-builder → graph-reviewer`, this agent ensures that unstructured wiki content becomes queryable, interconnected knowledge.

## Input Processing and AST Parsing

The agent receives a single markdown article generated by the preceding `format-detector` step. It traverses the document's abstract syntax tree to locate two distinct categories of content:

- **Named things** that do **not** already have a wiki page (i.e., not present in the current node-ID set). These become **entity** nodes.
- **Explicit statements** that assert a fact, opinion, or description. These become **claim** nodes.

This parsing strategy ensures that only novel concepts are extracted while existing knowledge references are preserved for deduplication.

## Entity and Claim Node Generation

For each discovered concept, the analyzer emits a JSON node following the schema defined in [`understand-anything-plugin/agents/article-analyzer.md`](https://github.com/Egonex-AI/Understand-Anything/blob/main/understand-anything-plugin/agents/article-analyzer.md). The structure follows strict normalization rules:

```json
{
  "id": "entity:{normalized-name}",
  "type": "entity",
  "name": "...",
  "summary": "...",
  "tags": ["entity", "..."],
  "complexity": "simple"
}

```

The **ID** field uses a lower-cased, hyphen-separated format (e.g., `entity:my-tool`) according to the specification at lines L28-L34. The **tags** array always includes the base type `"entity"` or `"claim"` plus any inferred categories. This normalization ensures consistent referencing across the knowledge graph.

## Implicit Edge Generation

Beyond node creation, the analyzer establishes immediate semantic relationships through **implicit edges** that capture how entities, claims, and articles interconnect. As implemented in [`understand-anything-plugin/agents/article-analyzer.md`](https://github.com/Egonex-AI/Understand-Anything/blob/main/understand-anything-plugin/agents/article-analyzer.md#L52-L53), the agent generates:

- **`exemplifies`** (weight 0.7): Indicates that an entity or article is a concrete example of a broader concept.
- **`authored_by`** (weight 0.6): Links an article to a specific entity (person or agent) responsible for its creation.

These edges provide foundational graph connectivity before the `relationship-builder` agent adds richer semantic relationships such as `mentions` or `cites`.

## Deduplication and Output Contract

Before emitting results, the agent performs strict deduplication by checking each candidate ID against the global node-ID map (lines L72-L78). If an entity already exists in the knowledge graph—meaning it appeared in a previously processed article—the analyzer references the existing node rather than creating a duplicate.

According to the output contract defined at lines L92-L94, the agent **only** returns *new* entity and claim nodes plus the implicit edges described above. The article node itself is produced by the preceding `format-detector` step, ensuring clear separation of concerns within the pipeline.

## Practical Implementation Examples

### Running the Knowledge Pipeline via CLI

Execute the complete extraction workflow from the command line:

```bash

# Scan a repository and extract knowledge from markdown articles

understand --knowledge

```

This command internally dispatches the full agent pipeline, with `article-analyzer` processing each wiki document to extract entities and relationships from wiki articles before the relationship-builder enriches the graph.

### Programmatic Invocation with TypeScript

Integrate the analyzer directly into custom skills using the core dispatch API:

```typescript
import { dispatchSubagent } from '@understand-anything/core';

// articlePath is an absolute path to a wiki markdown file
await dispatchSubagent('article-analyzer', {
  articlePath,
  existingNodeIds: new Set([...]) // IDs already present in the graph
});

```

The subagent returns an array of nodes and edges:

```typescript
[
  { id: 'entity:alice', type: 'entity', name: 'Alice', … },
  { id: 'claim:alice-creates-tool', type: 'claim', … },
  { source: 'entity:alice', target: 'claim:alice-creates-tool', type: 'authored_by', weight: 0.6 }
]

```

### Inspecting Generated Entities

Verify the extracted nodes in the local knowledge graph:

```bash
cat .understand-anything/knowledge-graph.json | jq '.nodes[] | select(.type=="entity")'

```

This displays the normalized entity IDs created by the analyzer, confirming successful extraction and deduplication.

## Summary

- The `article-analyzer` traverses markdown ASTs to identify unnamed entities and explicit claims in wiki articles.
- Node IDs follow a strict normalization pattern (`entity:{normalized-name}`) using lower-case, hyphen-separated formatting.
- Implicit edges (`exemplifies`, `authored_by`) with specific weights (0.7 and 0.6) provide immediate semantic structure.
- Global deduplication checks prevent duplicate node creation by verifying against existing node IDs.
- The agent returns only new nodes and implicit edges, maintaining a strict output contract within the knowledge pipeline.

## Frequently Asked Questions

### What distinguishes entity nodes from claim nodes?

**Entity nodes** represent named concepts, tools, or people that lack existing wiki pages within the current graph, while **claim nodes** capture explicit factual statements, opinions, or descriptions asserted within the article text. Both follow the same JSON schema but differ in their `type` field and semantic interpretation.

### How does the article-analyzer prevent duplicate entities?

The agent checks every candidate ID against the global node-ID map before creation. If an identifier already exists—indicating the entity appeared in a previously processed article—the analyzer reuses that existing node rather than generating a duplicate, as specified at lines L72-L78 in the agent definition.

### What edge types does the article-analyzer generate?

The analyzer creates **implicit edges** including `exemplifies` (weight 0.7) for concrete examples of concepts and `authored_by` (weight 0.6) for authorship attribution. Richer relationship types like `mentions` or `cites` are added later by the `relationship-builder` agent.

### How do I invoke the article-analyzer from custom code?

Import `dispatchSubagent` from `@understand-anything/core` and call it with the `'article-analyzer'` identifier, providing the `articlePath` and a `Set` of existing node IDs. The function returns a Promise resolving to an array of new nodes and implicit edges ready for graph integration.