Lets create some data to my neo4j database.
Add a list of 6 Products for a smart glasses company with the properties:
- id (integer starting from 1)
- name (a simple name of the product)
- msrp_usd (sale price of the product in USD)
| #!/usr/bin/env python3 | |
| """ | |
| Simple Neo4j GraphRAG implementation using OpenAI embeddings and LLM | |
| Installation instructions: | |
| python -m venv venv | |
| source venv/bin/activate | |
| pip install neo4j 'neo4j-graphrag[openai]' | |
| """ |
| from neo4j import GraphDatabase | |
| # Read-only credentials | |
| URI = "neo4j+s://demo.neo4jlabs.com" | |
| USERNAME = "goodreads" | |
| PASSWORD = "goodreads" | |
| DATABASE = "goodreads" | |
| def main(query, params): | |
| with GraphDatabase.driver(URI, auth=(USERNAME, PASSWORD)) as driver: |
Generate a .csv listing 6 customer service agents with the following column headers: id (single integer starting with 1), name, email, bio (short description of professional history and technical background), hired_at (use an ISO 8601 compatible datetime string for UTC / GMT 0)
Generate a .csv listing 12 customers with the following column headers: id (single integer starting with 1), name, email, customer_since (use an ISO 8601 compatible datetime string for UTC / GMT 0)
Generate a .csv listing 24 customer tickets detailing issues clients are having with a company's software product. Use the following column headers: id (single integer starting with 1), title, content (short description of problem), customer_id (random integer between 1 and 12 using normal distribution / bell curve), assiged_to (random integer between 1 and 6 with a normal / bell curve distribution), opened_at (use an ISO 8601 compatible datetime string for UTC / GMT 0), resolved_at (use an ISO 8601 compat
| import streamlit as st | |
| from st_cytoscape import cytoscape | |
| from baml_client import b | |
| import json | |
| # Set page config | |
| st.set_page_config(layout="wide") | |
| def process_graph_result(result): | |
| """Convert BAML graph result to cytoscape elements format""" |
| from neo4j import GraphDatabase | |
| import sys | |
| def update_node_names(uri, user, password, target, replace_with): | |
| driver = GraphDatabase.driver(uri, auth=(user, password)) | |
| def update_name(tx, target, replace_with): | |
| query = ( | |
| "MATCH (n) " | |
| "WHERE n.name = $target " |
| from fastapi import FastAPI, HTTPException | |
| from pydantic import BaseModel | |
| import assemblyai as aai | |
| from neo4j import GraphDatabase | |
| from dotenv import load_dotenv | |
| import os | |
| # Load environment variables | |
| load_dotenv() |
| import assemblyai as aai | |
| from neo4j import GraphDatabase | |
| aai.settings.api_key = "<ASSEMBLYAI_API_KEY>" | |
| audio_file = "https://assembly.ai/wildfires.mp3" | |
| # audio_file = "./local_file.mp3" #syntax for using a local file | |
| config = aai.TranscriptionConfig(entity_detection=True) | |
| transcript = aai.Transcriber().transcribe(audio_file, config) |
| from rushdb import RushDB | |
| # Initialize the RushDB client | |
| client = RushDB( | |
| "<your_locally_generated_api_key>", | |
| base_url="http://localhost:3000", | |
| ) | |
| # Simple - Create a single Node | |
| single_record = { |
| @prefix : <http://www.semanticweb.org/srikargadusu/ontologies/2025/0/untitled-ontology-10/> . | |
| @prefix owl: <http://www.w3.org/2002/07/owl#> . | |
| @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | |
| @prefix xml: <http://www.w3.org/XML/1998/namespace> . | |
| @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | |
| @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | |
| @base <http://www.semanticweb.org/srikargadusu/ontologies/2025/0/untitled-ontology-10/> . | |
| <http://www.semanticweb.org/srikargadusu/ontologies/2025/0/untitled-ontology-10> rdf:type owl:Ontology . |