mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
refactor: rename files
This commit is contained in:
@@ -21,26 +21,27 @@ Users ask questions like: *"How does the if statement work?"* or *"Which functio
|
||||
|
||||
```
|
||||
ask262/
|
||||
├── agent.ts # Main ReAct agent - answers user queries
|
||||
├── agent-tools/ # Tool implementations (spec retriever, graph explorer)
|
||||
│ ├── index.ts # Tool exports
|
||||
│ ├── specRetriever.ts # Vector search tool
|
||||
│ ├── sectionRetriever.ts # Section chunk retrieval tool
|
||||
│ ├── graphExplorer.ts # Knowledge graph navigation tool
|
||||
│ └── reranker.ts # Document reranking utility
|
||||
├── constants.ts # Directory paths and model configs
|
||||
├── config.json # API keys and endpoints (user-created)
|
||||
├── setup/ # Data ingestion and graph building
|
||||
├── src/
|
||||
│ ├── agent.ts # Main ReAct agent - answers user queries
|
||||
│ ├── constants.ts # Directory paths and model configs
|
||||
│ ├── agent-tools/ # Tool implementations (spec retriever, graph explorer)
|
||||
│ │ ├── index.ts # Tool exports
|
||||
│ │ ├── specRetriever.ts # Vector search tool
|
||||
│ │ ├── sectionRetriever.ts # Section chunk retrieval tool
|
||||
│ │ ├── graphExplorer.ts # Knowledge graph navigation tool
|
||||
│ │ └── reranker.ts # Document reranking utility
|
||||
│ └── setup/ # Data ingestion and graph building
|
||||
│ ├── ingest.ts # Ingests spec HTML into vector index
|
||||
│ ├── buildGraph.ts # Builds knowledge graph
|
||||
│ ├── stripSpecContainer.ts # Cleans spec HTML files
|
||||
│ ├── htmlAddInternalMethodLink.ts # Adds internal method links
|
||||
│ ├── text-splitters/ # Text chunking utilities
|
||||
│ └── utils/ # Formatting utilities
|
||||
├── test/ # Manual verification tests
|
||||
│ ├── manual/
|
||||
│ │ ├── verify-db.ts # Verify database contents
|
||||
│ │ └── test-spec-retriever.ts
|
||||
│ └── test/ # Manual verification tests
|
||||
│ └── manual/
|
||||
│ ├── verify-db.ts # Verify database contents
|
||||
│ └── test-spec-retriever.ts
|
||||
├── config.json # API keys and endpoints (user-created)
|
||||
├── spec-built/multipage/ # ECMAScript spec HTML files
|
||||
├── engine262/src/ # JavaScript engine implementation
|
||||
├── storage/ # Vector index persistence (LanceDB)
|
||||
|
||||
+4
-4
@@ -9,10 +9,10 @@
|
||||
"lint:fix": "biome check . --write",
|
||||
"lint:fix:unsafe": "biome check . --write --unsafe",
|
||||
"format:fix": "biome format . --write",
|
||||
"ingest": "bun run setup/ingest.ts",
|
||||
"verify-db": "bun run test/manual/verify-db.ts",
|
||||
"agent": "bun run agent.ts",
|
||||
"build": "bun run setup/buildGraph.ts",
|
||||
"ingest": "bun run src/setup/ingest.ts",
|
||||
"verify-db": "bun run src/test/manual/verify-db.ts",
|
||||
"agent": "bun run src/agent.ts",
|
||||
"build": "bun run src/setup/buildGraph.ts",
|
||||
"test": "bun test"
|
||||
},
|
||||
"keywords": [],
|
||||
|
||||
@@ -11,13 +11,18 @@ import {
|
||||
createSectionRetrieverTool,
|
||||
createSpecRetrieverTool,
|
||||
} from "./agent-tools";
|
||||
import { EMBEDDING_MODEL, GRAPH_FILE, STORAGE_DIR } from "./constants";
|
||||
import {
|
||||
CONFIG_FILE,
|
||||
EMBEDDING_MODEL,
|
||||
GRAPH_FILE,
|
||||
STORAGE_DIR,
|
||||
} from "./constants";
|
||||
|
||||
const embeddings = new OllamaEmbeddings({
|
||||
model: EMBEDDING_MODEL,
|
||||
});
|
||||
|
||||
const config = JSON.parse(fs.readFileSync("./config.json", "utf-8"));
|
||||
const config = JSON.parse(fs.readFileSync(CONFIG_FILE, "utf-8"));
|
||||
const apiKey = config.NVIDIA_API_KEY;
|
||||
const baseURL = config.NVIDIA_API_BASE;
|
||||
|
||||
@@ -2,6 +2,7 @@ export const STORAGE_DIR = "./storage";
|
||||
export const SPEC_DIR = "./spec-built/multipage";
|
||||
export const CODE_DIR = "./engine262/src";
|
||||
export const GRAPH_FILE = "./graphology/graph.json";
|
||||
export const CONFIG_FILE = "./config.json";
|
||||
|
||||
// Model configurations
|
||||
export const EMBEDDING_MODEL = "qwen3-embedding:0.6b";
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Manual test script for spec_retriever agent tool
|
||||
* Usage: bun run test/manual/test-spec-retriever.ts "your search query"
|
||||
* Usage: bun run src/test/manual/test-spec-retriever.ts "your search query"
|
||||
*/
|
||||
|
||||
import * as lancedbSdk from "@lancedb/lancedb";
|
||||
@@ -3,17 +3,17 @@
|
||||
* Manual verification script for inspecting LanceDB documents/chunks.
|
||||
*
|
||||
* Usage:
|
||||
* bun run test/manual/verify-db.ts # Show summary (default command)
|
||||
* bun run test/manual/verify-db.ts summary # Show database summary
|
||||
* bun run test/manual/verify-db.ts list # List all sections
|
||||
* bun run test/manual/verify-db.ts section <id> # Show chunks for a section
|
||||
* bun run test/manual/verify-db.ts search "query" # Search by vector similarity (semantic search)
|
||||
* bun run test/manual/verify-db.ts tree # Show full section hierarchy
|
||||
* bun run test/manual/verify-db.ts tree sec-ecmascript-language-source-code # Show subtree from section
|
||||
* bun run test/manual/verify-db.ts sample # Show random samples
|
||||
* bun run test/manual/verify-db.ts large # Show large documents
|
||||
* bun run test/manual/verify-db.ts --help # Show help
|
||||
* bun run test/manual/verify-db.ts <command> --help # Show help for specific command
|
||||
* bun run src/test/manual/verify-db.ts # Show summary (default command)
|
||||
* bun run src/test/manual/verify-db.ts summary # Show database summary
|
||||
* bun run src/test/manual/verify-db.ts list # List all sections
|
||||
* bun run src/test/manual/verify-db.ts section <id> # Show chunks for a section
|
||||
* bun run src/test/manual/verify-db.ts search "query" # Search by vector similarity (semantic search)
|
||||
* bun run src/test/manual/verify-db.ts tree # Show full section hierarchy
|
||||
* bun run src/test/manual/verify-db.ts tree sec-ecmascript-language-source-code # Show subtree from section
|
||||
* bun run src/test/manual/verify-db.ts sample # Show random samples
|
||||
* bun run src/test/manual/verify-db.ts large # Show large documents
|
||||
* bun run src/test/manual/verify-db.ts --help # Show help
|
||||
* bun run src/test/manual/verify-db.ts <command> --help # Show help for specific command
|
||||
*/
|
||||
|
||||
import fs from "node:fs";
|
||||
Reference in New Issue
Block a user