Skip to content

Document the bi-temporal knowledge graph API with examples #2

@web3guru888

Description

@web3guru888

Documentation: knowledge_graph Module API Guide

The knowledge_graph module implements a bi-temporal knowledge graph with provenance tracking, A* pathfinding, and pheromone-based learning. The implementation is solid but the API documentation is minimal.

What to do

Create docs/modules/knowledge_graph.md with:

  1. Quick start — 10-line example: create a KG, add triples, query
  2. Bi-temporal semantics — explain valid_time vs transaction_time
  3. Provenance tracking — how to attach source metadata to triples
  4. A* pathfinding — example: find shortest path between entities
  5. Pheromone learning — how edge weights evolve with use

Example to document

from asi_build.knowledge_graph import KnowledgeGraph

kg = KnowledgeGraph()
kg.add_triple(
    subject='GWT',
    predicate='is_a',
    object='consciousness_theory',
    valid_time='2026-01-01',
    confidence=0.95,
    provenance='Baars1988'
)

# Find paths
path = kg.find_path('GWT', 'IIT')
print(path)

Difficulty

🟡 Intermediate — requires reading the source code to understand the API, but no complex algorithms to implement.

Notes

This module is also used as the memory backend for the Truth Palace of Atlantis demo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions