Metadata-Version: 2.4
Name: coreason_graph_nexus
Version: 0.3.1
Summary: orchestration engine for knowledge graph
License: # The Prosperity Public License 3.0.0
         
         Contributor: CoReason, Inc.
         
         Source Code: https://github.com/CoReason-AI/coreason_graph_nexus
         
         ## Purpose
         
         This license allows you to use and share this software for noncommercial purposes for free and to try this software for commercial purposes for thirty days.
         
         ## Agreement
         
         In order to receive this license, you have to agree to its rules.  Those rules are both obligations under that agreement and conditions to your license.  Don't do anything with this software that triggers a rule you can't or won't follow.
         
         ## Notices
         
         Make sure everyone who gets a copy of any part of this software from you, with or without changes, also gets the text of this license and the contributor and source code lines above.
         
         ## Commercial Trial
         
         Limit your use of this software for commercial purposes to a thirty-day trial period.  If you use this software for work, your company gets one trial period for all personnel, not one trial per person.
         
         ## Contributions Back
         
         Developing feedback, changes, or additions that you contribute back to the contributor on the terms of a standardized public software license such as [the Blue Oak Model License 1.0.0](https://blueoakcouncil.org/license/1.0.0), [the Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0.html), [the MIT license](https://spdx.org/licenses/MIT.html), or [the two-clause BSD license](https://spdx.org/licenses/BSD-2-Clause.html) doesn't count as use for a commercial purpose.
         
         ## Personal Uses
         
         Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, doesn't count as use for a commercial purpose.
         
         ## Noncommercial Organizations
         
         Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution doesn't count as use for a commercial purpose regardless of the source of funding or obligations resulting from the funding.
         
         ## Defense
         
         Don't make any legal claim against anyone accusing this software, with or without changes, alone or with other technology, of infringing any patent.
         
         ## Copyright
         
         The contributor licenses you to do everything with this software that would otherwise infringe their copyright in it.
         
         ## Patent
         
         The contributor licenses you to do everything with this software that would otherwise infringe any patents they can license or become able to license.
         
         ## Reliability
         
         The contributor can't revoke this license.
         
         ## Excuse
         
         You're excused for unknowingly breaking [Notices](#notices) if you take all practical steps to comply within thirty days of learning you broke the rule.
         
         ## No Liability
         
         ***As far as the law allows, this software comes as is, without any warranty or condition, and the contributor won't be liable to anyone for any damages related to this software or this license, under any kind of legal claim.***
License-File: LICENSE
License-File: NOTICE
Author: Gowtham A Rao
Author-email: gowtham.rao@coreason.ai
Requires-Python: >=3.11
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Dist: aiofiles (>=25.1.0,<26.0.0)
Requires-Dist: anyio (>=4.12.1,<5.0.0)
Requires-Dist: httpx (>=0.28.1,<0.29.0)
Requires-Dist: loguru (>=0.7.2,<0.8.0)
Requires-Dist: neo4j (>=6.1.0,<7.0.0)
Requires-Dist: networkx (>=3.6.1,<4.0.0)
Requires-Dist: numpy (>=2.4.1,<3.0.0)
Requires-Dist: pyarrow (>=23.0.0,<24.0.0)
Requires-Dist: pydantic (>=2.12.5,<3.0.0)
Requires-Dist: pydantic-settings (>=2.12.0,<3.0.0)
Requires-Dist: pyyaml (>=6.0.3,<7.0.0)
Requires-Dist: redis (>=7.1.0,<8.0.0)
Requires-Dist: scikit-learn (>=1.8.0,<2.0.0)
Requires-Dist: scipy (>=1.17.0,<2.0.0)
Project-URL: Documentation, https://github.com/CoReason-AI/coreason_graph_nexus
Project-URL: Homepage, https://github.com/CoReason-AI/coreason_graph_nexus
Project-URL: Repository, https://github.com/CoReason-AI/coreason_graph_nexus
Description-Content-Type: text/markdown

# coreason-graph-nexus

> **The Graph Orchestration & Reasoning Engine**

[![Organization](https://img.shields.io/badge/org-CoReason--AI-blue)](https://github.com/CoReason-AI)
[![License: Prosperity 3.0](https://img.shields.io/badge/license-Prosperity%203.0-blue)](https://prosperitylicense.com/versions/3.0.0)
[![CI](https://github.com/CoReason-AI/coreason-graph-nexus/actions/workflows/ci.yml/badge.svg)](https://github.com/CoReason-AI/coreason-graph-nexus/actions)
[![Code Style: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Documentation](https://img.shields.io/badge/docs-Product%20Requirements-green)](docs/product_requirements.md)

**coreason-graph-nexus** acts as the "Platinum Layer" Builder and Graph Logic Engine. It bridges the gap between persistent graph storage (Neo4j) and high-speed in-memory reasoning (NetworkX), ensuring robust data ingestion, ontology alignment, and advanced algorithmic analysis.

---

## 🚀 Features

*   **Hybrid Compute Architecture:** Seamlessly moves data between Cold Storage (Neo4j) and Hot Compute (NetworkX) for on-demand analysis.
*   **Projection Engine (The Builder):** Declarative ETL pipeline that transforms raw data into a semantic graph, enforcing schema constraints.
*   **Ontology Resolver (The Librarian):**  Standardizes entity identities (e.g., merging "Tylenol" and "APAP") with high-performance Redis caching.
*   **Graph Computer (The Thinker):** Executes complex algorithms like PageRank, Betweenness Centrality, and Community Detection in memory.
*   **Link Predictor (The Analyst):** Infers implicit relationships using both heuristic rules and semantic vector embeddings.

## 📦 Installation

```bash
pip install coreason-graph-nexus
```

## 🛠️ Usage

Here is a quick example of how to initialize the client and run a PageRank analysis:

```python
from coreason_graph_nexus.adapters.neo4j_adapter import Neo4jClient
from coreason_graph_nexus.compute import GraphComputer
from coreason_graph_nexus.models import GraphAnalysisRequest, AnalysisAlgo

# 1. Initialize Connection
neo4j_auth = ("neo4j", "password")
with Neo4jClient(uri="bolt://localhost:7687", auth=neo4j_auth) as client:

    # 2. Initialize the Graph Computer
    computer = GraphComputer(client)

    # 3. Define Analysis Request
    request = GraphAnalysisRequest(
        center_node_id="RxNorm:123",
        algorithm=AnalysisAlgo.PAGERANK,
        depth=2,
        write_property="pagerank_score"
    )

    # 4. Run Analysis
    results = computer.run_analysis(request)
    print(f"Computed PageRank for {len(results)} nodes.")
```

## 📄 License

This software is dual-licensed. It is available under the **Prosperity Public License 3.0** for open-source and non-commercial use. Commercial use beyond a 30-day trial requires a separate license.

Copyright (c) 2025 CoReason, Inc.

