Patent attributes
In one embodiment, a method includes receiving a user query from a client system associated with a first user, executing tasks via agents which return responses, each response comprising information items, analyzing the responses to determine slots, each slot corresponding to one of the information items, determining compositional sub-goals for each response, wherein each compositional sub-goal indicates a semantic-intent of the respective response, generating compositional fragments by a compositional natural-language generation (NLG) model, each compositional fragment comprising a partial natural-language response, determining a top-level compositional goal, generating a communication content by the compositional NLG model, wherein the communication content comprises a complete natural-language response to the user query, and wherein the complete natural-language response is based on the partial natural-language responses of the compositional fragments, and sending instructions for presenting the communication content to the client system.