DEV Community

Lalit Indoria
Lalit Indoria

Posted on

Building Quix: A Slack Agent to talk to your apps using natural language

In today's fast-paced work environment, juggling multiple tools can be a major productivity challenge. Constantly switching between platforms for simple tasks is both time-consuming and frustrating. As someone who values efficiency in chat-based interactions, I envisioned a solution to streamline these tasks directly from Slack, a platform where my team and I communicate frequently. This inspired me to build Quix — an AI-powered Slack agent designed to handle various business tool queries seamlessly.

I founded ClearFeed, a platform that helps teams provide support by integrating Slack with other tools. While ClearFeed offers extensive functionalities, I wanted to create something lightweight and focused, allowing teams to resolve conversations within Slack much faster. Here are some scenarios where interacting with tools within Slack proves to be incredibly useful:

What is the status of the Asana integration?** (Query JIRA)
Is the PR to support the chat widget closed?** (Query GitHub)

Beyond querying tools, an agent like Quix can handle even more complex workflows. Imagine effortlessly turning a long Slack thread into a Jira ticket:

Image description

Image description


Repository Structure and Tools Used

The repository follows a TypeScript monorepo structure, with each integration packaged as a separate module. This design ensures that the Express server handling Slack interactions remains independent from integration components, allowing for easy addition and deployment of new integrations. Integration packages reside in the agent-packages/packages/ directory.

Key Tools and Libraries

  • LangChain: For managing language model interactions.
  • Zod: For schema validation.
  • Express: For handling API requests.
  • Slack Web API: For interacting with Slack.

Why LangChain?

LangChain provides uniform APIs, allowing me to query different language models without making significant code changes. This flexibility makes it easy to experiment with or swap models while maintaining a consistent integration structure. Additionally, LangChain, along with Zod, simplifies tool schema definitions, making it effortless to define new tools regardless of the model in use. This ensures that Quix remains highly adaptable and scalable as AI models evolve.


Writing Integrations

Quix integrations are self-contained and follow a consistent pattern. Each integration package consists of:

  • Tools: An array of DynamicStructuredTool instances from LangChain, encapsulating available functions.
  • Prompts: Customizable prompts for tool selection and response generation.
  • Service Classes: API interaction handlers for respective platforms.

For example, the GitHub integration includes tools for searching issues, managing user assignments for issues and pull requests, and fetching member details. Each function includes a description that helps the LLM determine the appropriate tool to invoke, with function arguments defined using Zod for clarity and validation.

new DynamicStructuredTool({
      name: 'search_github_issues',
      description: 'Search GitHub issues or PRs based on status, keywords, and reporter. PRs and Issues are interchangeable terms in GitHub.',
      schema: z.object({
        repo: z.string().describe('The name of the repository to search in'),
        type: z.enum(['issue', 'pull-request']).describe('The type of issue or PR to search for'),
        keyword: z.string().describe('The keyword to search for in issue or PR titles and descriptions'),
        reporter: z.string().describe('The GitHub username of the issue or PR author').optional(),
      }),
      func: async (args: SearchIssuesParams) => service.searchIssues(args)
    }),
Enter fullscreen mode Exit fullscreen mode

Each integration exports the following prompts:

  • toolSelectionPrompt – Helps the LLM decide if this tool should be selected.
  • responseGenerationPrompt – Instructs the LLM on how to generate a response based on the tool's specific requirements. For example, you can specify a hostname format when linking to Jira tickets.

Data Flow

Here's a data flow diagram illustrating the processing in llm.service.ts:

Image description


Installing Quix on Slack

Quix includes an Express server and a Slack app manifest, making it easy to set up a Slack app as an AI-powered assistant within Slack. To install it in your workspace:

  1. Host the Express server – You can use the included Dockerfile for deployment.
  2. Create a new Slack app – Use the provided manifest file, ensuring that the request_url matches your Express server’s endpoint.
  3. Install the app in your Slack workspace – Populate the necessary environment variables, including the Slack Bot Token.

If you’re a Slack admin, consider pinning the app in your workspace to ensure easy access for all team members.


Contributing to Quix

Quix is an open-source project, and community contributions are always welcome. If you're interested, you can install it in your Slack workspace, explore its functionalities, and share your feedback. Reporting issues, suggesting enhancements, or submitting pull requests on GitHub helps refine and expand Quix, making it even more effective for users.

GitHub logo clearfeed / quix

Query your business tools from Slack

🚀 Quix: AI-Powered Slack Agent

Quix is an AI-powered Slack agent that can interact with your business tools such as JIRA, GitHub, HubSpot and more. It allows users to interact with these services directly from Slack channels or through 1:1 chats.

🔗 Supported Integrations

  • Jira
  • GitHub
  • HubSpot
  • Zendesk

✨ Features

  • Slack Integration: Quix can respond to queries when tagged in Slack channels. 🗨️
  • Multi-Service Querying: Supports querying multiple tools.
  • Thread Context: Quix can understand the context of a Slack thread when answering queries.
  • User Query Endpoint: Exposes an endpoint to accept user queries. 🔍

🚀 Setting Up the Slack App

  1. Create a Slack App:

    • Go to the Slack API and create a new app.
    • Choose "From an app manifest" and paste the contents of slack_app_manifest.yml from this repository.
  2. Update the Events Endpoint:

    • In the manifest, replace <EXPRESS_ENDPOINT> with your server's public URL where Slack can send event notifications.




Top comments (0)