Model's maximum context length

Hi, I’m trying to use a json document as a knowledge source, but get an OpenAI error on run:
openai.BadRequestError: Error code: 400 - {‘error’: {‘message’: “This model’s maximum context length is 8192 tokens, however you requested 263172 tokens (263172 in your prompt; 0 for the completion). Please reduce your prompt; or completion length.”, ‘type’: ‘invalid_request_error’, ‘param’: None, ‘code’: None}}

The script is:
import os
from dotenv import load_dotenv
from phi.knowledge.json import JSONKnowledgeBase
from phi.vectordb.chroma import ChromaDb
from phi.agent import Agent

load_dotenv()
OPENAI_API_KEY = os.getenv(“OPENAI_API_KEY”)

vector_db = ChromaDb(collection=“json_documents”)

knowledge_base = JSONKnowledgeBase(
path=“graphql.schema.json”,
vector_db=vector_db,)

agent = Agent(
knowledge=knowledge_base,
search_knowledge=True,
)

agent.knowledge.load(recreate=False)

agent.print_response(“Write a sample API query”)

Hi @rr366
Thank you for reaching out and using Phidata! I’ve tagged the relevant engineers to assist you with your query. We aim to respond within 24 hours.
If this is urgent, please feel free to let us know, and we’ll do our best to prioritize it.
Thanks for your patience!

Hi @rr366

Phidata is now Agno! We have made a lot of improvements. In order to best support you, would you mind migrating to Agno?
Here is a guide to help you get started

Secondly, your issue might be due to ChromaDB. Would you mind trying a different VectorDB after switching to Agno and let me know how it goes.