[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80704":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":14,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":9,"rankLanguage":9,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":9,"pushedAt":9,"updatedAt":24,"readmeContent":25,"aiSummary":26,"trendingCount":15,"starSnapshotCount":15,"syncStatus":27,"lastSyncTime":28,"discoverSource":29},80704,"SQL-ManyThing","IOchair\u002FSQL-ManyThing","IOchair","Turn any source tree into a local SQLite database. FTS5 trigram search across 89K files in seconds. One file. No server. No network.",null,"Python",59,3,45,1,0,7,14,4,1.81,"MIT License",false,"master",[],"2026-06-12 02:04:05","# SQL-ManyThing\n\n**Turn any source tree into a local SQLite database. Full-text search 89,000 files in seconds. One file. No server. No network.**\n\nSQL-ManyThing builds a FTS5 trigram index of your entire codebase, adds optional symbol\u002Fgraph enrichment, and records every query so agents get smarter with each session.\n\n> 🇨🇳 [中文版](README.zh-CN.md)\n\n---\n\n## The Shock Test\n\nA full Unreal Engine 5.8 install — indexed locally, queried locally:\n\n```\n89,203 files indexed\n~3.0 GB single SQLite database\nFull-text search: seconds\nUHT reflection symbols: 4,455 classes · 3,247 structs · 1,590 enums · 8,902 functions\n```\n\nThis is the stress test. The framework works on anything with files: JS\u002FTS libraries, Python tools, Java projects, monorepos, generated code, build outputs — whatever you point it at.\n\n---\n\n## Why This Exists\n\nMost AI agent code search is still grep + cat: linear scan, whole-file reads, repeated loading, exploding token budgets. Every alternative has friction:\n\n| | grep | LSP | Cloud RAG | **SQL-ManyThing** |\n|---|---|---|---|---|\n| **Offline** | ✅ | ✅ | ❌ needs network | **✅** |\n| **Query speed** | O(n) scan | O(1) jump | ms + network | **ms local FTS5** |\n| **Token cost** | whole-file reads | precise but narrow | retrieval + stitching | **bounded `substr()`** |\n| **Auditable** | ✅ | ❌ black box | ❌ black box | **✅ pure SQL** |\n| **Language-agnostic** | ✅ | ❌ language-locked | ✅ | **✅ any file** |\n| **Self-built index** | ❌ | ✅ auto | ❌ external service | **✅ local SQLite** |\n\nAny index beats grep. SQLite FTS5 is the simplest one that works at scale.\n\n---\n\n## Core Idea\n\nModel code search as A* search:\n\n```\nstate space = files + rows + symbols + graph nodes + trace history\ng(n)        = queries \u002F tool calls \u002F tokens already spent\nh(n)        = remaining cost estimated by rank, symbol precision, graph coverage, trace reuse\noperator    = one SQL query or one bounded source extract\ngoal        = evidence-rich answer with minimal source text\n```\n\n**Narrow first. Extract second. Answer from evidence.**\n\nThis is nearly inverted from mainstream RAG: instead of retrieving chunks and stuffing context, FTS5 locates targets, `substr()` extracts proof, and full files never enter the context window.\n\n---\n\n## Quick Start\n\n### Phase 1 — Build the FTS5 Index\n\n```bash\n# Any project\npython3 scripts\u002Fphase1\u002Fmanything_build_db.py \u002Fpath\u002Fto\u002Fproject \\\n  --git --ext .ts,.tsx,.js,.jsx,.json,.md\n\n# Plain directory with .gitignore\npython3 scripts\u002Fphase1\u002Fmanything_build_db.py \u002Fpath\u002Fto\u002Fproject \\\n  --gitignore \u002Fpath\u002Fto\u002Fproject\u002F.gitignore\n\n# Unreal Engine installed build\npython3 scripts\u002Fphase1\u002Fmanything_build_db.py \u002Fpath\u002Fto\u002FEngine \\\n  --gitignore \u002Fpath\u002Fto\u002FEngine\u002F.gitignore \\\n  --profile unreal-installed-core\n```\n\nOutput: `\u003Cproject>\u002F.srcidx\u002Fsource.db`\n\n### Phase 2 — Enrich (Optional)\n\n```bash\n# Symbol enrichment\npython3 scripts\u002Fphase2\u002Fenrich_cymbal.py \u002Fpath\u002Fto\u002Fproject\n\n# Graph\u002Fdocument enrichment\npython3 scripts\u002Fphase2\u002Fenrich_graphify.py \u002Fpath\u002Fto\u002Fproject\n\n# Unreal UHT reflection metadata\npython3 scripts\u002Fphase2\u002Fuht_enrich.py \\\n  --db \u002Fpath\u002Fto\u002FEngine\u002F.srcidx\u002Fsource.db \\\n  --uht-dir \u002Fpath\u002Fto\u002FEngine\u002FIntermediate\u002FBuild\u002FWin64\u002FUnrealEditor\u002FInc \\\n  --source-prefix Engine\u002F --batch 500\n```\n\n### Phase 3 — Query Tracing\n\n```bash\n# Initialize trace database\npython3 scripts\u002Fphase3\u002Fmanything_query_log.py init\n\n# Install the sqlite3 wrapper\nmkdir -p ~\u002F.local\u002Fbin\ncp scripts\u002Fphase3\u002Fsqlite3_wrapper.sh ~\u002F.local\u002Fbin\u002Fsqlite3\ncp scripts\u002Fphase3\u002FSQL-ManyThing-query-log ~\u002F.local\u002Fbin\u002FSQL-ManyThing-query-log\nchmod +x ~\u002F.local\u002Fbin\u002Fsqlite3 ~\u002F.local\u002Fbin\u002FSQL-ManyThing-query-log\n```\n\nEnsure `~\u002F.local\u002Fbin` precedes `\u002Fusr\u002Fbin` in `PATH`.\n\n```bash\n# Register a project\necho 'MANYTHING_myproject=\"\u002Fpath\u002Fto\u002Fproject\"' >> ~\u002F.hermes\u002Fmanything\u002Faliases.sh\n\n# Query through the virtual path\nsqlite3 \u002Fmanything\u002Fmyproject\u002Fsource.db \"SELECT COUNT(*) FROM files\"\n\n# Review trace history\nSQL-ManyThing-query-log import\nsqlite3 :trace \"SELECT id, project, tag, substr(sql_text,1,120) FROM query_trace ORDER BY id DESC LIMIT 10\"\n```\n\n---\n\n## What Gets Built\n\n**Per project:**\n```\n\u003Cproject>\u002F.srcidx\u002Fsource.db\n```\n\n**Schema:**\n```\nfiles                   — file metadata + full text\nfiles_fts               — FTS5 trigram index over path + content\nfile_enrich             — symbol\u002Fdomain enrich JSON per file\nenrich_graphify_nodes   — AST\u002Fdocument nodes\nenrich_graphify_edges   — graph\u002Fdocument edges\n```\n\n**Global (Phase 3):**\n```\n~\u002F.hermes\u002Fmanything\u002Fquery_log.db    — query trace database\n~\u002F.hermes\u002Fmanything\u002Faliases.sh      — project aliases\n~\u002F.hermes\u002Fmanything\u002Fpending.jsonl   — pending query log buffer\n```\n\n---\n\n## Query Examples\n\n**Find files by content:**\n```sql\nSELECT path, rank FROM files_fts\nWHERE files_fts MATCH 'layout prepare'\nORDER BY rank LIMIT 20;\n```\n\n**Project shape at a glance:**\n```sql\nSELECT ext, COUNT(*) FROM files\nGROUP BY ext ORDER BY COUNT(*) DESC;\n```\n\n**Bounded source extraction** (never read the whole file):\n```sql\nSELECT instr(content, 'export function layout') FROM files WHERE path='src\u002Flayout.ts';\nSELECT substr(content, 1200, 1600) FROM files WHERE path='src\u002Flayout.ts';\n```\n\n**Symbol search across enrichment:**\n```sql\nSELECT f.path,\n       json_extract(s.value, '$.name') AS name,\n       json_extract(s.value, '$.kind') AS kind\nFROM file_enrich e\nJOIN files f ON f.id = e.file_id,\n     json_each(e.symbols) AS s\nWHERE json_extract(s.value, '$.name') LIKE '%layout%'\nLIMIT 50;\n```\n\n**Reuse past queries as agent memory:**\n```sql\nWITH intent(term) AS (\n  VALUES ('files'), ('symbols'), ('graph'), ('README'), ('package'), ('src')\n)\nSELECT id, project, tag, note, substr(sql_text, 1, 180)\nFROM query_trace\nWHERE project = 'myproject'\n  AND (tag IS NOT NULL OR EXISTS (\n    SELECT 1 FROM intent WHERE lower(sql_text) LIKE '%' || lower(term) || '%'\n  ))\nORDER BY tag IS NULL, id DESC LIMIT 12;\n```\n\n**Tag a useful query for future sessions:**\n```sql\nINSERT INTO query_notes (log_id, note, tag, created_at)\nVALUES (42, 'overview entrypoint query', 'useful_pattern', strftime('%s','now'));\n```\n\n---\n\n## Meta-Strategy (Reproduction Guide)\n\nYou can reproduce this project with three prompts executed in sequence:\n\n1. **FTS5 + trigram full-text index** the target project; design your own filter rules\n2. **Interactively query the DB**, discover enrichment table designs, write batch enrichment scripts\n3. **Auto-ingest SQL queries** into the trace database, enabling historical query exploration before running new searches\n\n---\n\n## Design Principles\n\n- **SQLite first.** Query everything with SQL. One file, fully inspectable.\n- **Build once, reuse forever.** Index cost is paid once; queries are free.\n- **Trace behavior, not just answers.** Every session leaves navigable breadcrumbs for the next.\n- **Never read whole files.** Bounded `substr()` proves the answer without blowing context.\n- **Profile policies over `.gitignore` assumptions.** Control what gets indexed explicitly.\n- **Project-agnostic by default.** Unreal-specific and other project lessons live in `references\u002F`, not the core.\n\n---\n\n## Why Raw Scripts, Not a Unified CLI\n\nEvery script is a stable entrypoint: `python3 scripts\u002Fphase1\u002Fmanything_build_db.py ...`\n\nA unified `manything build` wrapper would shift every token position in every command string. Transformer positional encoding is sensitive to displacement; even small shifts introduce noise in agent reasoning. By keeping raw scripts:\n\n- Token positions across phases stay predictable\n- Agent-issued commands in query traces are reproducible verbatim\n- Zero cost forcing an agent to learn wrapper conventions\n\nSame principle drives the Phase 3 sqlite3 wrapper: intercept at the binary level, never modify the query string reaching the LLM context.\n\n---\n\n## Windows \u002F WSL Notes\n\nFor Windows-hosted repositories, run Phase 1 indexing with Windows Python when possible — DrvFs writes from WSL are slower. WSL can query the resulting database fine.\n\nTemplate included: `templates\u002Frun_phase1_unreal_windows.bat`\n\n---\n\n## References\n\nStart here:\n```\n.hermes\u002F                — Hermes Agent project context\nreferences\u002FINDEX.md\nscripts\u002FINDEX.md\n```\n\nKey references:\n```\nreferences\u002Fphase1\u002Fphase1-setup.md\nreferences\u002Fphase1\u002Fgitignore-enumeration.md\nreferences\u002Fphase2\u002Fenrich-cymbal.md\nreferences\u002Fphase2\u002Fenrich-graphify.md\nreferences\u002Fphase2\u002Fue-uht-generated-files.md\nreferences\u002Fphase3\u002Fphase3-design-rationale.md\nreferences\u002Funreal\u002Funreal-installed-indexing-profiles.md\nreferences\u002Funreal\u002Fue58-full-phase123-run.md\n```\n\n---\n\n## License\n\nMIT\n","SQL-ManyThing 是一个将任意源代码树转换为本地 SQLite 数据库的工具，支持在数秒内对多达 89,000 个文件进行全文搜索。其核心功能包括构建 FTS5 三元组索引、可选的符号\u002F图谱丰富化以及记录每次查询以使代理在每个会话中变得更智能。该项目使用 Python 编写，只需一个文件即可运行，无需服务器或网络连接。适用于需要快速访问和搜索大型代码库的各种场景，如 JS\u002FTS 库、Python 工具、Java 项目、单体仓库等。通过本地化的 FTS5 索引，它提供了比传统 grep 搜索更快且更高效的查询速度，同时保持了语言无关性和审计性。",2,"2026-06-11 04:01:41","CREATED_QUERY"]