Introduction
ChessGrammar is a tactical pattern recognition engine for chess. Classification, not evaluation.
ChessGrammar is a specialized inference engine that detects, classifies, and explains tactical patterns in chess positions. It answers a different question than traditional engines: not "what is the best move?" but "what tactic exists here?"
What ChessGrammar does
Send a FEN position or a PGN game. Receive a structured list of every tactical pattern present — with the triggering move, target squares, material gain, and an optional forcing sequence.
{
"tactics": [
{
"pattern": "fork",
"trigger_move": "d4e2",
"target_squares": ["g1", "c3"],
"gain": 700,
"is_mate": false,
"sequence": ["d4e2", "g1g2", "e2c3"]
}
],
"count": 1,
"depth": "l2",
"performance_ms": 48.2
}
Classification, not evaluation
General-purpose chess engines (Stockfish, Leela Chess Zero) evaluate positions — they compute the best move and an evaluation score. They can find a fork, but they won't label it as a fork or explain why it works.
ChessGrammar classifies. Each detected pattern comes with a formal type label (fork, pin, skewer...), the pieces involved, and the material consequence. This makes it useful for:
- Tactics trainers — auto-generate exercises from any game or position
- Game analysis tools — annotate played games with tactical labels
- Chess databases — tag and search positions by tactic type
- EdTech platforms — explain chess tactics programmatically
- Research — quantify tactical complexity across tournaments or players
Key characteristics
| Property | Detail |
|---|---|
| Patterns | 10 tactical patterns (fork, pin, skewer, discovered attack, double check, back rank mate, smothered mate, deflection, interference, trapped piece) |
| Depth modes | L1 (structural scan, ~13ms) and L2 (forcing tree confirmation, ~125ms) |
| Deterministic | Same input produces the same output, every time. No neural network variance. |
| Stateless | Pure REST API. No sessions, no state. One call per analysis. |
| Format | Accepts FEN (single position) or PGN (full game) |
Developer Preview
ChessGrammar is currently in Developer Preview. The API is accessible without authentication, subject to rate limits (30 requests/minute, 3 game analyses/day per IP). The engine is actively evolving — new patterns and endpoints are being developed.
No API key is required during the preview period. Get in touch if you need higher limits.