Creating your first agent

Now that you're familiar with some of the basic concepts of Ragu, let's go through the process of creating your first agent.

Head on to the admin panel, click on Agents in the sidebar and click on the Create agent button at the top right of the page.

TODO: NEEDS GIF

You should now see a page where you can give your agent a name, description, context and various kinds of instructions. For now, we'll be ignoring the instructions, those are described in more detail in the Agents section.

Give your agent a memorable name (if you can't think of one, call it 'Radical Ragu') and a short description that specifies its purpose.

Now set the agent's context. This is one of its most important parameters as it will dictate how it will behave. You always want to write the context as though you are referring to the agent itself, i.e. in second tense.

One example of a context would be

You are Radical Ragu, a helpful assistant that answers all questions related to ragu.
If you receive a question not related to ragu, let the user know you only talk about
ragu.

Finally, you need to set the agent's LLM, indicated by the model parameter. Depending on how Ragu was configured, these will vary. For now, we'll be using OpenAI's GPT-4, but if you don't have that one, don't worry, just use any model that's available. For the model parameter, select openai/gpt-4.

Optionally, you can set the model's temperature. This is a value between 0 and 1 that controls the "creativity" of the model's output. The higher the value, the more "creative" the output. If you don't want your agent's responses to be too crazy, we suggest keeping this at the default value of 0.1.

Press the Create agent button at the bottom of the page. Voila! You created your first agent. Easy, right?

Well, OK, we're not done yet. You might be wondering why the agent is inactive. When you create new agents, most likely you do not want them to be active until you've configured their knowledge base, that's why they're always inactive by default.

Go ahead and activate the agent by clicking the Activate button on its page. Switch to user mode via the profile icon at the top right of the page. You should see the agent on the dashboard. Try sending it a message.

Try asking it Who is Raguru Labamba?.

It doesn't know? Let's fix that!

Switch back to admin mode via the profile icon at the top right of the page and head over to the Collections page, located in the sidebar. Click on Create collection in the top right corner of the page and give it a name. Collection names can only contain letters, numbers and underscores.

Next, pick an embedding model. These aren't important for now and are explained in the Collections section in more detail. Again, these will vary depending on your configuration. For now, we'll be using OpenAI's text-embedding-ada-002, so go ahead and pick that one.

You should now see it in your collection list. Click on it to open it.

Each collection starts out empty and here is where you add documents to it. To your left will be a list of documents not yet added to the collection, while to your right will be a list of those currently in it. If you have uploaded documents previously they should be visible on the left side. You should also see the default document RaguruLabamba.txt on the left hand side of the Add documents to collection section.

Add the RaguruLabamba.txt document to your collection by clicking on it, then clicking submit. Radical Ragu now contains Raguru Labamba's biography as part of its knowledge base.

Now that you have a document in your collection, let's assign it to your agent. Go back to the agent's page and click on the Assign collection button at the bottom of the page. Select the collection you just created. You'll see two additional parameters;

The instruction parameter is where you tell your agent what to do with the data it obtains from the collection. In this case, you can instruct it to use the information to answer any ragu related questions.

Give it the following instruction:

Use the following information to answer any ragu related questions.

The Retrieval amount parameter will determine how many chunks will be retrieved when you prompt the agent. For now, you can set this to 1 since our collection is very small and contains only a single chunk.

Click on the Assign collection button at the bottom of the page.

Switch back to user mode and see if Radical Ragu is able to answer your question.

Congratulations! You just created your first agent in Ragu and enriched them with knowledge!

Next steps

  • Try uploading some documents to Ragu.

  • Try following the same steps as above, but this time using the documents you uploaded. Keep in mind, agents are intended to communicate with your end users, so you should be mindful of what you put in their collections.

This was a very simple example with a very small document. Chances are your documents will be much larger than a single paragraph. Next up you'll learn how to use Ragu with larger and more complex documents.