πΌ Yojaka AI (Agentic Profile Matching Engine)¶
Production-Grade AI Recruiter & Profile Matching Engine built with LangGraph 1.x Native Commands, HyDE Query Synthesis, Parent-Document Chunking, Air-Gapped Local Inference (Ollama / vLLM), Calibrated Margin Routing, Parallel Dual-Rubric Subgraphs, Layout-Aware Section Parsing, Anthropic Contextual Retrieval, Two-Stage Cross-Encoder Reranking, Hybrid RAG, Dynamic Skill Expansion, Zero-Disk In-Memory Upload, and Model Context Protocol (MCP).
π‘ What is Yojaka (ΰ€―ΰ₯ΰ€ΰ€)?
In classical Sanskrit, ΰ€―ΰ₯ΰ€ΰ€ (Yojaka) derives from the root ΰ€―ΰ₯ΰ€ΰ₯ (yuj) β meaning to connect, unite, align, or orchestrate. Rather than treating candidate vetting as a cold keyword gatekeeper, Yojaka AI operates as an intelligent orchestrator: parsing unstructured human potential, dynamically expanding semantic equivalences, and cascading through structured reasoning to match talent with purpose.

β‘ Core Highlights & Capabilities¶
- π― 3-Stage Cascading Funnel (
O(N) β O(K)): Coarse hybrid vector/lexical retrieval (Stage 1) β structured LLM profile audit (Stage 2) β grounded decision synthesis with tailored interview questions (Stage 3). Eliminates rate-limit bottlenecks and token exhaustion. - 𧬠Advanced RAG & Air-Gapped Local Inference (ADR-019): Hypothetical Document Embeddings (HyDE) query synthesis, hierarchical small-to-big parent-document chunk mapping (150β250 token child chunks linked to 1,000β1,500 character parent blocks), pre-retrieval faceted metadata filtering, and zero-cloud air-gapped local model inference via Ollama and vLLM.
- π Calibrated Margin Routing & Subgraphs (ADR-018): Mathematical embedding margin gating (\(\Delta = \text{Top1} - \text{Top2} \ge 0.12\)) dispatching confident queries in <2ms at $0 token cost, native LangGraph
Command(goto=...)destination routing, concurrent dual-rubric candidate evaluation, and isolated typed subgraphs. - π Layout-Aware Section Document Parsing: Parses PDF visual layout blocks (
pymupdf), DOCX paragraph runs, and text delimiters into canonical sections (SUMMARY,EXPERIENCE,SKILLS,EDUCATION), preserving multi-role work histories without mid-sentence truncation. - π§ Anthropic Contextual Retrieval Prepending: Situates isolated resume chunks with 50β80 word document metadata banners before dense embedding and BM25 indexing, preserving pristine candidate text for recruiter UI display.
- βοΈ Two-Stage Hybrid Retrieval & Cross-Encoder Reranking: Combines dense vector cosine similarity with BM25 Okapi lexical scoring, followed by fine-grained
cross-encoder/ms-marco-MiniLM-L-6-v2reranking with Sigmoid score calibration and Reciprocal Rank Fusion (RRF). - π Zero-Disk In-Memory Upload & Ephemeral PII Isolation: Ingests
.pdf,.docx, and.txtfiles directly in memory viaio.BytesIOlayered throughCompositeVectorStorewith session-scoped in-memory vector stores (ADR-016). - π₯οΈ Dual Presentation Layer: Clean
<75-LOCStreamlit conductor (app.py) featuringst.write_streamtypewriter streaming and live tool execution tracing, coupled with a headless FastAPI sidecar (api/) exposing REST and Server-Sent Events (SSE) endpoints. - π Model Context Protocol (MCP) Dual Gateway: Hot-swap between in-process tool execution and FastMCP JSON-RPC
stdioservers (ADR-001).
ποΈ System Architecture¶

π Documentation & Deep Dive: For comprehensive interactive dataflow diagrams, mathematical scoring formulations, and security specifications, explore Technical Architecture or visit the Online Documentation Site.
π― 3-Stage Cascading Screening Funnel¶
Candidate evaluation cascades across 3 tiers to optimize LLM token consumption O(N) β O(K):

