bendtherules 70e42eb727 feat(spec-ingestion): unify breakdown strategy with alwaysBreak flag and inline markers
- Consolidate all structural element breakdowns into a single `breakDownSection` function using an `alwaysBreak` flag.
- Introduce `BREAKDOWN_TAGS` configuration array containing metadata (tag, alwaysBreak, title/id selectors) for each element type.
- Replace previous multi‑phase approach with a unified sequential breakdown flow: `emu-clause` (always extracts children) → `emu-table` → `emu-grammar` → `td` → `p`.
- Add inline markers `[Subsection available: title "X" at sectionid: ID]` where content is removed, enabling parent awareness.
- Update documentation to reflect the new unified breakdown logic, tag table, and hierarchical ID format.
- Adjust threshold handling, recursion depth, and metadata tracking to work with the new unified approach.
2026-03-31 14:45:16 +05:30
2026-03-27 18:36:24 +05:30
2026-03-31 13:06:59 +05:30
2026-03-31 12:20:58 +05:30
2026-03-27 17:47:12 +05:30
2026-03-26 19:04:48 +05:30
2026-03-27 17:48:02 +05:30

RAG Pipeline for Language Specification Exploration

This project implements a RAG-based AI chat agent to explore the ECMAScript specification and its implementation in engine262.

Prerequisites

  • Node.js: Version 18+
  • Ollama: Installed locally with an embedding model (e.g., nomic-embed-text)
  • OpenAI-compatible Endpoint: A hosted or local LLM service

Setup

  1. Install dependencies:

    npm install
    
  2. Prepare environment:

    export OPENAI_API_BASE="your_endpoint_base_url"
    export OPENAI_API_KEY="your_api_key"
    
  3. Clone specification: (Ensure ./spec-built/multipage contains the HTML files)

  4. Ingest data:

    node ingest.mjs
    

    Note: This will take significant time as it generates local embeddings via Ollama for both the spec and the implementation.

  5. Build graph:

    node build_graph.mjs
    

Usage

Ask the agent questions about how code relates to the specification:

node agent.mjs "Explain how the 'if' statement works and show its implementation."

The agent will use tools to search the specification, explore the implementation code, and navigate the relationships between them using the graph.

S
Description
MCP server for exploring the ECMAScript specification
Readme
19 MiB
Languages
HTML 49%
JavaScript 32.7%
TypeScript 18.3%