This repository contains a dependency-free, local implementation of an AIMatch-style pipeline based on the ESRC structure from the paper:
- Extract: normalize each profile into compact tags/fingerprint text.
- Search: retrieve top-k candidate profiles with TF-IDF cosine similarity.
- Reason: compare shortlisted candidates and select match or abstain.
- Calibrate: produce confidence scores via direct confidence or Swiss-style pairwise ranking.
GitHub repository: https://github.com/mitkox/aimatch
python3 -m pip install -e .queries.jsonl and candidates.jsonl accept rows like:
{"id":"q1","texts":["post 1","post 2"],"metadata":{"source":"x"}}Ground truth rows:
{"query_id":"q1","candidate_id":"c42"}For non-match queries, set "candidate_id": null.
aimatch run \
--queries examples/synthetic/queries.jsonl \
--candidates examples/synthetic/candidates.jsonl \
--output /tmp/predictions.jsonl \
--ground-truth examples/synthetic/ground_truth.jsonl \
--calibration swissIf your vLLM server exposes the OpenAI-compatible API at http://localhost:8000/v1:
aimatch run \
--queries examples/synthetic/queries.jsonl \
--candidates examples/synthetic/candidates.jsonl \
--output /tmp/predictions_llm.jsonl \
--use-local-llm \
--llm-max-concurrency 8 \
--activity-log \
--activity-log-every 10 \
--llm-base-url http://localhost:8000/v1 \
--llm-model mitkoIf your server requires an API key, also pass --llm-api-key ....
Activity logs are printed to stderr so they remain visible while output is still written normally.
For faster runs with fewer LLM calls, use heuristic extraction and LLM only for reasoning:
aimatch run \
--queries examples/synthetic/queries.jsonl \
--candidates examples/synthetic/candidates.jsonl \
--output /tmp/predictions_reason_llm.jsonl \
--extractor-backend heuristic \
--reasoner-backend llm \
--llm-base-url http://localhost:8000/v1 \
--llm-model mitko \
--llm-max-concurrency 8 \
--activity-logaimatch eval \
--predictions /tmp/predictions.jsonl \
--ground-truth examples/synthetic/ground_truth.jsonl \
--target-precision 0.95- This implementation is designed for reproducibility and extension, not production-scale retrieval.
- Heuristic extract/reason is the default; LLM-backed extract/reason is available via CLI flags.
- Use only with data you are authorized to process.
MIT. See LICENSE.