Skip to content

Enhance Resume Tailoring System: Connect n8n to FAISS + Schema Enforcement #60

@BPMSoftwareSolutions

Description

@BPMSoftwareSolutions

Overview

The resume tailoring system has a mature, production-grade RAG infrastructure (FAISS + sentence-transformers) that is currently disconnected from the n8n workflows. The n8n workflows use simple keyword matching instead of semantic search, resulting in lower-quality resume tailoring.

Problem Statement

  • ✅ Production-grade RAG system exists (src/rag/)
  • ✅ Comprehensive experience data (736 lines, 15+ employers)
  • ⚠️ n8n workflows use keyword matching (not using FAISS)
  • ⚠️ No schema enforcement or guardrails
  • ⚠️ ~5% hallucination rate
  • ⚠️ ~45s end-to-end latency

Solution

Implement a 3-tier enhancement plan:

Tier A (1-2 weeks): Connect to FAISS + Add Schema

  • Phase A1: Connect n8n to FAISS vector store
  • Phase A2: Add JSON schema enforcement + guardrails
  • Phase A3: End-to-end testing and optimization
  • Expected Impact: 40-50% quality improvement

Tier B (3-4 weeks, optional): Fine-tune LoRA Adapter

  • Collect SFT pairs from past tailored resumes
  • Train LoRA adapter on Llama 3.1-8B
  • Deploy and A/B test
  • Expected Impact: 20-30% additional improvement + 2x faster inference

Tier C (ongoing): Advanced Features

  • Prompt caching for repeated jobs
  • Tool-use / function calling
  • Feedback loop for continuous improvement

Success Metrics

| Metric | Current | Target (Tier A) | Target (Tier B) |
|--------|---------|-----------------|-----------------||
| Retrieval Precision@5 | N/A | > 0.8 | > 0.85 |
| Schema Compliance | ~70% | 100% | 100% |
| Hallucination Rate | ~5% | < 1% | < 0.5% |
| End-to-End Latency | ~45s | < 30s | < 15s |
| User Quality Rating | N/A | 3.5/5 | 4.5/5 |

Documentation

Comprehensive documentation has been created in n8n/docs/:

  • README_ENHANCEMENT_PLAN.md - Index and navigation
  • ENHANCEMENT_SUMMARY.md - Executive summary
  • CODEBASE_REVIEW_AND_INTEGRATION_PLAN.md - Detailed analysis
  • ENHANCEMENT_ROADMAP.md - Full roadmap
  • QUICK_START_TIER_A_PHASE_1.md - Implementation guide
  • TIER_A_PHASE_1_SETUP.md - Detailed Phase 1 guide
  • TIER_A_PHASE_2_SCHEMA.md - Detailed Phase 2 guide
  • IMPLEMENTATION_CHECKLIST.md - Day-by-day checklist

Related Issues

Files to Create/Modify

New Files (Tier A)

  • n8n/scripts/query_faiss_vector_store.py - FAISS bridge
  • n8n/scripts/validate_resume_output.py - Schema validator
  • n8n/schemas/resume_output.json - Output schema
  • .agent/prompts/system.tailor.guardrails.md - Enhanced prompt

Modified Files (Tier A)

  • n8n/n8n/workflows/ingest.json - Add FAISS retrieval
  • n8n/n8n/workflows/tailor.json - Add validation

Acceptance Criteria

  • All sub-issues (Tier A Phase 1, 2, 3) are completed
  • All success metrics for Tier A are met
  • Documentation is updated
  • End-to-end testing passes on 10 diverse job descriptions
  • Quality metrics are documented

Labels

  • enhancement
  • rag
  • n8n
  • quality
  • high-priority

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions