Skip to main content

OntoSight: A flexible, AI-ready visualization engine for interactive knowledge graphs and hypergraphs.

Project description

OntoSight 🔍

OntoSight Banner

PyPI Version Python Version License Interactive UI

English | 简体中文

Interactive Visualization Engine for AI-Enhanced Knowledge Graphs & Hypergraphs

OntoSight is a lightweight yet powerful Python library designed to bridge the gap between static graph visualizations and dynamic AI-driven exploration. It allows developers to create highly interactive, searchable, and "chat-ready" visualizations for complex knowledge structures with just a few lines of code.


🌟 Key Features

  • Three Visualization Types:
    • Graphs (view_graph): Traditional node-edge networks for pairwise relationships
    • Hypergraphs (view_hypergraph): Multi-node relationships and complex pathways
    • Nodes (view_nodes): Pure entity collections without edges - perfect for archives, semantic spaces, and clusters
  • AI-Ready Callbacks: Flexible on_search and on_chat hooks to integrate with any LLM (GPT-4, Claude, Llama 3) or Vector Database (Milvus, Pinecone, Chroma).
  • Interactive Exploration: Built-in detail panels, filtering, and real-time highlighting.
  • Framework Agnostic: Works with any data source. Define your schema using Pydantic and let OntoSight handle the rest.
  • Developer First: Python-native API with automatic web-server management and browser launching.

🚀 Quick Start

Installation

pip install ontosight

📸 Visualization Modes

1. Standard Knowledge Graphs (view_graph)

Traditional node-edge networks for pairwise relationships. Best for social networks, dependency graphs, and classic KGs.

Main View Intelligent Search AI Chat
from pydantic import BaseModel
from ontosight import view_graph

class Entity(BaseModel):
    name: str
    type: str

nodes = [Entity(name="Alice", type="Person"), Entity(name="Wonderland", type="Place")]
edges = [{"source": "Alice", "target": "Wonderland", "label": "visits"}]

view_graph(
    node_list=nodes,
    edge_list=edges,
    node_id_extractor=lambda n: n.name,
    node_ids_in_edge_extractor=lambda e: (e["source"], e["target"])
)

2. Multi-Dimensional Hypergraphs (view_hypergraph)

Visualize relationships that connect more than two entities. Perfect for collaborative networks, chemical reactions, or complex logical pathways.

Main View Intelligent Search AI Chat
from ontosight import view_hypergraph

# A hyperedge connects multiple nodes
hyperedges = [{"id": "he1", "members": ["A", "B", "C"], "label": "Collaboration"}]

view_hypergraph(
    node_list=[{"id": "A"}, {"id": "B"}, {"id": "C"}],
    edge_list=hyperedges,
    node_id_extractor=lambda n: n["id"],
    node_ids_in_edge_extractor=lambda e: e["members"]
)

3. Entity Archives & Semantic Spaces (view_nodes)

Pure entity collections without explicit edges. Use force-clustering and semantic search to explore large-scale archives or embedding spaces.

Main View Intelligent Search AI Chat
from ontosight import view_nodes

recipes = [
    {"name": "Pasta", "cuisine": "Italian"},
    {"name": "Sushi", "cuisine": "Japanese"}
]

view_nodes(
    node_list=recipes,
    node_id_extractor=lambda r: r["name"],
    node_label_extractor=lambda r: r["name"]
)

🧠 AI Integration (The "Sight" in OntoSight)

OntoSight is built for the Age of AI. While it doesn't ship with a specific LLM, it provides the "plumbing" to make your graph interactive and intelligent.

Flexible Search (Vector DB Ready)

You can define a custom search callback to perform semantic search using embedding models.

def my_vector_search(query: str):
    # Logic to call your Vector DB (e.g., Milvus)
    # returns matching_nodes, matching_edges
    pass

view_graph(..., on_search=my_vector_search)

Chat

Connect a Chat interface directly to your Graph. When a user asks a question, the LLM can provide a textual answer, and OntoSight will auto-highlight the relevant subgraph.

def my_chat_handler(question: str):
    # 1. Send question to LLM (e.g., GPT-4)
    # 2. Get relevant nodes/edges from your Retrieval logic
    return "Alice is in Wonderland.", (relevant_nodes, relevant_edges)

view_graph(..., on_chat=my_chat_handler)

🛠 Advanced Features

  • Schema-Driven Detail Panels: Automatically generates UI panels based on your Pydantic models.
  • Hypergraph Modeling: Visualize relationships between multiple nodes simultaneously.

📄 License

OntoSight is released under the Apache License 2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ontosight-0.1.6.tar.gz (2.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ontosight-0.1.6-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

Details for the file ontosight-0.1.6.tar.gz.

File metadata

  • Download URL: ontosight-0.1.6.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ontosight-0.1.6.tar.gz
Algorithm Hash digest
SHA256 3bf4b55267a6b7acdb7069afdfa749ef0d02df89eb03c8cffc4798ec37f4a6ed
MD5 627f4be129feeb9f856ca2c7ca04b3f5
BLAKE2b-256 ed5f76a732bb8ee1fb406cc277ba742797efd7496c8d34c126c33bfa67d36a7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for ontosight-0.1.6.tar.gz:

Publisher: publish-pypi.yml on yifanfeng97/ontosight

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ontosight-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: ontosight-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ontosight-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f6aa3c2064d6a2f081c67977b2d866aa6c206fa0b8e7d4508edbda535a5f3a80
MD5 28e23b7b241b4e7309f0312f9ec2dddd
BLAKE2b-256 840307ee6d958777ba929e7f2b9b73c59e624163d5b7816f89d7c858317b8e6e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ontosight-0.1.6-py3-none-any.whl:

Publisher: publish-pypi.yml on yifanfeng97/ontosight

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page