Prompt & context engineeringCopy
- Why it is important
- Prompt engineering techniques
- Context engineering
- Other prompt-related advice
- The future of AI & prompt engineering
1. Introduction
If you’re working in the nonprofit sector, you know the daily struggle: Trying to achieve ambitious goals with very limited resources.
Imagine having a tireless, creative, and knowledgeable team member available 24/7 to help. That’s the potential of AI, and this guide will show you how to unlock it through the power of prompt engineering.
AI tools like ChatGPT can help you a lot with your work, but you have to know how to “talk” to them to get the best results. It’s a new skill that most people don’t have yet.
In many cases, people complaining about AI results are not using the tools correctly. Sending the right messages (prompts) can make a huge difference.
What Is Prompt Engineering?
Prompt engineering is the art of crafting precise instructions (“prompts”) for AI tools, so they can provide more useful and reliable results.
It’s about learning how to ask for exactly what you need, so the AI understands you perfectly.
If you give the AI vague and generic instructions, it will provide vague and generic results.
Knowing how to ask is key to unlock the full potential of AI. Without the right prompts, AI will never deliver truly great results.
Why Is It Important?
Prompt engineering can bring big advantages for nonprofits:
- Save time and resources: The right prompts will give you great outputs that are almost ready to publish, so you can launch great things in minutes instead of weeks.
- Boost creativity: Get really useful ideas for your campaigns, fundraising, problem-solving, etc. Everything adapted to your organization’s context and needs.
- Improve communication: Craft compelling messages for different audiences. And ensure that your messaging is aligned with your mission
- Improve decision-making: Get more data, insights, trends and other useful info to design your strategies. It will help you make better informed decisions and make less mistakes.”
How LLMs Work
LLMs (Large Language Models) are the “brains” behind many AI tools, like ChatGPT, Google Gemini, Microsoft Copilot and others.
LLMs are trained on vast amounts of text (websites, books, scientific papers, etc.) to understand us and generate responses. But they don’t remember or think like humans do, they use statistics to predict the text that is most likely to come next (starting with your input) *.
What does this mean for you? It means the quality of the output depends on the quality of the input (your prompt). Writing good prompts isn’t just helpful, it’s essential.
ℹ️ Note
This is a complex and changing field (there are new models that include “reasoning” modes that try to emulate human thinking, some have been trained not only on text but also videos and other contents…), but the basic concepts are still the same.
Key Components of a Good Prompt
A good prompt is like a well-written recipe. It has all the ingredients for success!
Not all tasks requires the same prompt ingredients, but this is a good general recipe:
- Give clear instructions: Explain your goals in detail (avoid short and vague phrases), if there are any restrictions or constraints to take into account, if the AI should act as a specific role…
- Explain your context. Provide relevant information about your organization, relevant details about the current project or task, desired tone and writing style…
- Give examples. Show the AI what you’re looking for. Even better if you can provide a few full examples of the kind of results you want to get.
- Specify the format. Specify the format of the output (e.g., bullet points, a table, a poem, an email, etc.), especially if you are not providing full examples in that format.
Example:
Instead of using a vague prompt such as: “Give me good fundraising ideas”, try something more specific and actionable:
We are a small nonprofit focused on animal rescue in urban areas of the UK. Our target audience is young professionals that find us through social media (Instagram and Tiktok mainly).
Suggest five creative fundraising event ideas that could be held in a city park, with a budget under $1,000.
The tone should be fun and engaging, and the event should be appealing to people who may not already be familiar with our organization. Here are 3 good examples:
[EXAMPLES]
For each idea, explain why it’s interesting for us, provide a checklist with the recommended steps to launch those events (free or low-cost options preferred) and mention possible risks (with ideas to minimize them)By providing clear details, the AI will give you more focused and relevant responses.
Using Prompt Engineering to Reduce Risks
AI is powerful, but it’s not perfect and sometimes can make big mistakes.
Nonprofits often deal with sensitive topics, diverse audiences, and complex issues.
Prompt engineering can help you navigate these challenges and reduce risks such as bias, inappropriate tone, or unintentional harm.
Strategies to Reduce Risks:
Mitigate Bias: Be explicit about using inclusive language, avoiding stereotypes or assumptions, providing examples of diverse perspectives…
Ensure the language is inclusive of all genders, ethnicities, and socioeconomic backgrounds. Avoid making assumptions about family structures or cultural norms.Set the Right Tone: Clearly define the tone you want to convey (e.g., warm, hopeful, professional..) and/or give examples written with that tone.
The tone should be optimistic, hopeful, and compassionate, emphasizing the positive impact this program will have on individuals and the community.Avoid Sensitive Topics: Specify areas or language to steer clear of.
Avoid any political references, religious affiliations and potentially controversial language that could harm or alienate potential donors or volunteers. Ensure accuracy: AI can sometimes generate inaccurate or outdated information, which is commonly known as “hallucinations”. To mitigate this, you can use AI tools that can search for live data and link to sources (eg. Perplexity or NotebookLM).
Protect Privacy: Avoid sharing sensitive data in the prompts and documents that you provide. Also, you can ask the AI to anonymize the results and not generate any PII (Personally Identifiable Information).
Use prompts to simulate potential audience reactions: “How might a supporter (that is very sensitive about X topic) respond to this statement? Is there anything in this text that could generate a negative public reaction?”
Share “safer” prompts with your colleagues: Make it easier for everyone to use prompts that are less risky. Maybe even create an internal prompt library to compile your best prompts.
Review and iterate: Always double-check the results coming from AI tools. If you don’t like something, suggest changes on the chat conversation or refine the original prompt to get your desired outcomes.
2. Prompt engineering techniques
In this chapter, we’ll explore advanced techniques to help you master the art of crafting effective prompts.
These techniques will empower you to guide AI tools with precision and unlock their full potential.
Experiment with different techniques. You may find that combining methods (like few-shot with iterative prompting) yields the best results for some tasks.
Few-Shot Prompting
With few-shot prompting you give the AI a few examples (“shots”) to learn from.
They could be “full examples” (copying all the text and telling the AI to give a similar output) or “partial examples” (mentioning specific phrases, concepts, styles or structures that you like).
Sometimes just 1 or 2 examples is enough to get good results, but you might want to try adding more examples for important or frequent tasks.
You can copy the text of the examples in the prompt or upload them as documents.
It’s a powerful technique for guiding the AI towards a specific style or type of output.
It’s also sometimes faster to just copy a few existing examples than to write a big prompt trying to explain all the details of what you want.
Benefits
- Improves output quality: The AI can mimic the style, tone, and format of the examples, leading to more consistent results.
- Reduces ambiguity: By showing the AI what you want, you minimize the chances of it misinterpreting your instructions.
Example
Here are three examples of successful social media posts from our previous galas:
[Example1]:
[Example2]:
[Example3]:
Now, write five new social media posts for this year's gala, maintaining a similar tone, style, and including a call to action to purchase tickets.NOTE: If your organization has a style guide or brand guidelines document, you can use excerpts from it as examples to ensure the AI’s output aligns with your established voice and tone.
Chain-of-Thought Prompting
Chain-of-Thought (CoT) prompting is like encouraging the AI to “think out loud” and show its reasoning step-by-step.
Instead of just asking for the final answer, you instruct the AI to break down the problem into smaller steps and explain its reasoning for each step.
If you want specific results, you can try including the first steps of the reasoning process in your own prompt and ask the AI to continue (to guide it into a specific “reasoning path”, so it doesn’t get lost in other less-productive paths).
You can also combine CoT with few-shot prompting (asking for reasoning steps and providing examples at the same time)
This technique is particularly useful for complex tasks that require logical reasoning or problem-solving.
Benefits
- Improves accuracy: By breaking down the problem, the AI is more likely to arrive at a correct or well-reasoned solution.
- Facilitates debugging: If the AI makes a mistake, you can pinpoint where the reasoning went wrong and adjust your prompt accordingly.
Example
Let's say you're evaluating the effectiveness of a recent volunteer recruitment campaign. Instead of simply asking, 'Was our volunteer recruitment campaign successful?', you could use CoT like this:
Analyze the effectiveness of our recent volunteer recruitment campaign.
First, identify the key performance indicators (KPIs) we should consider.
Second, compare the actual results for each KPI to our initial goals.
Third, based on this comparison, explain whether the campaign met, exceeded, or fell short of our expectations.
Finally, suggest three specific improvements we could make for future recruitment campaigns.ℹ️ Note
Most new AI models already have “reasoning” capabilities built in, so using CoT is now unnecessary for most tasks and may even worsen results in some cases. But you can still try it for important tasks, giving the specific reasoning steps that you want AI to follow might help sometimes.
Role-playing prompting
Role-playing prompting is about assigning the AI a specific persona or role to play.
It could be just a simple phrase included in a normal prompt, that helps us give the AI some additional context. Something like “You are an expert in social media campaigns for nonprofit organizations, specialized on giving ideas to get more followers”.
But it also can be something more interactive and complex, where you create a whole personality for the AI and then have long conversations with that “AI person”.
For example, there are many custom GPTs that have been trained to act as coaches, specialized consultants or even famous people.
You can build the personality by providing detailed instructions (how it should behave), many examples (things that the AI person should know or say) or both. You can use text, documents and sometimes links to provide that info.
Benefits
- Provides a different perspective: The AI may give some ideas that you might not have considered otherwise. You can also test if it gives very different responses for different roles.
- Creates a long-term resource: Especially if you build and save a detailed personality (e.g. as a custom GPT in ChatGPT or Gem in Gemini). You can easily go back to it every time you have new questions or tasks where that “AI person” can help. Also, you can share it with your team or the general public.
Examples
The Social Media Expert
You are a social media expert specializing in creating engaging content for nonprofits. You understand the nuances of different platforms and know how to craft messages that resonate with diverse audiences. Help me improve our social media strategies and posts to increase reach and engagement.The Major Donor
You are a potential major donor who is passionate about animal welfare. You are considering making a significant contribution to our organization, but you have some questions and concerns. I will provide information about our programs, and you will respond as a potential donor, asking questions and expressing any reservations you might have.Iterative Prompting
Iterative prompting is like having a conversation with the AI, where you refine your prompts and provide feedback to guide it towards the desired outcome.
You start with a normal prompt and then send other messages to refine the results (adjust instructions, add context, correct misunderstandings…)
The iterative process may start even earlier: You can tell the AI to give you feedback about your initial prompt and help you refine it.
Iterative prompting can be used together with other prompting techniques (most prompts can be improved with a bit of testing and iterating).
Benefits
- Fast and flexible: You can start with a short or generic prompt and adjust according to the results, instead of spending a lot of time thinking and building a big detailed prompt from scratch.
- Facilitates learning: It’s like a collaborative process between you and the AI, so it lets you learn more about how the AI “thinks” and how to improve your prompts accordingly.
Example
- Initial prompt: ‘Write an email asking for donations for our end-of-year campaign.’
- Iteration 1: ‘The email is good, but it’s too long. Make it shorter and more impactful, focusing on the urgency of the need.’
- Iteration 2: ‘The tone is a bit too formal. Can you make it more personal and heartfelt? Include a brief paragraph summarizing this donor testimonial: [COPY TESTIMONIAL]
- Iteration 3: ‘That’s much better. Now, add a clear call to action with a link to our donation page, and suggest three different subject lines for the email.'”
ℹ️ Note
One of the great advantages of AI is having access to dozens of ideas in seconds. So if you want to go faster, you might ask on each prompt for multiple variants/ideas (so you have several options to choose and iterate from, instead of only one). Something like “Write 5 versions of this post, with very different content and writing styles”.
Prompting for AI Image and Video Generators
There are now many great AI image generators (Dall-E, Midjourney, Flux…) and AI video is getting big too (Runway, Kling, Luma…).
They allow you to create stunning visuals from simple text descriptions, empowering you to enhance your website and communications, create more engaging content, design beautiful merchandise, etc.
You can generate in seconds and for free (or almost) visual content that used to require big investments and several weeks of work.
Some of the general prompting recommendations are also applicable for image and video generators, but there are also some specific tips:
- Be very descriptive: The more details you provide, the better the AI will understand your vision. There are millions of possible images and styles, and the AI can’t read your mind. Describe the subject, composition, colors, mood, and any other relevant aspects. For example, instead of “a picture of a cat”, try “a photorealistic close-up of a fluffy orange tabby cat with green eyes, sitting in a sunbeam, soft focus background.”
- Try specific keywords: To get the style you want, sometimes it’s more useful to include a few important words than a long explanation. They could be related to the desired style, art movement, artist, or medium. Things like “in the style of Van Gogh”, “photorealistic”, “oil painting”, “cinematic lighting”, “pixel art”, “anime”, “monochrome illustration”, etc.
- Check examples: There are many communities sharing their image prompts and results, such as PromptHero. They can be useful to get inspiration and have an initial prompt to start refining.
- Use Image Prompts: Some platforms allow you to provide an image as a starting point or reference for the AI. This can be helpful for guiding the style or composition. Sometimes you can also combine several images into one.
Example
Generate an image for a social media post to recruit volunteers for our community garden.
The image should show a group of diverse volunteers of different ages working together in a lush, green garden, with bright sunlight and a clear blue sky. They should be smiling and enjoying themselves.
Oil painting style, not photorealistic.
Include the text "Join our Community Garden" in a stylish serif font.3. Context engineering
Context engineering is a new concept that is very related with prompt engineering, but it’s becoming so important that it deserves it’s own section.
It’s basically about which “additional information” are we giving to AI for each task. It’s not the instructions that we give in the prompt, but all the other data that it will consider while following those instructions. It could be:
- Text that we copy in the prompts (e.g. examples, templates, etc.)
- Files that we upload to AI tools
- Data that we give vía integrations/APIs (e.g. Google Drive, Slack, databases…)
- Data that comes from the AI tool native features (e.g. long-term memory, system prompts…)
From a more strategic standpoint, context engineering could be defined as the systematic process of capturing and organizing your organization’s knowledge so AI can understand your specific situation and deliver relevant results.
Why context is important
By default, AI tools don’t know anything about your organization, needs, etc. Without your specific context, they’ll give you generic advice that doesn’t fit your mission, audience, or constraints. Context engineering ensures AI understands your unique situation.
So you need to give AI your specific context. But there is a catch: You should think about which context you give AI for each specific task, you can’t just upload dozens of files and expect the AI tool to figure it out.
There are several reasons why we have to carefully select the context and not just feed them a lot of random files or data:
- AI models have limited context windows. That means that they can only process a certain amount info while doing a certain task. If we give them more data than they can process, they will ignore it or start “forgetting” about previous data. Also, studies have shown that even within their context windows, performance may degrade when AI have to process a lot of info. For example, AI tools might have more trouble finding info in a 100-page document than in a 10-page document.
- Every word that we give to AI models influence their output, we should not expect AI tools to be good at filtering/ignoring info that we are giving them. They are probably not going to do things like “the user gave me this example but it’s pretty bad, so I will completely ignore it”. So most of the times we will get better results if we only give the best examples or data, instead of giving a bunch for random data that might confuse AI or mediocre examples that will drive AI to give mediocre results.
- It’s always better to give any online tool (including AI tools), only the data that they really need. Sharing lots of data = increasing risks. For example, if you share your whole Google Drive you could be uploading sensitive info that could get hacked or included in the training for future AI models (if it’s uploaded without the proper privacy settings).
- Longer contexts = slower responses and higher energy consumption. If the AI model have to process more info (tokens), it will have to think for a longer time, the servers will be running for more time, etc. So it’s faster and more efficient to give AI models only the most relevant context for each task.
Create and share your Context Templates
So we know that we can’t just give a lot of random info to AI and expect awesome results. But at the same time, if we have to create the relevant context from scratch every time we want to ask AI something, it would be a very time consuming. We need a more efficient solutions.
The best solution is to create several context templates that we can reuse for different tasks. These templates could be files or even databases, but it’s usually better if they are simple blocks of text (they are easier to copy in any tool, edit quickly, reorder, etc.)
Think of it as creating a “knowledge profile” of your organization that you can reuse across all AI interactions.
It’s not about using exactly the same templates for every AI task, but having a good starting point and then select which blocks are relevant for your current task, maybe edit them a little bit for this particular project, etc.
Sharing the same context templates with your colleagues helps your organization save a lot of time and also improve results:
- You can get great results consistently, since you are all using the best prompts and the best data available
- It protects your brand voice and reputation (you have shared standards instead of individual “improvisations”)
- It reduces risks (e.g. sharing confidential or sensitive data with AI tools)
Step 1: Prepare general context
Create a “general context template” with the key elements that define your organization, such as:
ORGANIZATION PROFILE:
- Mission: [Your mission statement]
- Primary programs: [List 3-5 key programs]
- Target beneficiaries: [Who you serve, with specific demographics]
- Geographic focus: [Local, regional, national, international]
- Annual budget range: [This affects all recommendations]
- Staff size: [Affects capacity for implementation]
AUDIENCE PERSONAS:
- Primary donors: [Age, income, interests, values, communication preferences]
- Volunteers: [Demographics, motivations, availability, skills]
- Beneficiaries: [Detailed description including challenges, needs, preferences]
- Community partners: [Other organizations, government agencies, businesses]
VOICE AND VALUES:
- Brand personality: [Professional but warm, grassroots and passionate, etc.]
- Key messages: [3-5 core messages you always want to communicate]
- Words/phrases we use: [Your organization's preferred terminology]
- Words/phrases we avoid: [Language that doesn't fit your brand]
- Tone guidelines: [How formal, emotional, urgent, hopeful, etc.]
CONSTRAINTS AND RESOURCES:
- Budget limitations: [What you can/cannot spend on various activities]
- Staff capacity: [What you can realistically implement]
- Compliance requirements: [Legal, regulatory, or funder requirements]
- Technology limitations: [What tools/platforms you can use]Step 2: Prepare specific context
For each major campaign or project, compile key information:
PROJECT CONTEXT:
- Project goal: [Specific, measurable outcome]
- Timeline: [Start date, key milestones, deadline]
- Budget: [Available resources for this project]
- Target audience: [Specific subset of your audiences]
- Success metrics: [How you'll measure impact]
- Past similar campaigns: [What worked, what didn't, lessons learned]Step 3: Use those context templates in your prompts
Reuse those templates (removing the parts that are not relevant) to get personalized responses in seconds:
CONTEXT: [Paste relevant context blocks]
TASK: [Your specific request]This approach ensures every AI interaction is grounded in your organization’s reality, leading to much more relevant and useful results.
4. Other prompt-related advice
Configure system prompts
Some AI tools, like ChatGPT, allow for the use of system prompts, custom instructions and/or other advanced settings to guide AI behavior. They let you provide the basic instructions for all your interactions with the AI.
They are great to set the rules and context that you want to use always, without having to write them in each conversation. So they can save you a lot of time and improve the consistency and quality of the responses you get.
You could use them to set things like:
- Your desired writing style and tone
- Your organization’s key info (mission, priorities, resources, challenges, limitations…)
- Rules for the output (topics or words to avoid, preferred formats…)
If everybody in your organization uses the same system prompt (or very similar), you will achieve more consistent results. It would also make it easier to maintain the same style for all your external communications, internal documentation, etc.
Example
You could include things like this in your custom instructions:
CONTEXT:
I work for a nonprofit organization. Our context is [mission/values/goals/budget/etc.].
Take this into account for every message that I send related to work, nonprofits or business tools.
TONE:
- Use inclusive language for all genders, ethnicities, and socioeconomic backgrounds
- Avoid political references and religious affiliations unless directly relevant
- Be professional, but avoid using a corporate or boring tone. Avoid long paragraphs and jargon.
REQUIREMENTS:
- If are not sure of the correct answer to a question or it's beyond your knowledge cutoff date, say “I don't know” and explain ways to get a reliable answer.
- Always ask for clarification if my request could have multiple interpretations
- Provide multiple perspectives, ideas or solutions when possible. Not just one.
- Prioritize ideas that can be implemented with minimal resources and risk.
OUTPUT:
- Cite credible sources or references to support your answers, with links if available.
- Use the metric system for measurements and calculations.
- Never mention that you're an AI.3.2 Use the right tool & prompt for each task
Building good prompts is important, but a great prompt for a certain task and tool could be awful for a different use case.
You should do some tests with your own prompts and different models/tools (each task is different and AI tools change very frequently), but here are a few basic recommendations:
- For complex tasks like crafting grant proposals or detailed campaign plans, try the most advanced models. For simpler tasks, consider using smaller models (they are faster, cheaper and more eco-friendly). You might have to change the default selection to use the most advanced models (and maybe even pay a subscription).
- If you are worried about the environmental impact of your AI use, use the “dumber” (smaller and cheaper) models most of the time. They are good enough for many tasks and they require less energy to run (sometimes the difference is huge, especially if you compare them to the latest reasoning models). If you have a powerful computer and technical skills, consider running small models on your own computer (using tools like GPT4All, Ollama or LM Studio)
- If your task requires deep reasoning (things like doing math, solving complex problems, etc.), try models with reasoning capabilities (OpenAI o1 or o3, Deepseek R1, etc.). If you can’t afford them, try using Chain-of-Thought prompting with a “normal” model.
- If you need reliable info (without incorrect or invented data), use an AI model with search features (eg. ChatGPT with the search option activated) or an AI tool focused on research tasks (Perplexity, NotebookLM, Gemini Deep Research…). They are not perfect, but they are more reliable than “standard” AI tools (fewer “hallucinations”) and you can check the sources if you are not sure of something.
3.3 Try changing advanced parameters
⚠️ Warning
This is a recommendation for “advanced users” with very specific needs. Results may become unpredictable or even unusable when you change the default parameters. Most people don’t really need to experiment with this.
Some AI platforms allow you to adjust advanced parameters that control the AI’s output (randomness, creativity, length…).
They are usually available via APIs (for developers) and not on normal user interfaces (eg. ChatGPT). But “normal users” can sometimes use them through web tools like OpenAI Playground or Google AI Studio.
The same prompt can deliver very different results with different parameters. So it’s another way to optimize the results of your prompts (even without changing them).
The available parameters are not the same on all platforms, so it’s better to check the documentation of the platform that you are going to use. But here are 3 of the most common and useful parameters:
- Temperature: It controls the randomness of the output. A higher temperature (e.g., 1.0) makes the output more random (might be better for creative tasks), while a lower temperature (e.g., 0.2) makes it more focused and deterministic (better for tasks that require accuracy, such as summarizing documents). A temperature of 0 could result in a very repetitive output.
- Frequency penalty: A big penalty (higher number) discourages the model from repeating the same tokens or phrases too often in the output. So it encourages the use of a wider range of vocabulary and avoids repetitive phrasing.
- Maximum Length (or Max Tokens): Sets the maximum number of tokens the model can generate in its response. You can use it to avoid (or allow) longer responses. If you are using the API, you might want to lower the Max Tokens value and ask for brief responses to reduce costs (AI APIs usually charge per token) and environmental impact.
5. The future of AI & prompt engineering
AI tools are changing and improving at an astonishing pace, so it’s very difficult to predict their future. But it’s pretty clear that 2 important things will happen sooner or later:
- AI models will be even more “intelligent” (better reasoning, better memory, etc.).
- AI agents (AI systems that can do many tasks on their own, without human intervention for some or all steps) will become more powerful and popular.
Regarding prompt engineering, this will probably mean 2 things:
- We’ll be able to have more natural and dynamic interactions with AI, relying less on complex instructions and “obscure tricks” to get the results we want.
- Writing good prompts (especially providing all the relevant context and avoiding ambiguous or vague instructions) will still be very important, even more with AI agents.
“Mistakes” with AI agents are more costly than with AI chatbots like ChatGPT, because AI agents are more expensive & slow to run, and they can have access to external services.
If ChatGPT generates a bad output, we ignore or correct it and that’s the end of the problem. If AI agents spend hours doing the wrong tasks, we will be paying a lot for bad results and we can even risk our reputation or money (if the agent publishes or buys something that is not what we wanted).
So prompt engineering will still be very important in the future, even if not all current prompting techniques survive. Ongoing learning and testing will be key to get the best results from new AI tools.
Even as AI becomes more sophisticated, the fundamental principle remains: clear, contextual communication with AI systems will always produce better results. The tools may change, but the need to provide good instructions and relevant context will persist.
The organizations that start building these skills now will have a significant advantage as AI capabilities expand.