Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first draft #2690

Merged
merged 2 commits into from
Apr 20, 2023
Merged

first draft #2690

merged 2 commits into from
Apr 20, 2023

Conversation

donaldziff
Copy link
Contributor

There is a long way to go on this!

@hwchase17
Copy link
Contributor

this is awesome @donaldziff !

how are you thinking about merging this in? im pretty fine to merge in and publicize and get others feedback... unless you wanted to try to formalize/generalize some parts?

@donaldziff
Copy link
Contributor Author

If this were to go in soon, I would like to make some minor tweaks. But the current code is simplistic, and I don't want to represent it as finished, so I'm a bit embarrassed to put it in as it is.

In the longer term I'd like to:

  • add a database so the AI can find properties by embedding search rather than full-text search
  • add a semantic element to item search: full-text search works better for q-items than for properties, but it can still get confused
  • add a query planning stage at the beginning. The AI needs to think about the graph structure around the specific objects before generating sparql

But I would love to get feedback, and if getting this in sooner would help, then please give me a chance to make tweaks, and let's get it in! Here are some short-term questions:

  • If it were merged soon, would the place I chose (docs/modules/agents/agents/wikibase_agent.ipynb) be the right one?
  • I would like to formalize/generalize and write proper code like langchain/agents/agent_toolkits/sql.. But if I could get feedback sooner, that would be great. Should I enumerate some of my open questions in the notebook?
  • What forum do you recommend for feedback? A github "discussion"? Discord? Should I invite that in the notebook?
  • I am quite puzzled why the agent performs fairly predictably using davinci but becomes unpredictable using turbo or 4. It seems that those models hallucinate tool steps that are not among the possibilities I list. Do you have any ideas about that? Can this be solved by prompt engineering?

Thanks for your attention @hwchase17 !

@hwchase17
Copy link
Contributor

Yeah that place seems good for now!

  • I would like to formalize/generalize and write proper code like langchain/agents/agent_toolkits/sql.. But if I could get feedback sooner, that would be great. Should I enumerate some of my open questions in the notebook?

Yeah questions in notebook sounds great. My main questions are what parts are generalizable vs specific to this data?

  • What forum do you recommend for feedback? A github "discussion"? Discord? Should I invite that in the notebook?

i dont think we have a great/standardized way, so for now I would say whatever is most convinient for you

  • I am quite puzzled why the agent performs fairly predictably using davinci but becomes unpredictable using turbo or 4. It seems that those models hallucinate tool steps that are not among the possibilities I list. Do you have any ideas about that? Can this be solved by prompt engineering?

probably prompt engineering... have heard this from other ppl as well

@hwchase17
Copy link
Contributor

should we merge this in? updated thoguhts?

@donaldziff
Copy link
Contributor Author

Yes, it's ready to go! Thanks for your patience

@hwchase17
Copy link
Contributor

Yes, it's ready to go! Thanks for your patience

thank you! will share it tmrw

@hwchase17 hwchase17 merged commit 6adf2d1 into langchain-ai:master Apr 20, 2023
samching pushed a commit to samching/langchain that referenced this pull request May 1, 2023
There is a long way to go on this!

---------

Co-authored-by: Max Ziff <max.ziff@concur.com>
@felixocker felixocker mentioned this pull request Jul 4, 2023
hwchase17 pushed a commit that referenced this pull request Jul 5, 2023
# [SPARQL](https://www.w3.org/TR/rdf-sparql-query/) for
[LangChain](https://github.com/hwchase17/langchain)

## Description
LangChain support for knowledge graphs relying on W3C standards using
RDFlib: SPARQL/ RDF(S)/ OWL with special focus on RDF \
* Works with local files, files from the web, and SPARQL endpoints
* Supports both SELECT and UPDATE queries
* Includes both a Jupyter notebook with an example and integration tests

## Contribution compared to related PRs and discussions
* [Wikibase agent](#2690) -
uses SPARQL, but specifically for wikibase querying
* [Cypher qa](#5078) - graph
DB question answering for Neo4J via Cypher
* [PR 6050](#6050) - tries
something similar, but does not cover UPDATE queries and supports only
RDF
* Discussions on [w3c mailing list](mailto:semantic-web@w3.org) related
to the combination of LLMs (specifically ChatGPT) and knowledge graphs

## Dependencies
* [RDFlib](https://github.com/RDFLib/rdflib)

## Tag maintainer
Graph database related to memory -> @hwchase17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants