Skip to content

add diagram generation to agent responses#1

Open
berkaymenekse wants to merge 2 commits intomololab:mainfrom
berkaymenekse:feature/diagramforresponse
Open

add diagram generation to agent responses#1
berkaymenekse wants to merge 2 commits intomololab:mainfrom
berkaymenekse:feature/diagramforresponse

Conversation

@berkaymenekse
Copy link

@berkaymenekse berkaymenekse commented Feb 27, 2026

Track used tables from the LLM response and generate a mermaid ER diagram in the streamed chat completion payload.

Track used tables from the LLM response and generate a mermaid ER diagram in the streamed chat completion payload.

Made-with: Cursor
Copy link
Member

@ParvinEyvazov ParvinEyvazov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution @berkaymenekse 🚀. Great feature, really nice addition.

I encountered two issues while testing:

  • The agent can return multiple queries in a single response. In this case, multiple diagrams should be generated, one per query.
  • A diagram is created only for the first query in the chat. If the conversation continues and a new query is generated or the previous query is modified, a new diagram is not created.

Let me know what you think. Happy to help test a follow-up update.

@ParvinEyvazov
Copy link
Member

Additional note:
The UI will soon support updating the base backend URL, so anyone will be able to connect their own local backend & test.

Added 'used_tables' and 'diagram' fields to Query and GeneratedSQL types to support relationship diagram generation. Updated related parsing and response handling to accommodate these changes. Improved documentation to reflect the new structure.
@berkaymenekse
Copy link
Author

Hi, added 'used_tables' and 'diagram' fields to Query and GeneratedSQL types to support relationship diagram generation.

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