π§© Supported Capabilities & Tech Stack¶
| Category | Technologies & Standards | Configuration / Usage |
|---|---|---|
| Agent Framework | LangGraph (StateGraph, MemorySaver, LLM Intent Router) | agent/ modular package |
| Presentation UI | Streamlit (Modular Component Architecture, st.write_stream) | ui/ modular package & app.py |
| REST & SSE API | FastAPI, Uvicorn, Server-Sent Events (SSE) Streaming | api/ package (routes.py, app.py) |
| Vector Storage | ChromaDB, InMemoryVectorStore (Zero-Disk Cloud Fallback), Qdrant | BaseVectorStore protocol injection |
| Sparse & Rerank | Rank-BM25 (BM25Okapi), Sentence Transformers Cross-Encoder (ms-marco-MiniLM-L-6-v2) | services/reranker.py & job_matcher.py |
| LLM Providers | Groq API (Llama 3.3 70B), Google Gemini Pro, Sarvam AI (sarvam-105b), OpenAI | .env credentials & UI dropdown |
| Document Ingestion | Layout Section Parsing (SectionParser), Contextual Retrieval (ContextualEnricher), PyMuPDF, python-docx | IngestionService + services/ |
| Protocol Standards | Model Context Protocol (MCP) (FastMCP stdio JSON-RPC 2.0) | USE_MCP=True/False |
| Observability | Structured JSON Logs, Langfuse, OpenTelemetry (OTLP), @trace_node | OBSERVABILITY_BACKEND |
| Background Workers | Celery distributed task queue + Redis 7 broker & state backend | docker-compose.yml |
β‘ 60-Second Quickstart¶
1. Clone & Setup Environment¶
# Clone the repository
git clone https://github.com/shashankch/yojaka-ai-profile-matching-engine.git
cd yojaka-ai-profile-matching-engine
# Create and activate virtual environment (Python 3.10+)
python3 -m venv .venv
source .venv/bin/activate
# Install in editable mode with dependencies
pip install -e .
2. Configure Credentials¶
| Variable | Required? | Default | Description |
|---|---|---|---|
GROQ_API_KEY | Conditional | "" | Free-tier fast default for Llama 3.3 70B inference. |
GEMINI_API_KEY | Conditional | "" | Google Gemini 3.8 Pro / Flash. |
TAVILY_API_KEY | Optional | "" | Real-time external web search for tech trends & company intelligence. |
OPENAI_API_KEY | Optional | "" | OpenAI GPT-4o / GPT-4o-mini models. |
π‘ For the complete configuration reference, see Architecture Section 14 and
.env.example.
3. Generate Mock Data & Ingest¶
# Generate synthetic multi-format candidate resumes (34 profiles: PDF, DOCX, TXT)
python -m agentic_profile_matching.generate_dataset
# Chunk, enrich, and vector-index candidate profiles into ChromaDB (Idempotent)
python -m agentic_profile_matching.resume_rag
4. Launch Application¶
Option A: Interactive Streamlit Recruiter Dashboard
Access the dashboard athttp://localhost:8501. Option B: Headless FastAPI Gateway Sidecar
python -m agentic_profile_matching.api.main
# Or via uvicorn directly:
uvicorn agentic_profile_matching.api.app:app --host 0.0.0.0 --port 8000
http://localhost:8000/docs. π³ Docker Deployment¶
# Start Streamlit UI, Redis Broker, and Celery Background Worker
docker compose up -d
# View real-time logs
docker compose logs -f
π§ͺ Testing & Automated Quality Gates¶
# Run complete unit and integration test suite (127 tests)
pytest tests/ -v
# Run RAG Evaluation Benchmark Suite (Recall@K, MRR & Faithfulness)
pytest tests/eval/ -m eval -v
# Run Ruff linter and code formatter checks
ruff check src/ tests/
ruff format --check src/ tests/
π Technical Documentation & Resources¶
- π Online Documentation Site (MkDocs Material): Full interactive documentation with instant search, dark mode, high-res C4 diagrams, and ADR catalog hosted on GitHub Pages.
- ποΈ System Architecture & Technical Specifications: Deep dive on dataflow sequences, mathematical formulations, state transitions, and distributed scaling.
- π Architecture Decision Records (ADRs 001β019): Complete catalog of formal design decisions, evaluated alternatives, and trade-offs.
- πΊοΈ Implementation Roadmap: Phased milestones (Completed Phases 1β19 and Future Milestones Phases 20β22).
- π‘οΈ Engineering Conventions: Architectural patterns, Pydantic V2 schemas, error boundaries, and type safety rules.
- π€ Contributing Guidelines: Local developer setup, branching conventions, and quality gates.
- π Changelog: Semantic versioning release history.
- π License: Apache License 2.0.
βοΈ License¶
This project is licensed under the Apache License 2.0 β see the LICENSE file for details.