https://retellai.com/?utm_source=discord&utm_medium=seo logo
SMS/Chat AI is now long pulling in past data from ...
# ❓・ai-evy-support
c
@AI Evy SMS/Chat AI is now long pulling in past data from a month ago two months ago.. do you know why?
a
Thanks for tagging me @clientele. I'll look through relevant sources and get back to you shortly.
### Answer I don't have specific documentation explaining why your SMS/Chat AI would be pulling in past data from one or two months ago. This behavior isn't described in the available sources. However, based on related discussions, here are a few possibilities to investigate: 1. **Chat session not properly ended**: SMS chats remain in an "ongoing" status until explicitly ended. [(1) ]() If previous chat sessions weren't properly closed, the agent may be referencing old conversation context. 2. **Dynamic variables or memory implementation**: If you've set up conversation history retrieval (via inbound webhooks or custom functions) , the data being fetched from your backend may be returning older records than intended. [(2) ]() 3. **Known SMS transition bug**: There's a reported issue where SMS chats can incorrectly re-use a user's previous messages after state transitions, causing duplicate or stale messages to appear in the chat history. [(3) ]() Recommended next steps: - Check if your chat sessions are being properly ended via the API - Review any custom functions or webhooks that retrieve conversation history to ensure they're filtering by appropriate date ranges - Share a chat ID with Retell support so they can investigate the specific behavior Would you like me to provide more details on any of these areas?
​ To learn more, see the sources I considered: [[1] Create Outbound SMS](https://docs.retellai.com/api-references/create-sms-chat) [[2] Need Help: SMS Transcripts Not Working](https://discord.com/channels/1186424376300679209/1434154158880981003) [[3] SMS chat incorrectly re-uses user's last message after transition](https://discord.com/channels/1186424376300679209/1442390353402662992) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy Sorry I meant the SMS/Chat API
a
Thanks for the follow-up, @clientele. I'll get back to you soon.
### Answer I don't have specific documentation explaining why the SMS/Chat API would be pulling in past data from one or two months ago. Based on the available Chat API documentation, here are key points that may help: Chat session management: - All conversation history is automatically stored in Retell's database [(1) ]() - Chat sessions have statuses:
ongoing
,
ended
, or
error
[(2) ]() - Sessions remain
ongoing
until explicitly ended via the
end-chat
API or auto-closed if that setting is enabled [(1) ]() Possible causes to investigate: 1. **Chat sessions not properly ended**: If previous sessions weren't closed, the system may still consider them active and include their context 2. **Retrieving old chat data**: When using
client.chat.retrieve()
or
client.chat.list()
, you may be pulling historical records [(3) ]() [(4) ]() Recommended actions: - Verify chat sessions are being properly ended - Check if you're inadvertently querying old chat IDs - Review any
retell_llm_dynamic_variables
or
collected_dynamic_variables
being passed that might reference old data [(2) ]() If the issue persists, I'd recommend sharing a specific
chat_id
with Retell support so they can investigate the behavior on their end. Would you like details on how to properly end chat sessions or filter chat data by timestamp?
​ To learn more, see the sources I considered: [[1] Create Chat Completion](https://docs.retellai.com/deploy/create-chat-completion) [[2] Create Chat](https://docs.retellai.com/api-references/create-chat) [[3] Get Chat](https://docs.retellai.com/api-references/get-chat) [[4] List Chat](https://docs.retellai.com/api-references/list-chat) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
c
@AI Evy no the issue isnt with chat sessions as im getting 0 chat records for all previous months. I get current month just fine though.
a
Thanks for the follow-up, @clientele. I'll get back to you soon.
### Answer I don't have documentation explaining why you'd be getting 0 chat records for previous months while current month data returns correctly. The available sources cover creating, retrieving, and listing chats/chat agents, but don't document data retention policies, storage limits, or time-based filtering behavior that would explain this issue. [(1) ]() [(2) ]() [(3) ]() This appears to be a backend/data storage issue that isn't covered in the public API documentation. I'd recommend reaching out to Retell support directly with: - Your account details - Specific date ranges where data is missing - Example
chat_id
values (if you have any from older months) Check out these potentially useful sources: - [Create Chat]() - [Get Chat]() - [Contact Sales]() Would you like a general answer based on my knowledge, or do you have any other details about how you're querying the data?
​ To learn more, see the sources I considered: [[1] Create Chat](https://docs.retellai.com/api-references/create-chat) [[2] Get Chat](https://docs.retellai.com/api-references/get-chat) [[3] List Chat Agents](https://docs.retellai.com/api-references/list-chat-agents) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.