Creating Custom Chatbots
Drop In Chatbot Office Hours!
Join CTL Director Adam Beaver for a live walkthrough of the steps involved in creating a custom chatbot!
December 3, 4, 5, 10 & 11 | 9–10 AM | Zoom
Many instructors ban or restrict their students' access to large language models (LLMs) like ChatGPT, Gemini, and Claude because they feel unable to set constructive limits on how their students will use them. Unlike TAs or librarians, who know how to coach students without completing their work for them, LLMs make it quite easy, and thus tempting, to automate entire academic tasks with minimal student input or effort. Furthermore, LLMs operate outside the context of a specific course, making them indifferent to the question of which concepts or readings are relevant to an assignment. It's therefore understandable that many educators consider it prudent to ban the technology outright rather than attempting to anticipate all of the different ways their students might use it, to decide which of those use cases are or are not compatible with their goals for their students' learning, and to describe those boundaries in enough detail to ensure that students will know how to police themselves.
Enter Custom Chatbots
There is, however, at least one way that instructors can attempt to thread this needle, allowing their students to interact with generative AI without needing to worry about the slippery slope between legitimate and excessive use. Many LLMs, including Google's Gemini and Microsoft's Copilot (both of which are covered by Brandeis license agreements) make it easy for instructors to create their own, custom chatbots—that is, specialized versions of the generic chat interface whose knowledge, mission, and behavior (or "personality") are tightly constrained by a set of plain-language instructions designed by the instructor.
If you are an instructor who would be comfortable with your students using an LLM that behaved ethically vis-à-vis your course expectations—never doing your students' thinking for them, and sticking to reliable textbooks and sources in dispensing advice—this could be great news for you.
Read below for step-by-step instructions that explain how to create a variety of custom chatbots for your students, including virtual tutors, virtual language partners, historical avatars, and more.
How to Create a Custom Chatbot for your Course
Below we walk you through step-by-step instructions on how to create, test, revise, and share a custom chatbot with your students. These instructions assume that you will build your custom chatbot in Google's Gemini LLM, which has the advantages of being
- secured by a Brandeis license agreement,
- relatively easy to use,
- well-integrated into the other Google apps that we regularly use at Brandeis (e.g. Google Drive, Google Docs, etc.), and
- easy to share safely with students and colleagues.
It would also be fine to build your chatbot in Microsoft Copilot; most of the instructions on using Gemini translate well to Copilot, which has a similar editing interface, and we provide some guidance as to the differences at the end of the instructions below.
We should note that it is essential that you choose either Gemini or Copilot, and build your chatbot within your Brandeis account. Otherwise—e.g. if you choose ChatGPT as your platform, or use a personal Gemini account—your course materials and your students' work will not be protected by Brandeis' secure licenses.
Expand All
While custom chatbots in the educational space are often spoken about as "tutorbots," this does not imply that they are only (or even primarily) useful for providing students with "tutoring." If you are teaching a course in which students are responsible for memorizing and applying many names, terms, concepts, or formulas, it might make sense to create a straightforward tutorbot that serves up practice problems designed to help your students improve their recall. But you might want to put a custom chatbot, or bots, to use for other purposes, as well—for example, as …
- a language practice partner that can engage students in authentic conversations (and also give them feedback on their usage in real-time);
- a resource specializing in debugging students' code;
- an author, historical figure, or fictional character, allowing students to interview or converse with someone about whom they have been learning;
- an argument partner that will adopt one or more specified positions in a debate (e.g. a contrarian, a Marxist, a Buddhist) in order to help your students practice engaging with challenging or unfamiliar perspectives;
- a writing coach that can ingest an assignment rubric and give students feedback on how well their outlines or preliminary drafts are progressing toward your expectations;
- the custodian of one or more large datasets that can be queried via natural language, allowing your students to perform statistical or other kinds of pattern-based analyses without having to master specialized software and methods;
- a graphic design partner that can help your students take their written analyses and transform them into infographics, websites, slide decks, or other mediums that can reach varied audiences;
- and more!
There is no reason to limit yourself to just one of these functions; you are welcome to create multiple chatbots, each with its own purpose, for your course. In fact, we would suggest that in many cases you will achieve better results by creating multiple bots, so that each one—even if they behave practically identically—can be tuned to a high level of expertise in one, and only one, subset of your course materials.
A quick example—if you create a tutorbot that serves practice problems to your students, and supply it with the entire textbook as a single PDF, it may be hard to prevent it from generating practice problems that employ a concept taught in chapter 8 when your students are still learning the material in chapter 3. You can avoid this problem by creating separate chatbots, each of which is trained on a single chapter, and guiding students to interact with the appropriate bot at the appropriate time of the semester. In other words: if you are having trouble getting your custom chatbot to behave in the way you want, it may be that you're trying to get a single bot to do too much!
It’s not important that you know exactly how many and what kind of chatbots you’d like to create in order to get started; it’s easy to revise, or even to clone, a chatbot at any point, once you figure out what seems to work best for you and your students. We just want to make sure that you’re thinking broadly about the full range of roles that a chatbot might play in your teaching.
- In your web browser, navigate to the Gemini home page at gemini.google.com.
- Ensure you are signed in to your Brandeis Google account. (Look for your initials or profile picture in the upper right-hand corner of the page.)
- In the left-hand sidebar, find and click on Explore Gems. (Custom Gemini chatbots are called Gems.)
- On the page that opens, you should see a list of pre-made Gems and an option to create your own.
- Click the New Gem button.
The Gem editor interface is typically split into two main sections.
- The Left Panel, or Editor, is where you configure your Gem. You will have fields to:
- Name your Gem.
- Write a brief Description of what it does. (This is entirely optional.)
- Enter detailed Instructions (i.e. the system prompt that defines its persona, task, and how it should respond).
- Upload files into Knowledge so that your Gem can reference them directly.
The Right Panel, or
Preview, allows you to interact with your Gem
as you build it. This allows you to see how your custom chatbot will respond to test queries, so that you can refine your instructions until you get the desired output.
Simply type the name you would like to give your Gem into the Name field in the Editing pane, and write a brief (sentence-long) description of what your Gem does in the Description field.
- Note: the name and description fields have no bearing on how your bot behaves, so while it would be a good idea to choose something connected to your course (e.g. CHEM 101 Buddy or Virtual Socrates), you should feel free to be as specific or vague as you would like.
One of the chief attractions of creating a custom Gem is the ability to constrain its field of vision to a set of documents you handpick and upload. These are known as the Gem's
Knowledge. In other words, you can ensure that your chatbot will "know" nothing more, and nothing less, than what you choose to share from your textbook, other course readings, or other media. Here’s how:
- Skipping over the Instructions field (for now), scroll down to the Knowledge field.
- Under the Knowledge section, click the Add files button. A dialog box will appear with options to select your files. You can upload files from two sources:
- The first several menu options (Recent, My Drive, Shared drives, … ) point towards documents already stored in your Google Drive. Select the appropriate option from among these to choose a file already uploaded to Google Drive.
- The final option (Upload) allows you to browse and upload a file stored on your local device (e.g. your laptop).
- Select the desired file(s) and click Insert.
- Gemini is able to access information in most common file types, including .pdf, .docx, .txt, .csv, .xls/.xslx, and Google Docs/Sheets.
- You can usually upload up to 10 files at once, with each non-video file limited to 100 MB.
Confirm that the upload has succeeded. The file name(s) you’ve uploaded should appear under the
Knowledge section.
- Return to the Instructions field (located just above Knowledge). Here you will tell your Gem what tasks it should (and should not) perform, and how you would like it to interact with users.
- We invite you to start drafting your Gem's instructions by copying and pasting from our Library of Instructional Chatbot Prompts, which includes templates / models for some of the most common types of instructional chatbots (like tutors, language partners, coding instructors, etc.).
- If you would like to write your own Instructions from scratch, follow the protocol below.
- Start by defining the core goal of the Gem. What should it do? (e.g., "Summarize emails," "Generate three counterarguments," "Explain complex physics concepts," "Answer questions as if you are Genghis Khan")
- Next define a persona or tone if needed. (e.g., "Act as a friendly, expert TA," "Respond in a witty, formal style.")
- Add specific constraints or rules the chatbot must follow. (e.g., "Keep all summaries under 100 words;" "Always give students hints, but never the answer;" "Only use information from the documents uploaded to your Knowledge;" “Cite the exact page number where you obtained your information.”)
- Specify the desired output format. (e.g., "The output must be a markdown table," "Always end the response with a question.")
- Read your instructions aloud to check for clarity and ensure there are no conflicting commands. Use this opportunity to remove unnecessary words or filler phrases to keep the instructions as direct and efficient as possible.
- Once you have finished writing your Gem’s instructions, make sure to click Save. This action “publishes” your custom Gem, and it will now appear in your list of available Gems in the left-hand sidebar. Note: though it is now “published,” the Gem is only visible to, and accessible by, you—see below for how to share it with others.)
- To return to your Gem, either to converse with it or to re-enter the editing interface, you should look for the left-hand sidebar. There you should see both the Gem you have just created, and a more general option to Explore Gems.
- Click on either the name of your Gem, or Explore Gems (in which case you’ll see the name of your new Gem near the center of the resulting screen) to access your Gem.
There are two ways to test and revise the Instructions (and Knowledge) you have written:
- While you're still working within the left-side editing pane, you can engage in simulated chats with your bot-in-progress in the right-side preview pane. Doing so allows you to revise your Instructions (and Knowledge) on the fly—each time you write a sentence of Instructions, you can click over to your chat to see whether your results improve, and then click back into the editing pane to refine further.
- Once you publish your Gem by clicking Save, you can always return to it by locating its name in the left-hand sidebar. Clicking on the name will take you into a chat with its most recent published version; clicking instead on the three dots to the right of its name will allow you to go into editing mode for further refinement.
We suggest that you enlist a few people other than yourself—e.g. a TA, faculty colleague, course librarian,
CTL director, former student, … —to interact with your bot while it’s still in its prototype phase, to get feedback from someone who has not been involved in writing the
Instructions. This will require you to
Share your bot—see the next step, below.
- From the Gemini home screen, click on Explore Gems in the left-hand sidebar.
- Find the name of the Gem(s) you wish to share near the center of the screen. If you’ve created more than one Gem, they will appear in a list.
- Next to the Gem's name, click the Share button (which will look like a network or constellation of three dots connected by lines).
- This will open a dialog box (familiar to anyone who has shared a Google Doc, Sheet, or Drive folder), which allows you to choose (1) with whom you share your Gem and (2) their respective level of access (i.e. can they edit your Gem, or just interact with the published version?).
- If you want to share your Gem with a carefully circumscribed circle of people (whether a couple of colleagues who are helping you to test it, or the students enrolled in your course), you should enter their brandeis.edu email addresses into the dialog box and choose whether they are given Editor, or merely Viewer (i.e. user), access to your Gem.
- If you are comfortable with your Gem being usable by anyone with a brandeis.edu email address, you can choose instead under General Access (which by default is set to Restricted) to change permissions to Brandeis University. This is an easy way effectively to share your Gem with your enrolled students, so if you choose this option you’ll almost certainly want to limit their role to Viewer (i.e. user).
- Once you have set the correct permissions, you’ll likely want to click Copy Link in the lower left-hand corner of the sharing dialog box. This saves a copy of a link directly to your Gem in your clipboard for use in a moment.
- Make sure that you click Done in the bottom right-hand corner of the sharing dialog box to save your new permissions.
- Note: If your Gem has files uploaded to its Knowledge section, you may be prompted to set sharing permissions for those files as well. The sharing process is powered by Google Drive, and the shared Gem is saved in a new folder in your Drive.
- You can now share the link to your Gem with the people to whom you’ve given access, by sending it to them directly (i.e. via email, Google Chat, etc.) and/or by posting it to your Moodle or website (i.e. the same way you would share a link to any other online resource).
Adapting these Instructions to Copilot
Some instructors may prefer to build their custom chatbot in Microsoft’s Copilot rather than Gemini. (Copilot calls its custom chatbots “Agents,” as opposed to Google’s “Gems.”) Copilot Agents share many similarities with Gems, and will function equally well for most use cases. Here are some things you might consider when choosing between them:
|
You might prefer Gemini if …
|
You might prefer Copilot if …
|
- you are most familiar / comfortable working in Google applications (like Google Drive, Docs, Sheets, etc.)
- you already use Google products in your classroom, since Gemini can interact directly with materials (like course readings) that you have stored in your Google Drive
- you want your chatbot to be proficient in multimodal tasks (like image generation), since Gemini handles these better than Copilot
|
- You are most familiar / comfortable working in Microsoft applications (like OneDrive, Teams, Word, Excel, etc.)
- you already use Microsoft products in your classroom
- you want your bot to hew very rigorously to a specific and highly structured or fixed script of interactions, since Google has already been training Gemini to behave according to its own, in-house idea of how an instructional chatbot "should" engage with students
|
In the event that you choose to develop a Copilot Agent, here is how to proceed:
- In your web browser, navigate to Copilot Studio at copilotstudio.microsoft.com.
- Ensure you are signed in to your Brandeis OneDrive account. (Look for your initials or profile picture in the upper right-hand corner of the page.)
- In the left-hand sidebar, find and click on Create.
- On the page that opens, you should see a list of pre-made "agent templates" and an option to create your own.
- Click the + New Agent button.
- Copilot Studio’s interface is nearly identical to Gemini’s, so you may proceed to name and describe your Agent as described in Steps 3–4 above.
- Uploading Knowledge to Copilot Studio functions in the same way as in Gemini (see Step 5), with the one significant exception that Copilot can connect directly to your Microsoft OneDrive rather than your Google Drive. (You can also upload documents directly from your desktop, as in Gemini.)
- Writing Instructions in Copilot Studio functions in the same way as in Gemini (see Step 6). One small difference: Copilot also allows you (if you so wish) to supplement your Instructions by including a handful Suggested prompts, editable in a field located just below Knowledge. Depending on what your Agent is intended to do, you may want to take advantage of this option and draft a few of these suggestions (e.g. “Let’s do some practice problems,” or “I want you to interpret an image I’m uploading”), which will be recommended to the user on the home screen when they first engage with the chatbot.
- When you have finished designing your Agent, click Create (the equivalent of Save) in the upper right-hand corner of the editing interface. You will then be able to return to your Agent, either to interact with it, to edit it, or to share it with others, by locating it by name (under “Agents”) in the left-hand navigation sidebar within Copilot. In order to edit or share it, click on the three dots to the right of its name. Sharing works in a similar way to Google, as described above in Step 9.