Skip to content

add diagram generation to agent responses - #1

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

berkaymenekse wants to merge 2 commits into
mololab:mainfrom
berkaymenekse:feature/diagramforresponse

Conversation

@berkaymenekse

@berkaymenekse berkaymenekse commented Feb 27, 2026

Copy link
Copy Markdown

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

@ParvinEyvazov ParvinEyvazov left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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