This guide explains how to test the new Semantic Job Matching Agent.
Ensure you have:
- Running PostgreSQL with
pgvectorextension (and Docker container running). GEMINI_API_KEYset in your.envfile.- At least one parsed CV and one analyzed Job Post in the database.
We have provided a script to quickly verify the matching logic using existing data in your database.
Run the following command:
python scripts/test_job_matching.pyThis script will:
- Connect to your database.
- Find a candidate with embeddings (ParsedCV).
- Find a job with embeddings (JobPost).
- Run matching in both directions (Job -> Candidate, Candidate -> Job).
- Print the top matches with scores and explanations.
- Start the backend server:
uvicorn app.main:app --reload
- Open Swagger UI: http://localhost:8000/docs
- Locate
GET /api/v1/documents/{document_id}/matching-jobs. - Enter a valid
document_idof a parsed CV. - Execute.
- Verify the response contains a list of jobs with
match_percentage,similarity_score, andrecommendation.
- Locate
GET /api/v1/jobs/{job_id}/matching-candidates. - Enter a valid
job_idof an analyzed Job Post. - Execute.
- Verify the response contains a list of candidates.
You can also inspect the embeddings and basic similarity directly in SQL.
Check Job Embeddings:
SELECT job_post_id, substring(embedded_text for 50) as text_preview, created_at
FROM job_embeddings
LIMIT 5;Find Similar Jobs manually (SQL):
-- Replace [VECTOR] with a real vector array from a document_embedding
SELECT jp.title, (1 - (je.embedding <=> '[VECTOR]')) as similarity
FROM job_posts jp
JOIN job_embeddings je ON jp.id = je.job_post_id
ORDER BY similarity DESC
LIMIT 5;-
No matches found?
- Ensure you have run
/analyzeon your Job Posts (createsjob_embeddings). - Ensure you have run
/parseand/analyze(or just text extraction?) on CVs. Note: Embeddings for CVs are created during parsing/upload? - Correction: Embeddings for CVs are usually created during parsing or upload. Check
DocumentEmbeddingtable.
- Ensure you have run
-
pgvector error?
- Ensure the extension is enabled:
CREATE EXTENSION IF NOT EXISTS vector; - Ensure your Docker container has the pgvector image.
- Ensure the extension is enabled: