mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-19 00:31:06 +00:00
8f26db5a1faecbac675789ef4c872677f4ac5f1d
Update init_engine262.sh to add the engine262 repository as a squashed subtree instead of a shallow submodule. Adjust usage comments, add existence check for the target directory, and update echo messages accordingly.
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
-
Install dependencies:
npm install -
Prepare environment:
export OPENAI_API_BASE="your_endpoint_base_url" export OPENAI_API_KEY="your_api_key" -
Clone specification: (Ensure
./spec-built/multipagecontains the HTML files) -
Ingest data:
node ingest.mjsNote: This will take significant time as it generates local embeddings via Ollama for both the spec and the implementation.
-
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.
Languages
HTML
49%
JavaScript
32.7%
TypeScript
18.3%