AgentisProAGENTISPRO RAG ENGINE
Knowledge graph

Entities & Relationships

Understanding entity types and relationship patterns in the Knowledge Graph

Entities & Relationships

This page explains how entities and relationships are extracted, stored, and used in AgentisPro RAG Engine.

Entity Extraction Process

When you upload a document, the following happens:

Document Text


┌─────────────┐
│   LightRAG  │ ← NLP Processing
│  Extraction │
└──────┬──────┘

       ├──────────────────────────────────────┐
       ▼                                      ▼
┌─────────────┐                        ┌─────────────┐
│  Entities   │                        │Relationships│
│  Detected   │                        │  Detected   │
└──────┬──────┘                        └──────┬──────┘
       │                                      │
       └──────────────────┬───────────────────┘

                   ┌─────────────┐
                   │    Neo4j    │
                   │   Storage   │
                   └─────────────┘

Entity Types

Person 👤

Individuals mentioned in documents.

PropertyDescriptionExample
nameFull name"John Smith"
roleJob title (if found)"CEO"
emailEmail address"john@acme.com"
source_docOrigin document"org_chart.pdf"

Extraction triggers:

  • Proper nouns followed by roles ("John Smith, CEO")
  • Email patterns
  • Signature blocks
  • Author metadata

Organization 🏢

Companies, departments, teams.

PropertyDescriptionExample
nameOrganization name"Acme Corporation"
typeSub-type"Company", "Department"
industrySector (if found)"Technology"

Extraction triggers:

  • Legal suffixes (Inc., LLC, Corp.)
  • Department keywords ("Sales Team", "HR Department")
  • Domain names in emails

Product 📦

Products, services, features.

PropertyDescriptionExample
nameProduct name"Widget Pro"
versionVersion number"2.1.0"
categoryProduct type"Software"

Extraction triggers:

  • Product naming patterns
  • Version numbers
  • SKU codes
  • Trademark symbols (™, ®)

Location 📍

Physical and virtual places.

PropertyDescriptionExample
nameLocation name"New York Office"
typeLocation type"Office", "Region"
addressFull address"123 Main St"

Extraction triggers:

  • Address patterns
  • City/country names
  • Building names
  • Geographic references

Event 📅

Meetings, deadlines, milestones.

PropertyDescriptionExample
nameEvent name"Q4 Planning"
dateEvent date"2026-01-15"
typeEvent type"Meeting", "Deadline"

Extraction triggers:

  • Date patterns
  • Event keywords ("meeting", "conference", "deadline")
  • Calendar references

Concept 💡

Abstract ideas, topics, categories.

PropertyDescriptionExample
nameConcept name"Data Privacy"
categoryTopic area"Compliance"

Extraction triggers:

  • Repeated themes across documents
  • Section headers
  • Tag-like patterns

Relationship Types

Common Relationships

RelationshipFromToExample
works_atPersonOrganizationJohn → Acme
managesPersonPersonSarah → John
authoredPersonDocumentJane → Report
mentionsDocumentEntityContract → Acme
part_ofEntityEntityWidget → Product Line
located_inEntityLocationOffice → New York
occurred_onEventDateMeeting → 2026-01-15
related_toEntityEntityTopic A → Topic B

Relationship Properties

Relationships can have properties:

// Example: Weighted relationship
(john:Person)-[:WORKS_AT {since: "2020", role: "CEO"}]->(acme:Organization)
PropertyDescription
sinceStart date
untilEnd date
roleRole in relationship
strengthConfidence score (0-1)
sourceOrigin document

Entity Linking

When the same entity appears in multiple documents, AgentisPro links them:

Document 1: "John Smith, CEO of Acme"
Document 2: "J. Smith presented the quarterly results"
Document 3: "CEO John Smith announced..."

→ All linked to single entity: John Smith (Person)

Linking Algorithm

  1. Exact match: Same name → 100% match
  2. Fuzzy match: Similar names → Calculate similarity
  3. Context match: Same relationships → Increase confidence
  4. User override: Manual linking/unlinking

Creating Entities Manually

Via Web UI

  1. Navigate to Knowledge Graph
  2. Click + Add Entity
  3. Fill in properties:
    • Name (required)
    • Type (required)
    • Custom properties
  4. Save

Via API

POST /knowledge-graph/entities
Content-Type: application/json
 
{
  "name": "New Customer",
  "type": "Organization",
  "properties": {
    "industry": "Healthcare",
    "size": "Enterprise"
  }
}

Creating Relationships Manually

Via Web UI

  1. Select source entity
  2. Click + Add Relationship
  3. Search for target entity
  4. Select relationship type
  5. Add properties (optional)
  6. Save

Via API

POST /knowledge-graph/relationships
Content-Type: application/json
 
{
  "source_id": "entity_123",
  "target_id": "entity_456",
  "type": "works_at",
  "properties": {
    "since": "2025-01-01"
  }
}

Editing Entities

Merge Duplicates

If the same entity was created twice:

  1. Select both entities (Ctrl+Click)
  2. Right-click → Merge Entities
  3. Choose primary entity (keeps properties)
  4. Confirm

Split Entity

If different entities were incorrectly merged:

  1. Select entity
  2. Click EditSplit
  3. Define which relationships go to each new entity
  4. Confirm

Best Practices

Naming Conventions

TypeConventionExample
PersonFull name, title case"John Smith"
OrganizationOfficial name"Acme Corporation"
ProductBrand name + version"Widget Pro 2.0"

Relationship Consistency

Use consistent relationship types:

  • works_at (not employed_by, works_for)
  • authored (not wrote, created)
  • manages (not supervises, leads)

Quality Control

Regular maintenance:

  1. Review new entities weekly
  2. Merge duplicates
  3. Delete false positives
  4. Add missing relationships

Querying Entities

Find All of Type

GET /knowledge-graph/entities?type=Person

Find by Name

GET /knowledge-graph/entities?search=John
GET /knowledge-graph/entities/{id}/related?depth=2

Next Steps