Overview
Entity extraction identifies and classifies named entities in text:- People: Names of individuals (CEO, executives, authors)
- Organizations: Companies, institutions, agencies
- Locations: Cities, countries, addresses
- Dates: Temporal references, deadlines, events
- Money: Currency amounts, valuations, prices
- Custom types: Domain-specific entities (products, deals, regulations)
Quick Start
Python SDK
Node.js SDK
Providers
Local NER (DistilBERT)
The default provider uses DistilBERT-NER, a lightweight model for offline entity extraction. Characteristics:- Model: DistilBERT fine-tuned on CoNLL-03
- Size: ~261 MB (downloaded on first use)
- Entity types: PERSON, ORG, LOCATION, MISC (fixed)
- Inference: CPU-based, no GPU required
- Privacy: All processing happens locally
Local NER uses fixed entity types (PERSON, ORG, LOCATION, MISC). For custom entity types, use cloud providers. In Node.js,
LocalNER requires a native build that exports NerModel (the prebuilt npm binaries may not include it).OpenAI Entities
OpenAI’s models provide high-accuracy extraction with custom entity types. Setup:Claude Entities
Anthropic’s Claude excels at nuanced entity extraction with context understanding. Setup:Gemini Entities
Google’s Gemini provides fast, cost-effective entity extraction. Setup:Complete Example
Here’s a full workflow for document entity extraction:Custom Entity Types
Cloud providers support custom entity types tailored to your domain:Finance Domain
Legal Domain
Healthcare Domain
API Reference
EntityExtractor Interface
All entity extractors implement this interface:Entity Object
Each extracted entity contains:Factory Function
Environment Variables
Use Cases
Document Intelligence
Extract structured data from unstructured documents:Knowledge Graph Building
Create entity-relationship graphs from documents:Entity-Based Search
Find documents by entity type:Deal Memo Analysis
Extract structured deal information:Best Practices
- Choose appropriate entity types: Define types specific to your domain
- Set confidence thresholds: Use higher thresholds (0.7+) for critical applications
- Batch extraction: Use
extract_batch()for multiple texts - Cache results: Store extracted entities in document metadata
- Validate entities: Review extracted entities for accuracy in critical workflows
- Use local for privacy: Local NER processes data entirely on-device
Limitations
- Local NER: Fixed entity types (PERSON, ORG, LOCATION, MISC)
- Local NER: Python SDK only (Node.js uses cloud providers)
- Cloud providers: Require API keys and internet connection
- Rate limits: Cloud providers have rate limits based on plan
- Context length: Very long texts may need chunking
Next Steps
Visual Embeddings
Enable image and visual search with CLIP
Embedding Models
Configure text embedding models for semantic search
Python SDK
Complete Python SDK reference
Node.js SDK
Complete Node.js SDK reference