Extract Structured Personal Data with Self-Hosted LLM (Mistral NeMo)
detail.loadingPreview
This workflow efficiently extracts specific personal data fields like name, contact type, and details from incoming chat messages using a self-hosted Mistral NeMo LLM via Ollama. It ensures high accuracy and structured output, automatically correcting any parsing errors.
About This Workflow
Managing sensitive personal data from diverse communication channels can be challenging. This n8n workflow provides a robust, privacy-first solution to automatically extract structured personal data from incoming chat messages. By integrating with a self-hosted Large Language Model (LLM) like Mistral NeMo via Ollama, you maintain complete control over your data, avoiding third-party API exposure. The workflow listens for chat inputs, intelligently parses them using a predefined JSON schema, and even includes an auto-fixing mechanism to ensure the extracted data always conforms to your desired structure, ready for further processing or storage in your systems.
Key Features
- Self-Hosted LLM Integration: Utilize your own Mistral NeMo LLM instance via Ollama for enhanced data privacy and control.
- Structured Data Extraction: Define a custom JSON schema to precisely extract fields like
name,surname,commtype,contacts,timestamp, andsubjectfrom free-text chat inputs. - Automated Output Correction: An "Auto-fixing Output Parser" intelligently re-prompts the LLM to correct its response if it fails to meet the defined JSON schema, ensuring reliable structured output.
- Real-time Chat Trigger: Instantly process incoming chat messages, making it suitable for dynamic communication flows.
- Configurable LLM Parameters: Optimize LLM performance and resource usage with settings like
useMLockandkeepAlivein the Ollama node.
How To Use
- Set up Chat Trigger: Configure the "When chat message received" node to connect to your desired chat platform (e.g., Slack, Microsoft Teams, or a custom webhook).
- Configure Ollama Chat Model: Ensure your Ollama instance with
mistral-nemo:latestis running. In the "Ollama Chat Model" node, set up your Ollama API credentials and optionally adjustuseMLock,keepAlive, andtemperaturefor optimal performance. - Define Extraction Schema: In the "Structured Output Parser" node, review and modify the provided JSON schema to match the exact personal data fields you wish to extract. Remember to mark required fields.
- Prompt the LLM: In the "Basic LLM Chain" node, verify the system message to guide the LLM to extract data based on your defined JSON schema. Ensure it references the current date for context.
- Enable Auto-Fixing: The "Auto-fixing Output Parser" is pre-configured to automatically re-engage the LLM if its initial output doesn't conform to your schema, ensuring robust data extraction. No manual configuration is typically needed here.
- Process Extracted Data: The "Extract JSON Output" node will provide the clean, structured data for subsequent actions in your workflow, such as saving to a database or sending to another service.
Apps Used
Workflow JSON
{
"id": "d83bb4d3-0d69-463c-aa3d-9d9d7d4416d2",
"name": "Extract Structured Personal Data with Self-Hosted LLM (Mistral NeMo)",
"nodes": 27,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: d83bb4d3-0d69...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.
Automate Getty Images Editorial Search & CMS Integration
This n8n workflow automates searching for editorial images on Getty Images, extracts key details and embed codes, and prepares them for seamless integration into your Content Management System (CMS), streamlining your content creation process.