How to optimize prompt engineering for a SQL-based “Sales Assistant”?

Hello developers!

I’m building a Sales Assistant that:

  • Answers questions about the company’s database.

  • Talks to customers to take orders and handle complaints.

  • Engages customers who haven’t made purchases to understand their needs.

To achieve this, I’ve been doing prompt engineering where I include:

  • Database schema.

  • Some rules (critical constraints).

  • Example inputs/outputs.

  • Context and user queries.

Right now, my prompt per request is huge (around 1,500 tokens), which is costly and inefficient.

:backhand_index_pointing_right: My questions are:

  1. Is there a cheaper or more efficient way to structure this without repeating the entire schema, examples, and rules each time?

  2. Would this fall under few-shot prompts, system prompts, or something else?

  3. Should I consider alternatives like fine-tuning or embeddings + templates instead of sending everything in every request?

I’d love to hear recommendations or best practices from those who’ve implemented something similar.

Thanks in advance!

I suggest creating a persona for the sales assistant with all the characteristics you want, then use the persona as a system prompt. You can feed the rest of the details to it when you chat or you can just use RAG for the rest.

1 Like