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

  • Standard & Hypergraph Support: Seamlessly switch between traditional node-edge graphs and advanced hypergraphs.
  • 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.

📸 Visualization Previews

1. Core Architectures

OntoSight supports both traditional graphs and hypergraphs with a unified interface.

Graph Hypergraph

2. Intelligent Search (Vector DB Ready)

Define custom search callbacks to highlight matching subgraphs via embedding-based retrieval.

Search in Graph Search in Hypergraph

3. GraphRAG & AI Chat

Seamlessly connect your Graph to LLMs. Auto-highlight relevant entities while generating textual answers.

AI Chat (Graph) AI Chat (Hypergraph)

🚀 Quick Start

Installation

pip install ontosight

Basic Usage

Define your data structure using Pydantic models:

from pydantic import BaseModel
from ontosight import view_graph

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

class Relation(BaseModel):
    source: str
    target: str
    relation: str

# Your data
nodes = [Entity(name="Alice", type="Person"), Entity(name="Wonderland", type="Place")]
edges = [Relation(source="Alice", target="Wonderland", relation="visits")]

# Launch visualization
view_graph(
    node_list=nodes,
    edge_list=edges,
    node_schema=Entity,
    edge_schema=Relation,
    node_id_extractor=lambda n: n.name,
    node_ids_in_edge_extractor=lambda e: (e.source, e.target),
    edge_label_extractor=lambda e: e.relation
)

🧠 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)

GraphRAG & 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.1.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.1-py3-none-any.whl (2.9 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ontosight-0.1.1.tar.gz
  • Upload date:
  • Size: 2.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ontosight-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7b6800f595946cfce5366008d7f048d46b433e05f2aef362489a7ce51dbc308e
MD5 510980aab0fd1147d23a50467d1ee9c9
BLAKE2b-256 7169825c5e9cff4f35497ec0d22b24d39315d296c438dfd1198fdc35612eb54d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ontosight-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ontosight-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 470d6ca92dd107fc3beabb1cf254389028e46b0d1fb91b0a7bd45f1fb37ea8c1
MD5 078f88f7b0b090935e41eea0484e59b1
BLAKE2b-256 1c5a38812bdeded540d5a367a279347d88985c2e4198d125a45f369cb1f2bb80

See more details on using hashes here.

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