assignment-user-matcher 1.0.0 β 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# `
|
|
1
|
+
# `assignment-user-matcher`: Lightning-Fast, Tag-Based User & Assignment Matching
|
|
2
2
|
|
|
3
|
-
[](https://badge.fury.io/js/assignment-user-matcher)
|
|
4
|
+
[](https://github.com/ViljarVoidula/assignment-user-matcher/actions/workflows/npm-publish.yml)
|
|
5
5
|
<!-- Add other badges if you have them, e.g., build status, test coverage -->
|
|
6
6
|
|
|
7
|
-
**Tired of inefficiently assigning tasks or struggling to connect the right users with the right work? `
|
|
7
|
+
**Tired of inefficiently assigning tasks or struggling to connect the right users with the right work? `assignment-user-matcher` is a specialized Node.js library designed for high-performance, near real-time matching of a smaller pool of users to a large volume of assignments, primarily based on shared tags and priority.**
|
|
8
8
|
|
|
9
9
|
It leverages the speed and efficiency of Redis to deliver a robust solution perfect for scenarios like call centers, customer support queues, back-office operations, and more.
|
|
10
10
|
|
|
@@ -18,9 +18,9 @@ In many applications, from customer service platforms to internal task managemen
|
|
|
18
18
|
|
|
19
19
|
Traditional matching systems can become bottlenecks, leading to delays, suboptimal pairings, and frustrated users or customers.
|
|
20
20
|
|
|
21
|
-
## Introducing `
|
|
21
|
+
## Introducing `assignment-user-matcher`: Your Solution for Smart Task Distribution
|
|
22
22
|
|
|
23
|
-
`
|
|
23
|
+
`assignment-user-matcher` tackles these challenges head-on by providing a specialized engine optimized for a common pattern: a relatively small, active set of users (like support agents or back-office staff) processing a continuous, large stream of assignments.
|
|
24
24
|
|
|
25
25
|
**Key Features:**
|
|
26
26
|
|
|
@@ -30,7 +30,7 @@ Traditional matching systems can become bottlenecks, leading to delays, suboptim
|
|
|
30
30
|
* **Optimized for Specific Scenarios:** Excels where a smaller group of users handles a large number of assignments.
|
|
31
31
|
* **User Backlog Management:** Prevents users from being overwhelmed by limiting the number of assignments they can be tentatively matched with.
|
|
32
32
|
|
|
33
|
-
## Why `
|
|
33
|
+
## Why `assignment-user-matcher`?
|
|
34
34
|
|
|
35
35
|
* π **Speed:** Designed for near real-time performance, ensuring assignments are matched and delivered swiftly.
|
|
36
36
|
* π― **Accuracy:** Improves the quality of matches by considering relevant tags and priorities.
|
|
@@ -40,7 +40,7 @@ Traditional matching systems can become bottlenecks, leading to delays, suboptim
|
|
|
40
40
|
|
|
41
41
|
## Core Concepts: How It Works
|
|
42
42
|
|
|
43
|
-
`
|
|
43
|
+
`assignment-user-matcher` operates on a few key principles:
|
|
44
44
|
|
|
45
45
|
1. **Users and Assignments Have Tags:**
|
|
46
46
|
* **Users:** Each user is defined by an ID and a set of `tags` representing their skills, capabilities, or any other relevant attributes (e.g., `['english', 'billing_support', 'tier_1']`).
|
|
@@ -56,11 +56,11 @@ Traditional matching systems can become bottlenecks, leading to delays, suboptim
|
|
|
56
56
|
Redis is used to store user availability, assignment details, and manage the matching process. Its speed is crucial for the near real-time performance of the library. Users are maintained in sorted sets based on their backlog size and last activity, ensuring fair and efficient distribution.
|
|
57
57
|
|
|
58
58
|
5. **User Backlog (`maxUserBacklogSize`):**
|
|
59
|
-
To prevent any single user from being assigned too many tasks at once (even if they are a match), `
|
|
59
|
+
To prevent any single user from being assigned too many tasks at once (even if they are a match), `assignment-user-matcher` maintains a backlog for each user. New assignments are only matched if a user's backlog is below this threshold.
|
|
60
60
|
|
|
61
61
|
## Real-World Use Cases
|
|
62
62
|
|
|
63
|
-
`
|
|
63
|
+
`assignment-user-matcher` is particularly well-suited for:
|
|
64
64
|
|
|
65
65
|
* **π Call Centers:** Routing incoming calls (assignments) to the agent (user) with the right language skills, product knowledge, and availability.
|
|
66
66
|
* **π« Customer Support Ticketing:** Assigning new support tickets to support agents based on their expertise (e.g., "technical_issue," "api_support") and the ticket's urgency.
|
|
@@ -73,11 +73,11 @@ Traditional matching systems can become bottlenecks, leading to delays, suboptim
|
|
|
73
73
|
### 1. Installation
|
|
74
74
|
|
|
75
75
|
```bash
|
|
76
|
-
npm install
|
|
76
|
+
npm install assignment-user-matcher redis
|
|
77
77
|
# or
|
|
78
|
-
yarn add
|
|
78
|
+
yarn add assignment-user-matcher redis
|
|
79
79
|
# or
|
|
80
|
-
pnpm add
|
|
80
|
+
pnpm add assignment-user-matcher redis
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
### 2. Basic Usage
|
|
@@ -85,7 +85,7 @@ pnpm add match-assignment redis
|
|
|
85
85
|
Here's a simple example to get you up and running:
|
|
86
86
|
|
|
87
87
|
```javascript
|
|
88
|
-
import AssignmentMatcher from '
|
|
88
|
+
import AssignmentMatcher from 'assignment-user-matcher'; // or `import { AssignmentMatcher } from 'assignment-user-matcher';`
|
|
89
89
|
import { createClient } from 'redis';
|
|
90
90
|
|
|
91
91
|
async function runExample() {
|
|
@@ -251,7 +251,7 @@ The following example demonstrates adding multiple users and assignments and the
|
|
|
251
251
|
// npm install -D ts-node typescript
|
|
252
252
|
// Then run: ./example.ts
|
|
253
253
|
|
|
254
|
-
import AssignmentMatcher, { User, Assignment } from '
|
|
254
|
+
import AssignmentMatcher, { User, Assignment } from 'assignment-user-matcher';
|
|
255
255
|
import { createClient } from 'redis';
|
|
256
256
|
|
|
257
257
|
async function bootstrap(userCount: number, assignmentCount: number) {
|
|
@@ -345,7 +345,7 @@ bootstrap(USER_COUNT, ASSIGNMENT_COUNT)
|
|
|
345
345
|
|
|
346
346
|
## Important Considerations (Disclaimer)
|
|
347
347
|
|
|
348
|
-
* **Optimized for a Specific Use Case:** `
|
|
348
|
+
* **Optimized for a Specific Use Case:** `assignment-user-matcher` is primarily designed and optimized for scenarios with a **relatively small set of active users processing a large volume of incoming assignments** (e.g., call centers, customer support teams, back-office operations). While it might work for other scenarios, its performance characteristics are best suited for this model.
|
|
349
349
|
* **Redis Dependency:** This library requires a running Redis instance. Ensure your Redis server is adequately provisioned for your workload.
|
|
350
350
|
* **Near Real-Time, Not Instantaneous:** While fast, the matching process involves Redis operations and logic execution. "Near real-time" means it's quick, but not strictly instantaneous with nanosecond precision. The `matchUsersAssignments()` method needs to be called periodically or triggered by events (e.g., new assignment, user becomes available) to perform matching.
|
|
351
351
|
|