What are Sources?

In ResponseCX, a Source is a location where your Agents can retrieve information to answer user questions. A source can be a website, a document, or a knowledge base. By providing sources, you can equip your agents with the specific knowledge they need to be effective.

Creating a Source

You can create a source through the Response_CX dashboard or using the SDK.

Using the Dashboard

  1. Navigate to the Sources section of the ResponseCX dashboard.
  2. Click the Add New Source button.
  3. Fill in the source’s details. For example:
    • Name: A descriptive name for your source (e.g., “Public Website”).
    • Description: A brief summary of what the source contains.
    • Type: The type of source, such as Website, Document, or Knowledge Base.
    • URI: The location of the source, like a URL for a website or a path to a document.
  4. Click Add Source to create the source.

Using the SDK

Here’s how to create a source using the Node.js SDK.
// The 'stateset' object should be initialized with your API key.
// Please refer to the official Stateset SDK documentation for initialization details.
// For example:
// const stateset = new Stateset({ apiKey: "YOUR_API_KEY" });

const source = await stateset.sources.create({
  name: "My API-created Source",
  description: "Documentation website.",
  type: "Website",
  uri: "https://docs.example.com",
});

console.log("Source created:", source);

Managing Sources

You can list, update, and delete your sources.

Listing Sources

Retrieve a list of all your sources via the SDK.
const sources = await stateset.sources.list();
console.log(sources);

Updating a Source

You can update a source’s properties from the dashboard or through the SDK.

Using the Dashboard

  1. In the Sources list, click the Update button for the source you want to modify.
  2. Change the desired fields.
  3. Click Save.

Using the SDK

const updatedSource = await stateset.sources.update({
  id: source.id,
  name: "Updated Source Name",
});

console.log("Source updated:", updatedSource);

Deleting a Source

You can delete a source from the dashboard or via the SDK.
await stateset.sources.delete({ id: source.id });
console.log("Source deleted.");

Next Steps

After creating a source, you can associate it with an Agent to give that agent access to the information within the source.
  • Connect to an Agent: Learn how to link this source to one of your agents.
  • Explore different source types: Investigate how to use other source types, like documents or knowledge bases.