Git Product home page Git Product logo

ai_graph_query's Introduction

Overview

This is just a learning example using a local AI to generate Cypher queries against a graph database.

Running

  1. Run docker compose build
  2. Run docker compose up -d
  3. Open ollama web ui: http://localhost:3002
  4. Click create an account and set values
  5. Click on settings > models > pull a model from ollama.com
  6. Enter llama2 and press download
  7. Open web page: http://localhost:8080
  8. Enter a question. There's an expandable section to show example queries

You can also access the Neo4J web UI at: http://localhost:7474 if you want to run queries directly

Behavior

I don't always get correct results. Sometimes it will generate correct queries, and sometimes it doesn't. Sometimes it will generate a good query, then a bad one when re-runinng the test. I've tried adding some extra examples to the prompt template, but it's causing it to blow up running any query at all. This probably requires better training, or fine tuning to get better results, or maybe some reinforced learning.

TODO

  1. Try using this LLM model instead: https://huggingface.co/monsterapi/llama2-code-generation
    1. I think we can replace the langchain LLMChain with a huggingface pipeline: https://stackoverflow.com/questions/77152888/huggingfacepipeline-and-langchain
  2. Use a different way to download the LLM file instead of requiring using ollama-ui
  3. Use a more complex database example
  4. Try switching from Neo4J to Postgres with Apache AGE

ai_graph_query's People

Contributors

jhsheets avatar jsheets-mahle avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.