Skip to content

In this tutorial, you'll visualize facts about Space Exploration and Astrophysics as a semantic knowledge graph using Google Cloud SQL (PostgreSQL), `pgvector`, and `pyvis`.

License

Notifications You must be signed in to change notification settings

billyjacobson/cloud-sql-pgvector-graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Postgres Visual Semantic Knowledge Graph (Cloud SQL)

Space Graph

Overview

In this tutorial, you'll visualize facts about Space Exploration and Astrophysics as a semantic knowledge graph using Google Cloud SQL (PostgreSQL), pgvector, and pyvis.

The steps performed include:

  • Configure a Google Cloud SQL (PostgreSQL) instance.
  • Enable the pgvector extension for vector similarity search.
  • Generate semantic embeddings for text data using sentence-transformers.
  • Store and query vector data in PostgreSQL.
  • Visualize the relationships between data points using pyvis.

Costs

This tutorial uses billable components of Google Cloud:

  • Cloud SQL: Costs are associated with the instance size and storage used.

Learn about Cloud SQL pricing and use the Pricing Calculator to generate a cost estimate based on your projected usage.

Features

  • Vector Search: Uses pgvector to find semantically similar facts based on embeddings generated by sentence-transformers.
  • Interactive Visualization: Renders a dynamic, physics-based graph using pyvis where nodes are facts and edges represent semantic similarity.
  • Secure: Configured to use Google Colab's userdata for secure credential management.

Prerequisites

Before running the notebook, ensure you have:

  1. Google Cloud Project: A GCP project with billing enabled.
  2. Cloud SQL Instance: A PostgreSQL instance (version 15+) with pgvector supported.
  3. Database Credentials:
    • Connection Name (e.g., project:region:instance)
    • Database User
    • Database Password
    • Database Name

About

In this tutorial, you'll visualize facts about Space Exploration and Astrophysics as a semantic knowledge graph using Google Cloud SQL (PostgreSQL), `pgvector`, and `pyvis`.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published