writer-framework icon indicating copy to clipboard operation
writer-framework copied to clipboard

Added WriterQuestionToKG and tests block for querying knowledge graphs

Open jayyuwriter opened this issue 10 months ago • 1 comments

Add WriterQuestionToKG Block

This PR adds a new Workflow block that enables querying multiple knowledge graphs. Does not include an SVG logo at this time.

Features

  • Query one or multiple knowledge graphs using comma-separated UUIDs
  • Support for subqueries option
  • Full error handling for missing or invalid inputs
  • Direct integration with Writer AI SDK for graph queries

Implementation Details

  • Uses WriterAIManager.acquire_client() for direct SDK access
  • Handles multiple graph IDs via comma-separated string parsing
  • Returns full Question response object with answer and subqueries
  • Configurable subqueries option (yes/no)

Testing

Added comprehensive test suite covering:

  • Single graph query
  • Multiple graph queries
  • Subqueries enabled/disabled
  • Error handling for:
    • Missing graph IDs
    • Empty graph IDs
    • Missing questions
    • Empty questions
    • Missing required fields

jayyuwriter avatar Feb 10 '25 19:02 jayyuwriter

Let's reconvene when @mmikita95 makes the necessary changes so that you can avoid using the SDK directly

ramedina86 avatar Feb 19 '25 11:02 ramedina86

We've built dedicated KG blocks with more traceability

ramedina86 avatar May 06 '25 08:05 ramedina86