Any advice on system prompt length?
# prompt-tip
k
I saw that it is better to limit the prompt to 5k characters. I am at 10k, how does that affect the performance? is the 5k limit up to date?
u
10k prompt is at risk of serious hallucinations You should at least filter some info and transfer them to a knowledge base instead
r
we recommend using a prompt that is less than or equal to 5k characters or 1000 tokens. anything higher may result in hallucinations or may not follow the prompt exactly
k
what do you mean with knowledge base?
u
In voice AI, I use a knowledge base as the main source of information my assistant relies on to handle enquiries and respond accurately during conversations. Instead of hardcoding every response, I store things like FAQs, product details, policies, and common customer questions in one structured place, so the AI can pull the right information in real time based on what the caller says. This helps me keep responses consistent, natural, and flexible, especially when dealing with different types of enquiries like support, bookings, or sales.
k
right now i'm using the Web SDK and i'm filling the system prompt.
I'm using VAPI to make fake clients so that sales rep can train on AI calls. Should i move my instuctions on the knowledge base?
u
Yes you can move some of the instructions to the knowledge base and also add some instructions to the prompt for the Ai to always reference the knowledge base anytime the caller ask a question and the answer is not in the prompt
k
just to echo what @✞ρєη¢ℓσηє said, if you want to use knowledge bases in VAPI, create a query tool with your knowledge base file (either a .txt file or text searchable .pdf file) then attach that query tool to the assistant. ensure that the assistant has instructions on when to use the query tool to search for answers in your knowledge base file.