Skip to main content

End-to-End Knowledge Graph Builder for RAG & Sharing

Project description

KGForge — 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 kgforge

Initialize a project

kgforge init

Basic Python usage

from kgforge import KGForge, Resource

# Initialize
kg = KGForge(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
kgforge create --name "my-graph" --description "My first KG"

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

Architecture

kgforge/
├── 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)

- KGForge — 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/kgforge/kgforge
cd kgforge
pip install -e ".[dev]"

Run tests and linters

pytest tests/
black kgforge/
isort kgforge/
flake8 kgforge/
mypy kgforge/

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.0.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.0-py3-none-any.whl (46.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for kgops-0.1.0.tar.gz
Algorithm Hash digest
SHA256 828a272b42885b7ca8a3e8b80a1558e3b0eea9fd50e22e198a5d0a9c5d2b66f0
MD5 3fcd23ff2a6e5285fc794c9c94db9cf1
BLAKE2b-256 acaca18e15d7815a6b3b72737816547a7ba5ba7e251fdbc559c3909afb9584fe

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for kgops-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c3da3aa8dfcef38b45faff8e1ecf2ddaa7925b256d8cd8365ab1ba92550a040
MD5 ae1655dbef81c0df5b1fce034251ecbb
BLAKE2b-256 7aae95aebfe9a95387123c48b1d4a0951a5d91546a543a788e657719aa1149c8

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