Skip to main content

KGOps - End-to-End Knowledge Graph Operations for RAG & Data Integration

Project description

KGOps — End-to-End Knowledge Graph Builder

A Python framework for building, maintaining, and sharing knowledge graphs, with a local in-memory backend and CLI/Python API. Features like LLM-assisted extraction and multi-tenant support are planned for future releases.

Features

  • Local NetworkX backend (in-memory)
  • CLI and Python API
  • Resource management (create, query, update)
  • JSON import/export
  • Query system for traversal and filtering
  • Typed, tested, production-ready code

Planned Features

  • Neo4j integration
  • LLM extraction
  • Embeddings
  • KG Store
  • Multi-tenancy

Quick Start

Installation

pip install kgops

Initialize a project

kgops init

Basic Python usage

from kgops import KGOps, Resource

# Initialize
kg = KGOps(backend="networkx")

# Create graph
graph = kg.create_graph("my-knowledge-graph")

# Add entities
person = Resource(
    labels={"Person"},
    properties={"name": "Alice Johnson", "role": "Data Scientist"}
)

company = Resource(
    labels={"Organization"},
    properties={"name": "TechCorp", "industry": "AI"}
)

kg.add_resource(person)
kg.add_resource(company)

# Add relationship
kg.add_edge(person, company, "WORKS_AT")

# Query
neighbors = kg.query("neighbors", resource_id=person.id)
print(f"Alice is connected to {len(neighbors)} entities")

# Export
kg.save_graph("my-graph.json")

CLI examples

# Create new graph
kgops create --name "my-graph" --description "My first KG"

# Query neighbors for a resource
kgops query neighbors --resource-id <RESOURCE_ID>

Architecture

kgops/
├── core/         # core data models and logic
├── storage/      # backend implementations (NetworkX, Neo4j)
├── connector/    # data ingestion (CSV, JSON, APIs)
├── transform/    # processing and extraction
├── utils/        # utilities and helpers
└── cli/          # command line interface

├── storage/ # backend implementations (NetworkX, Neo4j) ├── connectors/ # data ingestion (CSV, JSON, APIs) ├── transforms/ # processing and extraction ├── utils/ # utilities and helpers └── cli/ # command line interface


## API Reference (high level)

- KGOps — main interface for graph operations
- Resource — graph node/entity (labels + properties)
- Dataset — collection of resources and relationships
- Edge — relationship between two resources
- MemoryStorage — NetworkX-based in-memory backend
- BaseStorage — abstract base for custom backends

## Development

### Setup
```bash
git clone https://github.com/SohamChaudhari2004/kgops
cd kgops
pip install -e ".[dev]"

Run tests and linters

pytest tests/
black kgops/
isort kgops/
flake8 kgops/
mypy kgops/

Roadmap

  • Phase 1: Core Package MVP (NetworkX, CLI, Python API) ✅
  • Phase 2: Neo4j Integration + LLM Extraction
  • Phase 3: KG Store (Private Alpha)
  • Phase 4: Multi-tenancy + Streaming
  • Phase 5: Public Release + Governance

Contributing

Contributions welcome. See CONTRIBUTING.md for guidelines.

License

MIT — see LICENSE for details.

Support


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

kgops-0.1.1.tar.gz (44.2 kB view details)

Uploaded Source

Built Distribution

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

kgops-0.1.1-py3-none-any.whl (46.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kgops-0.1.1.tar.gz
  • Upload date:
  • Size: 44.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for kgops-0.1.1.tar.gz
Algorithm Hash digest
SHA256 19f981103c22fec456c26c569141ca24eaadd60c88897596214a52ca33984c45
MD5 5c75ba33c1ac3ce748955b8476876cf1
BLAKE2b-256 31be17867d939646a3991472f14305a86a104b404abe0646c5c0e053df167ac8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kgops-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 46.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for kgops-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 02cf04c12b7a9a86d4c32cb378e4c9cac6494b845a18a651972cb26fd0e9074d
MD5 6538e5587a7b442500ae477d10f7ece1
BLAKE2b-256 067a423d0d616538d3485730e60f833d6e4d5a66dcd09f5b122e0f52ca69f7b8

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