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

[EPIC] - GraphQL Agent #29

Open
4 tasks
amirhouieh opened this issue Dec 6, 2023 · 1 comment
Open
4 tasks

[EPIC] - GraphQL Agent #29

amirhouieh opened this issue Dec 6, 2023 · 1 comment
Assignees
Labels
epic feature supported feature help wanted Extra attention is needed p:low

Comments

@amirhouieh
Copy link
Member

amirhouieh commented Dec 6, 2023

Train a Language Model for Converting Human Queries to GraphQL for Unbody GraphQL Content API

Objective

Train a language model to accurately translate natural language queries into GraphQL queries, in line with our data schemas and syntax used in the Unbody GraphQL endpoint built on Weaviate.

Tasks

  • Create a Training Dataset @amirhouieh: Develop a dataset with examples of natural language and corresponding GraphQL queries.
  • Model Training @amirhouieh: Train the model for translating human language to GraphQL format.
  • Integration @jeangovil: Integrate the trained model with our GraphQL content API.
  • Deployment @jeangovil: Deploy the model for operational use.

How It Should Work

  1. Receive a query in natural language.
  2. Language model agent generates a GraphQL query.

GraphQL Level Implementation

Implement a new Agent method alongside GET and AGGREGATE methods to translate natural language inputs to structured GraphQL queries.

Examples

Find our financial reports for the last two years

{
  Get {
    PdfFile(
      nearText: {
        concepts: ["financial report"]
      },
      filter: {
        operator: GreaterThan,
        path: ["metadata.creationDate"],
        valueDate: "2020-01-01"
      }
    ) {
      title
      metadata {
        creationDate
      }
    }
  }
}

Who is working on the LPE project

{
  Get {
    NameEntities(
      where: {
        operator: And
        operands: [
          { path: ["type"], operator: Equal, valueString: "person" },
          { path: ["type"], operator: Equal, valueString: "email" },
          { path: ["document.title"], operator: Like, valueString: "LPE project" }
        ]
      }
    ) {
      crossReference {
        ... on GoogleDoc {
          title
        }
        ... on PdfFile {
          title
        }
        ... on Markdownfile {
          title
        }
      }
    }

    TextBlocks(
      where: {
        path: ["mentions"],
        operator: Like,
        valueString: "LPE project"
      }
    ) {
      mentions
      document {
        ... on GoogleDoc {
          title
        }
        ... on PdfFile {
          title
        }
        ... on Markdownfile {
          title
        }
      }
    }
  }
}

Summarize my recent emails with Nicole

{
  Get {
    GmailThread(
      nearText: {
        concepts: ["emails with Nicole"]
      },
      filter: {
        operator: GreaterThan,
        path: ["metadata.creationDate"],
        valueDate: "recent_date"
      }
    ) {
      content
      _additional {
        generate(
          singleResult: {
            prompt: """
            Summarize the conversation:
            {content}
            """
          }
        ) {
          singleResult
        }
      }
    }
  }
}

When are we going to launch city hall portal

{
  Get {
    GoogleCalendarEvent(
      nearText: {
        concepts: ["city hall portal"],
        properties: ["title", "description", "attachments"]
      }
    ) {
      title
      startDate
      endDate
      _additional {
        generate(
          singleResult: {
            prompt: """
            Analyze the event details: {title}, {startDate}, {endDate}.
            Answer the question: When are we going to launch the city hall portal?
            """
          }
        ) {
          singleResult
        }
      }
    }
  }
}
@amirhouieh amirhouieh added help wanted Extra attention is needed feature supported feature labels Dec 6, 2023
@amirhouieh amirhouieh added this to the Q4 2023 milestone Dec 6, 2023
@amirhouieh amirhouieh removed this from the Q4 2023 milestone Jan 13, 2024
@amirhouieh amirhouieh moved this to Backlog in Roadmap Jan 13, 2024
@amirhouieh
Copy link
Member Author

@amirhouieh amirhouieh moved this from Backlog to Icebox in Roadmap Apr 18, 2024
@jeangovil jeangovil changed the title Unbody graphQl agent [EPIC] - GraphQL Agent Jun 21, 2024
@jeangovil jeangovil added the epic label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic feature supported feature help wanted Extra attention is needed p:low
Projects
Status: Icebox
Development

No branches or pull requests

2 participants