ARTIFICIAL INTELLIGENCE
The Intelligence Layer
Zero-shot time series prediction using Amazon Chronos and our proprietary Spatial Parallel Search.
Spatial Parallel Search
With limited temporal data, we cannot rely solely on historical regression. Our insight: Space can substitute for Time.
If Region A (Target) matches Region B (Source) in November, then Region B's December outcome is a strong predictor for Region A's future.
Algorithm: find_spatial_parallels
- Vectorization: Convert target PIN's history into a 3D Pulse Vector
[Growth, Flow, Labor]. - KNN Search: Scan 19,000+ PINs to find "Parallel Universes" using Cosine Similarity.
- Trajectory Cloning: Project the future trajectory of the top-k parallels onto the target.
cos(θ)
Vector Similarity
src/attestation.py: Attestor.chat
def chat(self, message, context):
# 1. Format Data Context
data_block = self._format_context(context)
# 2. Inject into System Prompt
full_prompt = f"""
## Current Data Context
{data_block}
## User Question
{message}
"""
# 3. LLM Generation
return self.client.chat.completions.create(
model="minimax-m2.1",
messages=[{
"role": "user",
"content": full_prompt
}],
temperature=0.4
)The Attestor Engine
The Attestor class (src/attestation.py) is the brain of the chatbot. It uses a specialized System Prompt to enforce a "Weather Forecast" persona.
Intent Parsing
Uses regex/LLM to extract structured intents from natural language.
"What about Delhi?" → { location: 'Delhi', intent: 'forecast' }Context Injection
The ContextEngine injects seasonality drivers into the LLM prompt.
System: "It is Harvest Season in Punjab. Expect high labor movement."