Agent Hallucinating Resume Information Despite Exp...
# support
a
CALL ID: 5dbd5675-67b4-4f21-9dc7-a403474a782a **Environment**: VAPI SDK Version: Using CDN script https://cdn.jsdelivr.net/gh/VapiAI/html-script-tag@latest/dist/assets/index.js Framework: Next.js/React Integration Type: Custom widget implementation **Description**: We're experiencing a critical issue where our VAPI agent is consistently hallucinating fake resume information despite our explicit instructions not to do so. The agent invents companies like "XYZ Corp" and "ABC Inc" and roles like "project coordinator" and "business analyst" that do not exist in the user's resume. Technical Details: We're successfully fetching resume data from our API and passing it to VAPI Console logs confirm the correct resume data is available before initialization We're explicitly setting a detailed system message with the exact resume data We've attempted multiple configuration approaches including: - Using a custom workflow with API requests - Using direct systemMessage and initialMessage parameters - Setting workflowId: null to bypass workflow - Using explicit messages array with system and assistant roles - Adding specific examples of forbidden responses Expected behavior: The agent should ONLY reference companies and roles that exist in the resume that is passed in an API request during the workflow Actual behavior: The agent consistently hallucinates fake companies ("XYZ Corp", "ABC Inc") and roles ("project coordinator", "business analyst") not present in the resume. Request: We need guidance on how to properly configure VAPI to respect the exact system message instructions and prevent hallucination of resume details. Any insights on potential conflicts between our configuration and how VAPI processes system messages would be greatly appreciated. https://cdn.discordapp.com/attachments/1351001830473072700/1351001830813077554/Screenshot_2025-03-17_at_1.16.19_AM.png?ex=67d8ca00&is=67d77880&hm=907ba6c4c71a69740c0353488d99a1b8645bbd796898ab400f92ebc077e26e73& https://cdn.discordapp.com/attachments/1351001830473072700/1351001831429509140/Screenshot_2025-03-17_at_1.16.39_AM.png?ex=67d8ca01&is=67d77881&hm=430a0158d0708cd5426529a9d0c52302efb4b9afc9b2f9b3f6393606532306f6&
s
Can you ask the agent the exact resumeData it is reciecing? Go into the call logs and look at the messages. It will show you what the system prompt was and if the resume data was actually present
s
@Ali can you try removing the spaces in {{ resumeData }} so that it reads {{resumeData}}, unlikely to fix it, but that is a variable that could introduce issues
Do the call logs not show the message where you provided the resume data?
a
When you click insert variable it usually insert it with the spaces. Just tried removing them, it's not working.
The resume is fetched through a GET API request it's not hardcoded and it seems like the agent can't access it for some reasons. Tried through a workflow (what I'm testing now), a query tool, a function etc but still having the same issue
s
Intersting, I don't have much context around what's happenign so forgive me for asking silly questions. How is the agent actually recieving the data, does the whole response just get plugged into that variable?
If so, what does the response look like?
a
Our API endpoint sends a JSON that looks like: { user: { id: string; nickname: string; skills: string[]; }; resume: { current_role: string; current_company: string; experiences: Experience[]; education: Education[]; certifications: Certification[]; skills: string[]; summary: string; // This is a formatted text summary } } The entire JSON response from our API gets stored in the resumeData variable -> The body key in the output configuration of the GET API request tells VAPI to take the response body (the JSON data) and store it in the resumeData variable. Let me know if I'm doing somethig wrong https://cdn.discordapp.com/attachments/1351001830473072700/1351082424456577087/Screenshot_2025-03-17_at_6.38.09_AM.png?ex=67d9150f&is=67d7c38f&hm=c830a8aab8e1ebfddb616c649406ef2c0e8ad56ed02ca5c71e00b49f021dc662&
s
@Ali @SlaviSavanovic Looking into it...
@Ali @SlaviSavanovic I looked into your workflow, you have to set the API request node mode to be
blocking
for it wait for the API response before moving to the next node.
a
Hi @Shubham Bajaj thanks for looking into it, testing with blocking mode, will get back to you
Hi @Shubham Bajaj I tried with the blocking mode, but still not getting the desired result unfortunately
Is there another way (other than the workflow) to give context to the voice agent dynamically (fetching the resume stored in supabase based on the user id in supabase through my app)
p
Hey Ali, you can either fire and retrieve it with a sync function, or you could also inject the information in using live call control:
a
Hi Mason, thank you, I will try both and get back to you
p
Sounds good!
a
Hi Mason, was able to solve it using the live call control! Thanks again for you help