• Stars
    star
    3,443
  • Rank 12,974 (Top 0.3 %)
  • Language
    Python
  • License
    MIT License
  • Created about 1 year ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Converts text input or URL into knowledge graph and displays

Note for non-coders: you can sign up for the waitlist at instagraph.ai.

InstaGraph ๐ŸŒ

Hello there, adventurous coder! Welcome to InstaGraph, your go-to application for converting text or URLs into insightful knowledge graphs. Curious about the relationships between entities in a complex topic? Feed the text to InstaGraph and voila! A beautiful knowledge graph is at your fingertips.

See example flowcharts generated by InstaGraph here.

Powered by OpenAI's GPT-3.5, this Flask application turns your text into a vividly colored graph, making it easier to visualize relationships between various entities. Enough talkingโ€”let's get started!

Author's TL;DR: If you're just looking for how the knowledge graph is generated, check out the function call parameters taking up half of main.py.

Table of Contents ๐Ÿ“š

Features ๐ŸŒŸ

  • Dynamic Text to Graph conversion.
  • Color-coded graph nodes and edges.
  • Responsive designโ€”use it on any device.
  • Super-duper user-friendly!

Installation ๐Ÿ› ๏ธ

To get started, you'll need Python and pip installed.

1. Clone the repository

git clone https://github.com/yoheinakajima/instagraph.git

2. Navigate to the project directory

cd instagraph

3. Install the required Python packages

pip install -r requirements.txt

4. Set up your OpenAI API Key

Change .env.example to .env

mv .env.example .env

Add your OpenAI API key to .env file:

OPENAI_API_KEY=your-api-key-here
Optional

Add Neo4J username, password and URL in the *.env file as well.

NEO4J_USERNAME=
NEO4J_PASSWORD=
NEO4J_URL=

5. Run the Flask app

python main.py

Navigate to http://localhost:8080 to see your app running.

Run as Container

1. Clone the repository

git clone https://github.com/yoheinakajima/instagraph.git

2. Navigate to the project docker directory

cd instagraph/docker

3.1 Run in Dev mode

docker-compose -f docker-compose-dev.yml up # Add -d flag at the end to run in background/daemon mode.

3.2 Run in Prod - Create the docker image

  • Using the gunicorn==21.2.0 to run the application in production mode
docker-compose -f docker-compose.yml up --build -d

Usage ๐ŸŽ‰

Web Interface

  • Open your web browser and navigate to http://localhost:8080.
  • Type your text or paste a URL in the input box.
  • Click "Submit" and wait for the magic to happen!

API Endpoints

  1. GET Response Data: /get_response_data

    • Method: POST
    • Data Params: {"user_input": "Your text here"}
    • Response: GPT-3.5 processed data
  2. GET Graph Data: /get_graph_data

    • Method: POST
    • Response: Graph Data
  3. GET History Data: /get_graph_history

    • Method: GET
    • Response: Graph Data

Contributing ๐Ÿค

Best way to chat with me is on Twitter at @yoheinakajima. I usually only code on the weekends or at night, and in pretty small chunks. I have lots ideas on what I want to add here, but obviously this would move faster with everyone. Not sure I can manage Github well given my time constraints, so please reach out if you want to help me run the Github. Now, here are a few ideas on what I think we should add based on comments...

  • Store knowledge graph (thx @tomasonjo! 9/13/23)
  • Pull knowledge graph from storage (thx @tomasonjo! 9/13/23)
  • Show history
  • Ability to combine two graphs
  • Ability to combine 2+ graphs from history
  • Ability to expand on a graph (thx @tomasonjo! 9/13/23)
  • Ability to expand on graph from specific nodes
  • Fuzzy matching of nodes for combining graphs (vector match + LLM confirmation)

There are a lot of "build a chart" tools out there, so instead of doing user account and custom charts, it sounds more fun for me to work on building the largest knowledge graph ever...

Before creating an Issue please refer the ISSUE_TEMPLATE provided.

License ๐Ÿ“

MIT License. See LICENSE for more information.


Enjoy using InstaGraph! ๐ŸŽ‰

More Repositories

1

babyagi

Python
19,747
star
2

wrappers_delight

A simple wrapper for OpenAI to log input/outputs.
Python
70
star
3

babyagi-2o

the simplest self-building general autonomous agent
Python
40
star
4

ditto

the simplest self-building coding agent
Python
37
star
5

who_let_the_logs_out

Automatic logging of every API & function calls
Python
17
star
6

jsondr

converts url content into JSON with a simple prefix
Python
17
star
7

llm_vs_vector

Testing speed and cost of classification via LLM or via vector embeddings
Python
16
star
8

babyagi_og

The original BabyAGI, updated with LiteLLM and no vector database reliance (csv instead)
Python
13
star
9

tangonft

I don't know what I'm doing. Help me.
JavaScript
12
star
10

quick_email_scripts

A couple scripts to grab stats from email
Python
11
star
11

GPTvsGPT

A playful script to get two AI assistants to converse using OpenAI Assistants API
Python
7
star
12

airtable_to_graph

Turns an Airtable base into a WebGL knowledge graph leveraging relational columns
Python
7
star
13

generator-template

Generative code template for PixelBeasts 10k NFT project.
Python
6
star
14

prettygraph

An experimental UI for text-to-knowledge-graph generation
HTML
5
star
15

wrappers_delight_ui

A flask UI template for reviewing logs and reflections from wrappers_delight.
Python
4
star
16

captainfunction

A Python package to dynamically load functions for OpenAI Assistant
Python
4
star
17

mindgraph

proof of concept prototype for generating and querying against a large knowledge graph with ai
Python
3
star
18

sneks-and-ladders

Discord based board game, Sneks and Ladders
Python
2
star
19

beastopia

An chat/calendar app for PixelBeass
JavaScript
1
star
20

opensea-zapier

Zapier code block for OpenSea API
JavaScript
1
star