pit-rag

Retrieves point-in-time filtered research documents for quantitative analysis without lookahead bias.

Updated Jun 27, 2026
One-click install
npx skills add https://github.com/HKUST-QUANT-SOCIETY/quantcode --skill pit-rag-hkust-quant-society
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pit-rag
Source: https://github.com/HKUST-QUANT-SOCIETY/quantcode/tree/main/.opencode/groups/fundamental/skills/pit-rag
Command: npx skills add https://github.com/HKUST-QUANT-SOCIETY/quantcode --skill pit-rag-hkust-quant-society

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Quantitative research often suffers from lookahead bias when retrieval systems return documents published after the simulated historical date. This Skill enforces strict point-in-time filtering so every retrieved research report, announcement, or earnings call transcript satisfies published_at <= as_of_date. ## Core Features & Use Cases - Point-in-Time Filtering: Discards any document whose published_at is later than the requested as_of_date, guaranteeing temporal correctness. - Structured Retrieval Pipeline: Parses the query into entities, performs vector search over a Chroma corpus, applies time filtering, then reranks by relevance plus time decay. - Schema-Based I/O: Accepts a PITQuery (query, as_of_date, optional corpus scope) and returns a PITResult that also fills the retrieval field of the research-spec schema. - Use Case: A fundamental analyst backtesting a strategy asks what was known about a company on 2023-06-30; the Skill returns only reports and announcements published on or before that date. ## Quick Start Retrieve all research reports and announcements about a given company as of 2023-06-30, ensuring no document published after that date appears in the results.

Frequently Asked Questions about pit-rag

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent lookahead bias in RAG retrieval for backtesting?

Filter every retrieved document by its published_at timestamp against the requested as_of_date, discarding anything published later. This Skill applies that filter after vector recall and before reranking, so results reflect only information available at the historical point in time.

What is point-in-time retrieval in quantitative research?

Point-in-time retrieval returns only documents whose publication date is on or before a specified historical date. It ensures backtests and historical analyses use only information that was actually available then, avoiding lookahead bias.

Which embedding models and vector database does this retrieval pipeline use?

The pipeline uses Chroma as the local vector store and supports bge-large-zh-v1.5 or OpenAI text-embedding-3 embeddings. Documents are chunked by paragraph with a 50-token overlap before indexing.

What input format does a point-in-time query require?

Queries follow the PITQuery schema with a natural language query string, an as_of_date in YYYY-MM-DD format, and an optional corpus field limiting scope to research_reports, announcements, or earnings_calls.

What are the acceptance criteria and limitations of this retrieval approach?

All returned documents must have published_at strictly on or before as_of_date, with recall at 10 of at least 0.7 on labeled samples and P95 latency under 500ms. Results depend on accurate published_at metadata in the corpus.