- Issue created by @kunal.sachdev
- 🇮🇳India kunal.sachdev
kunal.sachdev → changed the visibility of the branch 3533881-generateupdate-title-and to hidden.
- Merge request !1221#3533881 "Generate update metadata title for page" → (Merged) created by kunal.sachdev
- 🇺🇸United States tim.plunkett Philadelphia
This needs a rebase, kind of a big one. Though it looks like it has a bunch of merge commits in it already, so I tried merging in 0.x, and there were still conflicts.
- 🇮🇳India kunal.sachdev
Some scenarios are not working as expected so I am trying to fix it.
- 🇮🇳India kunal.sachdev
Although sometimes the title is not getting updated on the page. I checked this same issue is also there in 0.x branch so created a issue for that 🐛 Title is not update on the page when created through AI Active
- 🇮🇳India narendraR Jaipur, India
Tested manually and found some issues:
- Does not answer general questions like "What is Drupal", instead it creates page or component. Exists on 0.x as well. Issue Created 🐛 XB AI: Agent does not answer general questions correctly Active
- Once we create a title on a page (Create title on cats) and then creating a page (Add heading components with names and release years of all marvel movies starting from the infinity saga), changes title as well as metadata
- Asking to generate page when already on a page also works incorrectly
There may be other scenarios as well, but I am moving it to needs work again to test all existing features and fix mentioned issues
- 🇮🇳India kunal.sachdev
The second case mentioned in #17 📌 Generate/update title and metadata for pages created from components Active wasn't working because the
getEntityField
tool was fetching only published data. Since the page hadn’t been published, it retrieved the title as "Untitled page," which led to a new title being created unnecessarily. To resolve this, we removed thegetEntityField
tool and now pass the XB page data as context directly to all relevant toolsI’ve manually tested all scenarios locally, and everything is now working as expected.
- 🇺🇸United States tim.plunkett Philadelphia
tim.plunkett → changed the visibility of the branch 1.x to hidden.
- 🇮🇳India narendraR Jaipur, India
I think we should avoid displaying all intermediate tool messages to the user. For example, in the attached screenshot, I tried to add a title and metadata to an article. While the behaviour is correct (title and metadata changes should not apply to nodes), the message shown to the user is confusing, as they did not request this information.
- 🇮🇳India narendraR Jaipur, India
This still seems an issue.
When I manually changed title (without saving) after creating a page, I ask AIAdd heading components with names and release years of 2 marvel movies starting from the infinity saga
AI Response:I've successfully: Added two heading components for the Marvel movies with appropriate styling Generated metadata for the page since it was empty Left the existing page title as is since it was already set The components have been placed properly and the layout has been updated successfully.
But when I again asked AI
Add heading components with names and release years of 2 marvel movies starting from the infinity saga
without refreshing the page, I got responseSummary of actions taken: Successfully created two heading components with the specified Marvel movie titles Used primary style and h1 elements for proper emphasis Generated a new page title since the existing one was basic Created metadata description since it was missing All components were properly structured and saved in the layout The page now has a professional structure with clear headings for both Infinity War and Endgame, along with appropriate metadata to improve its discoverability and context.
This is wrong, as it changed title as well it is considering metadata as empty.
- 🇮🇳India kunal.sachdev
The case mentioned in #23 📌 Generate/update title and metadata for pages created from components Active was failing because the
pageData
was not getting updated with fresh values every time. I have fixed it now. - 🇮🇳India narendraR Jaipur, India
Given prompt
Add heading components with names and release years of 3 marvel movies starting from the infinity saga
and then next prompt
Add heading components with names of 3 indian football palyers
, page builder generates content again for first prompt, which is wrong. - 🇮🇳India kunal.sachdev
I tested the case mentioned in #26 📌 Generate/update title and metadata for pages created from components Active and it works as expected but after running 6-7 prompts, the AI started to behave unexpectedly.
I also tried similar prompts on version 1.x and observed the same issue there: the AI unnecessarily considers history/comments even when they’re not relevant. I have created a new issue 🐛 AI should use only necessary history/comments for each task Active to address this and I think we should prioritise fixing this issue first. - 🇮🇳India Akhil Babu Chengannur
I have added a comment. Could you please check @kunal.sachdev
- 🇮🇳India Akhil Babu Chengannur
2. Generate the page title/description accordingly:
- Check the page title and if it's untitled THEN ONLY create a title for the page using experience_builder_title_generation_agent. IMPORTANT - If the title is already present, NEVER create or change it.
- Check the page description and if it's null or empty THEN ONLY call experience_builder_metadata_generation_agent with the topic/content to create metadata for page. IMPORTANT - If the page’s description field has ANY text - no matter if it’s generic, a placeholder, low quality, or unhelpful - you must NOT create, suggest, improve, or offer to rewrite the page's metadata or description.
- Don't try to help more by creating appropriate content when metadata or title is present and it's not based on the page, if it's present that means user want it and don't need it to be changed.Is there a particular reason we're not allowing the agent to generate the title or description if they are already present?
- 🇮🇳India Akhil Babu Chengannur
I have manually tested this and added a few comments to the MR. Please check.
- 🇮🇳India Akhil Babu Chengannur
Since we are already updating the prompt of the page builder agent, I think it should be fairly easy to add capability to opt out of title/description generation instead of creating a followup issue.
I haved pushed the following changes in the latest commit: https://git.drupalcode.org/project/experience_builder/-/merge_requests/1...
1. Restructured the prompt of the page builder agent:
- Updated the primiary mission to include title and metadata generation
- Created a token for selected_component_uuid
- Asked the agent to return a normal text output when user asks to add a non existing component.
- Previously, the chat response displayed to the user in the chat widget was generated in the
message
key of the component structure YAML produced by the page builder. This has been changed. Now the agent directly outputs the message as plain text after using the tools
2. Updated the orchestrator prompt
- Removed the references to 'selected_component_uuid'
- Instructed the agent to pass complete unaltered user input to page builde tool when using it to support opting out of title and metadata generation
Also, while testing, I observed that the AI generated the response correctly, but no components were being added to the canvas. For some reason
const { data: availableComponents } = useGetComponentsQuery();
was coming back as undefined. It was working earlier. With the help of AI, I was able to fix it using the useRef hook. It's working now, but I'm not sure if it's the proper way to fix this issue. I've pushed this change as well, since without it, it was impossible to verify whether page building was working as expected.These are some videos showing how it's working now.
Tested in https://github.com/phenaproxima/xb-demo/ (With experience builder 1.x)
Model used: GPT-4.1 - 🇮🇳India kunal.sachdev
I tested it, and the issue mentioned in https://git.drupalcode.org/project/experience_builder/-/merge_requests/1... still persists.
- 🇮🇳India Akhil Babu Chengannur
I was also able to reproduce the issue highlighted by Kunal in https://git.drupalcode.org/project/experience_builder/-/merge_requests/1...
The issue appears to be with how the orchestrator agent handles the chat history. Currently the page builder agent has the following prompt to
3. **Title Generation (XB Pages Only):**
- Use `experience_builder_title_generation_agent` with contextual prompt
- Skip if the user has explicitly asked not to generate the title.
- Example: "Generate a suitable title for a page of a cookie shop"4. **Description Generation (XB Pages Only):**
- Use `experience_builder_metadata_generation_agent` with contextual prompt
- Skip if the user has explicitly asked not to generate the description/metadata.
- Example: "Generate a suitable SEO-friendly description for an ice cream shop website"So, if it is explicitly asked not to generate title or description or both, the page builder won't generate that.
But for this to work, the orchestrator must pass the complete user request without any modification, when invoking the page builder agent. The following instruction was added to the orchestrator for this.
- Important: When using the experience_builder_page_builder_agent tool, always pass the complete, unaltered user request to the tool.
If the request is a follow-up related to a previous interaction, you may add relevant context to help the tool understand it better.
However, never modify, reword, or omit any part of the user's original request.But looks like its not working as expected. For example for the user request
Add heading components with names of 3 Indian singers. Don't generate title and metadata
Orchestrator called the page builder tool with the exact prompt
Add heading components with names of 3 Indian singers. Don't generate title and metadataBut then when the next prompt was given
Add heading components with names of 3 Indian dancers. Don't generate title.Orchestration agent called the page builder with the following prompt
Add heading components with names of 3 Indian dancers. Don't generate title and metadata - 🇮🇳India kunal.sachdev
I have tested all scenarios and it's working as expected!!
- 🇮🇳India narendraR Jaipur, India
Tried testing it manually and when an image is uploaded to create component with a prompt like "Create similar component", component is getting created, but message returned to user is empty.
- 🇮🇳India kunal.sachdev
The issue mentioned in #39 📌 Generate/update title and metadata for pages created from components Active was occurring intermittently because
$agent->solve()
sometimes returned an empty string, and we were using this value as the response message. To address this, I reverted the change that used$agent->solve()
for the response message. - 🇮🇳India narendraR Jaipur, India
Tested manually and functionality seems to be working as expected. Moving it to RTBC.
-
tim.plunkett →
committed c2c7ae04 on 1.x authored by
kunal.sachdev →
Issue #3533881 by kunal.sachdev, akhil babu, narendrar: Generate title...
-
tim.plunkett →
committed c2c7ae04 on 1.x authored by
kunal.sachdev →
-
tim.plunkett →
committed 0ed9281b on 0.x authored by
kunal.sachdev →
Issue #3533881 by kunal.sachdev, akhil babu, narendrar: Generate title...
-
tim.plunkett →
committed 0ed9281b on 0.x authored by
kunal.sachdev →