AI Personal Learning
and practical guidance

Knowledge Graph Studio (WhyHow): open source platform for creating and managing knowledge graphs, with native support for RAG applications

General Introduction

Knowledge Graph Studio (KGS) is an open source platform designed to simplify the process of creating and managing RAG-native knowledge graphs. The platform provides rule-based entity parsing, modular graph construction, flexible data ingestion, and API-first design to support developers via an SDK. Whether dealing with structured or unstructured data, Knowledge Graph Studio provides users with scalable and flexible solutions for experimental and large-scale applications. Built on a NoSQL database, the platform supports fast data retrieval and easy traversal of complex relationships, and is committed to becoming a database-agnostic solution.

WhyHow (Knowledge Graph Studio): open source platform for creating and managing knowledge graphs, RAG application native support-1


 

Function List

  • Rule-based entity resolution
  • Modular mapping construction
  • Flexible data ingestion
  • API-first design with SDK support
  • Support for structured and unstructured data
  • Scalable and flexible solutions
  • Fast Data Retrieval and Complex Relational Traversal
  • Support for multiple databases

 

Using Help

Installation process

  1. Cloning Warehouse:
   git clone git@github.com:whyhow-ai/knowledge-graph-studio.git
cd knowledge-graph-studio
  1. Install the dependencies:
   pip install .
  1. Developer Installation:
   pip install -e . [dev,docs]

Quick Start

  1. Preparation:
    • OpenAI API Key
    • MongoDB Account
    • Creating Projects and Clusters in MongoDB Atlas
  2. Configure environment variables:
   cp .env.sample .env

update.envvalues in the file:

   WHYHOW__EMBEDDING__OPENAI__API_KEY=
WHYHOW__GENERATIVE__OPENAI__API_KEY=
WHYHOW__MONGODB__USERNAME=
WHYHOW__MONGODB__PASSWORD=
WHYHOW__MONGODB__DATABASE_NAME=main
WHYHOW__MONGODB__HOST=
  1. Create databases and collections:
   cd src/whyhow_api/cli/
python admin.py setup-collections --config-file collection_index_config.json
  1. Create user and API keys:
   python admin.py create-user --email  --openai-key
  1. Start the API server:
   uvicorn src.whyhow_api.main:app

Using the SDK

  1. Install the Python SDK:
   pip install whyhow
  1. Configure the WhyHow client:
   from whyhow import WhyHow
client = WhyHow(api_key='', base_url="http://localhost:8000")
  1. Create workspaces and maps:
   workspace = client.workspaces.create(name="Demo Workspace")
chunk = client.chunks.create(workspace_id=workspace.workspace_id, chunks=[Chunk(content="Example Content")])
triples = [Triple(head=Node(name="example node", label="example label"), relation=Relation(name="example relation"), tail=Node(name="example tail node", label="example tail label"), chunk_ids = [c.chunk_id for c in chunk])]
graph = client.graphs.create_graph_from_triples(name="Demo Graph", workspace_id=workspace.workspace_id, triples=triples)
  1. Query Mapping:
   query = client.graphs.query_unstructured(graph_id=graph.graph_id, query="example query")

Using Docker

  1. Build the mirror image:
   docker build --platform=linux/amd64 -t kg_engine:v1 .
  1. Run the image:
   docker run -it --rm -p 1234:8000 kg_engine:v1
May not be reproduced without permission:Chief AI Sharing Circle " Knowledge Graph Studio (WhyHow): open source platform for creating and managing knowledge graphs, with native support for RAG applications

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish