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.2.tar.gz (50.1 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.2-py3-none-any.whl (50.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kgops-0.1.2.tar.gz
  • Upload date:
  • Size: 50.1 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.2.tar.gz
Algorithm Hash digest
SHA256 31c3340b3d974cacc5ebd1104613d3fbf517f26439455e9c1e5d451f88f80faf
MD5 1c1987fa4bcd5480b45d09255672334c
BLAKE2b-256 667c05cc6e24fa260af8e36c0c88cb182784ac525b94e498241485b9a4d83b84

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kgops-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 50.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dcfa2fa9728efb2c040db459149c32d41d7e7fb1cc56fc9011fdc50ef294940c
MD5 41109dd32969a15d021f00ed70ddc6ab
BLAKE2b-256 1b8046997a818305ed7346ac08e0a31eef922dfae3a28dbbe8ae7ae290e41320

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