TypeScript NLP pipeline for fast, structured text understanding
GitHub · NPM · Author: Damilare Osibanjo
Qirrel gives you a production-ready pipeline for extracting structure from raw text:
- Tokenization with positional metadata.
- Rule-based extraction for email, phone, URL, and number entities.
- Optional LLM enrichment via adapter pattern.
- Built-in caching and lifecycle events.
- Batch processing with controllable concurrency.
bun add qirrelimport { processText } from 'qirrel';
const result = await processText(
'Contact Jane at jane@example.com or +44 20 7946 0958',
);
console.log(result.data?.entities);| Feature | API | Notes |
|---|---|---|
| Single-text processing | processText(text) |
Returns QirrelContext |
| Batch processing | processTexts(texts, configPath?, { concurrency }) |
Keeps input order |
| Custom pipeline | new Pipeline(configPath?) |
Add processors and hooks |
| Events | pipeline.on(PipelineEvent.*, handler) |
Run/processor/error telemetry |
| Caching | pipeline.isCached/getCached/setCached |
LRU + TTL |
| LLM adapter | pipeline.getLLMAdapter() |
gemini, openai, generic |
import { processTexts } from 'qirrel';
const inputs = [
'US: +1 415 555 2671',
'URL: https://example.com',
'Email: team@example.com',
];
const outputs = await processTexts(inputs, undefined, { concurrency: 2 });
console.log(outputs.map((o) => o.data?.entities));import { Pipeline } from 'qirrel';
const pipeline = new Pipeline('./config-with-llm.yaml');
await pipeline.init();
const adapter = pipeline.getLLMAdapter();
if (adapter) {
const response = await adapter.generate('Summarize: Qirrel is an NLP pipeline.');
console.log(response.content);
}llm:
enabled: true
provider: openai
apiKey: ${QIRREL_LLM_API_KEY}
model: gpt-4o-mini
timeout: 30000
cacheTtl: 300000This repository includes GitHub Actions workflows:
ci.yml: runs install, build, tests, and coverage on push/PR.release.yml: runs release checks and can publish to npm on version tags (v*) whenNPM_TOKENis configured.
Qirrel ships with an agent-native bridge plus an MCP server so the same parsing core works for API code and agent toolchains.
import { createQirrelAgentBridge } from "qirrel";
const bridge = createQirrelAgentBridge();
const result = await bridge.callTool("qirrel.parse_text", { text: "Email me@example.com" });
console.log(result.structuredContent);Run MCP server:
bun run mcp:startRun benchmark:
bun run bench:agentFramework comparison benchmark:
bun run bench:frameworksGenerate local markdown benchmark report:
bun run bench:report- Docs Home
- API Reference
- Configuration Guide
- Usage Examples
- Basic Usage
- Caching
- Pipeline Events
- LLM Integration
- Architecture Walkthrough
- Agent-Native Integration
- Benchmarks
- Benchmark Report (Local Machine)
- Framework Comparison
- Ecosystem Comparison
- Agent Feature Roadmap
See CONTRIBUTING.md.
MIT. See LICENSE.