# Smart Agent: input length and 'max\_tokens' exceed context limit

**URL:** <https://community.fibery.io/t/smart-agent-input-length-and-max-tokens-exceed-context-limit/8839>\
**Category:** Bugs & Issues\
**Tags:** ai\
**Created:** [May 21, 2025, 5:51pm UTC](https://community.fibery.io/t/smart-agent-input-length-and-max-tokens-exceed-context-limit/8839 "2025-05-21T17:51:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yuri\_BC](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/yuri_bc/32/8803_2.png) [@Yuri\_BC](https://community.fibery.io/u/Yuri_BC)\
**Post date:** [May 21, 2025, 5:51pm UTC](https://community.fibery.io/t/smart-agent-input-length-and-max-tokens-exceed-context-limit/8839/1 "2025-05-21T17:51:38Z")

</div>

Questions are answered without noticable issues but only when NOT specifically asking to look into a particular database for entities.

For example:

- “Find info about xx”  
– Gives answers about xx and even referring to databases and relations.
- “Find info about xx in entities of database Foo/Bar”  
– and it **always** errors out with:

`Exception encountered while answering the last query on step 0: 400 {"type":"error","error":{"type":"invalid_request_error","message":"input length and`max\_tokens`exceed context limit: 175670 + 40000 > 200000, decrease input length or`max\_tokens`and try again"}}`
