vemora 0.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +759 -0
- package/dist/cli.d.ts +16 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +589 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/ask.d.ts +14 -0
- package/dist/commands/ask.d.ts.map +1 -0
- package/dist/commands/ask.js +137 -0
- package/dist/commands/ask.js.map +1 -0
- package/dist/commands/audit.d.ts +17 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +408 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/commands/brief.d.ts +14 -0
- package/dist/commands/brief.d.ts.map +1 -0
- package/dist/commands/brief.js +73 -0
- package/dist/commands/brief.js.map +1 -0
- package/dist/commands/chat.d.ts +7 -0
- package/dist/commands/chat.d.ts.map +1 -0
- package/dist/commands/chat.js +155 -0
- package/dist/commands/chat.js.map +1 -0
- package/dist/commands/context.d.ts +61 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +778 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/deps.d.ts +20 -0
- package/dist/commands/deps.d.ts.map +1 -0
- package/dist/commands/deps.js +138 -0
- package/dist/commands/deps.js.map +1 -0
- package/dist/commands/focus.d.ts +6 -0
- package/dist/commands/focus.d.ts.map +1 -0
- package/dist/commands/focus.js +302 -0
- package/dist/commands/focus.js.map +1 -0
- package/dist/commands/index.d.ts +10 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +366 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init-agent.d.ts +23 -0
- package/dist/commands/init-agent.d.ts.map +1 -0
- package/dist/commands/init-agent.js +447 -0
- package/dist/commands/init-agent.js.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +122 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/knowledge.d.ts +8 -0
- package/dist/commands/knowledge.d.ts.map +1 -0
- package/dist/commands/knowledge.js +98 -0
- package/dist/commands/knowledge.js.map +1 -0
- package/dist/commands/plan.d.ts +16 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +535 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/query.d.ts +39 -0
- package/dist/commands/query.d.ts.map +1 -0
- package/dist/commands/query.js +389 -0
- package/dist/commands/query.js.map +1 -0
- package/dist/commands/remember.d.ts +11 -0
- package/dist/commands/remember.d.ts.map +1 -0
- package/dist/commands/remember.js +174 -0
- package/dist/commands/remember.js.map +1 -0
- package/dist/commands/report.d.ts +10 -0
- package/dist/commands/report.d.ts.map +1 -0
- package/dist/commands/report.js +180 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +127 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/summarize.d.ts +14 -0
- package/dist/commands/summarize.d.ts.map +1 -0
- package/dist/commands/summarize.js +181 -0
- package/dist/commands/summarize.js.map +1 -0
- package/dist/commands/triage.d.ts +33 -0
- package/dist/commands/triage.d.ts.map +1 -0
- package/dist/commands/triage.js +419 -0
- package/dist/commands/triage.js.map +1 -0
- package/dist/commands/usages.d.ts +14 -0
- package/dist/commands/usages.d.ts.map +1 -0
- package/dist/commands/usages.js +236 -0
- package/dist/commands/usages.js.map +1 -0
- package/dist/core/config.d.ts +35 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +141 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/types.d.ts +274 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +4 -0
- package/dist/core/types.js.map +1 -0
- package/dist/embeddings/factory.d.ts +9 -0
- package/dist/embeddings/factory.d.ts.map +1 -0
- package/dist/embeddings/factory.js +26 -0
- package/dist/embeddings/factory.js.map +1 -0
- package/dist/embeddings/noop.d.ts +17 -0
- package/dist/embeddings/noop.d.ts.map +1 -0
- package/dist/embeddings/noop.js +22 -0
- package/dist/embeddings/noop.js.map +1 -0
- package/dist/embeddings/ollama.d.ts +11 -0
- package/dist/embeddings/ollama.d.ts.map +1 -0
- package/dist/embeddings/ollama.js +49 -0
- package/dist/embeddings/ollama.js.map +1 -0
- package/dist/embeddings/openai.d.ts +10 -0
- package/dist/embeddings/openai.d.ts.map +1 -0
- package/dist/embeddings/openai.js +67 -0
- package/dist/embeddings/openai.js.map +1 -0
- package/dist/embeddings/provider.d.ts +19 -0
- package/dist/embeddings/provider.d.ts.map +1 -0
- package/dist/embeddings/provider.js +3 -0
- package/dist/embeddings/provider.js.map +1 -0
- package/dist/indexer/callgraph.d.ts +16 -0
- package/dist/indexer/callgraph.d.ts.map +1 -0
- package/dist/indexer/callgraph.js +154 -0
- package/dist/indexer/callgraph.js.map +1 -0
- package/dist/indexer/chunkBySlidingWindow.d.ts +6 -0
- package/dist/indexer/chunkBySlidingWindow.d.ts.map +1 -0
- package/dist/indexer/chunkBySlidingWindow.js +30 -0
- package/dist/indexer/chunkBySlidingWindow.js.map +1 -0
- package/dist/indexer/chunkBySymbols.d.ts +7 -0
- package/dist/indexer/chunkBySymbols.d.ts.map +1 -0
- package/dist/indexer/chunkBySymbols.js +57 -0
- package/dist/indexer/chunkBySymbols.js.map +1 -0
- package/dist/indexer/chunker.d.ts +15 -0
- package/dist/indexer/chunker.d.ts.map +1 -0
- package/dist/indexer/chunker.js +26 -0
- package/dist/indexer/chunker.js.map +1 -0
- package/dist/indexer/classHeader.d.ts +7 -0
- package/dist/indexer/classHeader.d.ts.map +1 -0
- package/dist/indexer/classHeader.js +37 -0
- package/dist/indexer/classHeader.js.map +1 -0
- package/dist/indexer/deps.d.ts +66 -0
- package/dist/indexer/deps.d.ts.map +1 -0
- package/dist/indexer/deps.js +409 -0
- package/dist/indexer/deps.js.map +1 -0
- package/dist/indexer/hasher.d.ts +17 -0
- package/dist/indexer/hasher.d.ts.map +1 -0
- package/dist/indexer/hasher.js +38 -0
- package/dist/indexer/hasher.js.map +1 -0
- package/dist/indexer/parser.d.ts +18 -0
- package/dist/indexer/parser.d.ts.map +1 -0
- package/dist/indexer/parser.js +355 -0
- package/dist/indexer/parser.js.map +1 -0
- package/dist/indexer/scanner.d.ts +18 -0
- package/dist/indexer/scanner.d.ts.map +1 -0
- package/dist/indexer/scanner.js +37 -0
- package/dist/indexer/scanner.js.map +1 -0
- package/dist/indexer/strategy.d.ts +11 -0
- package/dist/indexer/strategy.d.ts.map +1 -0
- package/dist/indexer/strategy.js +15 -0
- package/dist/indexer/strategy.js.map +1 -0
- package/dist/indexer/tests.d.ts +15 -0
- package/dist/indexer/tests.d.ts.map +1 -0
- package/dist/indexer/tests.js +68 -0
- package/dist/indexer/tests.js.map +1 -0
- package/dist/indexer/todos.d.ts +9 -0
- package/dist/indexer/todos.d.ts.map +1 -0
- package/dist/indexer/todos.js +29 -0
- package/dist/indexer/todos.js.map +1 -0
- package/dist/llm/anthropic.d.ts +8 -0
- package/dist/llm/anthropic.d.ts.map +1 -0
- package/dist/llm/anthropic.js +76 -0
- package/dist/llm/anthropic.js.map +1 -0
- package/dist/llm/factory.d.ts +7 -0
- package/dist/llm/factory.d.ts.map +1 -0
- package/dist/llm/factory.js +39 -0
- package/dist/llm/factory.js.map +1 -0
- package/dist/llm/ollama.d.ts +8 -0
- package/dist/llm/ollama.d.ts.map +1 -0
- package/dist/llm/ollama.js +83 -0
- package/dist/llm/ollama.js.map +1 -0
- package/dist/llm/openai.d.ts +8 -0
- package/dist/llm/openai.d.ts.map +1 -0
- package/dist/llm/openai.js +68 -0
- package/dist/llm/openai.js.map +1 -0
- package/dist/llm/provider.d.ts +29 -0
- package/dist/llm/provider.d.ts.map +1 -0
- package/dist/llm/provider.js +3 -0
- package/dist/llm/provider.js.map +1 -0
- package/dist/search/bm25.d.ts +3 -0
- package/dist/search/bm25.d.ts.map +1 -0
- package/dist/search/bm25.js +102 -0
- package/dist/search/bm25.js.map +1 -0
- package/dist/search/formatter.d.ts +43 -0
- package/dist/search/formatter.d.ts.map +1 -0
- package/dist/search/formatter.js +208 -0
- package/dist/search/formatter.js.map +1 -0
- package/dist/search/hybrid.d.ts +10 -0
- package/dist/search/hybrid.d.ts.map +1 -0
- package/dist/search/hybrid.js +53 -0
- package/dist/search/hybrid.js.map +1 -0
- package/dist/search/merge.d.ts +33 -0
- package/dist/search/merge.d.ts.map +1 -0
- package/dist/search/merge.js +158 -0
- package/dist/search/merge.js.map +1 -0
- package/dist/search/mmr.d.ts +23 -0
- package/dist/search/mmr.d.ts.map +1 -0
- package/dist/search/mmr.js +95 -0
- package/dist/search/mmr.js.map +1 -0
- package/dist/search/rerank.d.ts +12 -0
- package/dist/search/rerank.d.ts.map +1 -0
- package/dist/search/rerank.js +113 -0
- package/dist/search/rerank.js.map +1 -0
- package/dist/search/signature.d.ts +42 -0
- package/dist/search/signature.d.ts.map +1 -0
- package/dist/search/signature.js +112 -0
- package/dist/search/signature.js.map +1 -0
- package/dist/search/vector.d.ts +41 -0
- package/dist/search/vector.d.ts.map +1 -0
- package/dist/search/vector.js +185 -0
- package/dist/search/vector.js.map +1 -0
- package/dist/storage/cache.d.ts +30 -0
- package/dist/storage/cache.d.ts.map +1 -0
- package/dist/storage/cache.js +160 -0
- package/dist/storage/cache.js.map +1 -0
- package/dist/storage/knowledge.d.ts +17 -0
- package/dist/storage/knowledge.d.ts.map +1 -0
- package/dist/storage/knowledge.js +58 -0
- package/dist/storage/knowledge.js.map +1 -0
- package/dist/storage/repository.d.ts +27 -0
- package/dist/storage/repository.d.ts.map +1 -0
- package/dist/storage/repository.js +95 -0
- package/dist/storage/repository.js.map +1 -0
- package/dist/storage/session.d.ts +38 -0
- package/dist/storage/session.d.ts.map +1 -0
- package/dist/storage/session.js +100 -0
- package/dist/storage/session.js.map +1 -0
- package/dist/storage/summaries.d.ts +19 -0
- package/dist/storage/summaries.d.ts.map +1 -0
- package/dist/storage/summaries.js +66 -0
- package/dist/storage/summaries.js.map +1 -0
- package/dist/storage/usage.d.ts +35 -0
- package/dist/storage/usage.d.ts.map +1 -0
- package/dist/storage/usage.js +55 -0
- package/dist/storage/usage.js.map +1 -0
- package/dist/utils/git.d.ts +15 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +38 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/tokenizer.d.ts +24 -0
- package/dist/utils/tokenizer.d.ts.map +1 -0
- package/dist/utils/tokenizer.js +52 -0
- package/dist/utils/tokenizer.js.map +1 -0
- package/package.json +71 -0
package/README.md
ADDED
|
@@ -0,0 +1,759 @@
|
|
|
1
|
+
# vemora
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/vemora)
|
|
4
|
+
[](https://www.npmjs.com/package/vemora?activeTab=versions)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
Repository-local memory system for LLM-assisted development.
|
|
8
|
+
|
|
9
|
+
Builds a structured, versioned index of your codebase — code chunks, symbols, dependency graph, and LLM-generated summaries — and enables semantic or keyword search over it. The result is a **RAG (Retrieval-Augmented Generation) layer** that lets you give an LLM only the code it actually needs, instead of entire files.
|
|
10
|
+
|
|
11
|
+
## Why
|
|
12
|
+
|
|
13
|
+
When working on a large codebase with Claude Code or similar LLM tools, you face two problems:
|
|
14
|
+
|
|
15
|
+
1. **Context cost** — dropping 50 files into the context wastes tokens on irrelevant code
|
|
16
|
+
2. **Discovery** — you don't always know *which* files are relevant to a given task
|
|
17
|
+
|
|
18
|
+
`vemora` solves both by pre-indexing the repo and making it queryable. It also provides higher-level commands that go beyond retrieval:
|
|
19
|
+
|
|
20
|
+
- **`vemora plan`** — a pro LLM (planner) decomposes a complex task into concrete steps; a smaller/free LLM (executor) carries out each step against targeted code context. Cuts costs by using expensive models only where they matter.
|
|
21
|
+
- **`vemora audit`** — systematic, checklist-driven analysis of your codebase for security vulnerabilities, performance issues, and bugs. Covers every file, produces structured findings with severity levels.
|
|
22
|
+
- **`vemora triage`** — zero-LLM static heuristic scan for bugs, security issues, and performance problems. Instant results with no API calls, useful as a first pass before a deeper audit.
|
|
23
|
+
- **`vemora focus`** — aggregates all structural context about a file or symbol in one shot: implementation, exports, dependency graph, callers, test files, and saved knowledge.
|
|
24
|
+
|
|
25
|
+
## Architecture in three layers
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
.vemora/ ← versioned in git, shared across the team
|
|
29
|
+
config.json
|
|
30
|
+
metadata.json
|
|
31
|
+
index/
|
|
32
|
+
files.json ← file hashes for incremental indexing
|
|
33
|
+
chunks.json ← code chunks (function/class/window slices)
|
|
34
|
+
symbols.json ← extracted symbol map
|
|
35
|
+
deps.json ← intra-project dependency graph
|
|
36
|
+
callgraph.json ← function-level call relationships
|
|
37
|
+
todos.json ← TODO/FIXME/HACK/XXX annotations extracted from source
|
|
38
|
+
summaries/
|
|
39
|
+
file-summaries.json ← LLM-generated 2-3 line description per file
|
|
40
|
+
project-summary.json ← LLM-generated ~500 word project overview
|
|
41
|
+
knowledge/
|
|
42
|
+
entries.json ← human/LLM-authored notes: decisions, gotchas, patterns
|
|
43
|
+
|
|
44
|
+
~/.vemora-cache/<projectId>/ ← local to each developer, NOT in git
|
|
45
|
+
embeddings.json ← metadata (model, dimensions, chunk mapping)
|
|
46
|
+
embeddings.bin ← binary buffer of vectors (Float32Array)
|
|
47
|
+
embeddings.hnsw.json ← serialized HNSW index for ultra-fast search
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The index, summaries, and knowledge entries are committed to git so teammates share them. Embeddings are generated locally by each developer from the shared index.
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Inside the vemora/ directory
|
|
56
|
+
pnpm install
|
|
57
|
+
pnpm build
|
|
58
|
+
|
|
59
|
+
# Link globally (optional)
|
|
60
|
+
pnpm link
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Or run directly with `node vemora/dist/cli.js` from the project root.
|
|
64
|
+
|
|
65
|
+
### Installing the alpha version from npm
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pnpm install vemora@alpha # local
|
|
69
|
+
pnpm install -g vemora@alpha # global
|
|
70
|
+
|
|
71
|
+
# or with npm:
|
|
72
|
+
npm install -g vemora@alpha
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## The Core Workflow
|
|
76
|
+
|
|
77
|
+
### 1. Setup (first time only)
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
vemora init # create .vemora/ and config.json
|
|
81
|
+
vemora index --no-embed # build index without embeddings (fast)
|
|
82
|
+
vemora index # or: build index + generate embeddings
|
|
83
|
+
vemora summarize # recommended: generate LLM descriptions per file
|
|
84
|
+
vemora init-agent # generate instruction files for AI agents
|
|
85
|
+
vemora init-agent --hooks # also write Claude Code auto-save hooks
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 1b. Start of each session
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
vemora brief --root . # compact primer: project overview + critical knowledge
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### 2. Query during development
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Search for relevant code
|
|
98
|
+
vemora query "how does IMAP reconnect work?"
|
|
99
|
+
|
|
100
|
+
# Full context block ready to paste into any LLM
|
|
101
|
+
vemora context --query "email retry logic" > context.md
|
|
102
|
+
|
|
103
|
+
# One-shot answer from the configured LLM
|
|
104
|
+
vemora ask "why does the sync queue stall?"
|
|
105
|
+
|
|
106
|
+
# All context about a file or symbol in one call (no LLM needed)
|
|
107
|
+
vemora focus src/core/email/services/email.service.ts
|
|
108
|
+
vemora focus EmailService.send
|
|
109
|
+
|
|
110
|
+
# Static scan for bugs/perf/security (no API key required)
|
|
111
|
+
vemora triage --type bugs,performance
|
|
112
|
+
|
|
113
|
+
# Save a finding for future sessions
|
|
114
|
+
vemora remember "EmailService.send queues if SMTP is offline — see OutboxRepository"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### 3. Complex tasks with the planner-executor pattern
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Pro LLM plans, small/free LLM executes each step
|
|
121
|
+
vemora plan "add rate limiting to the API layer" --confirm --synthesize
|
|
122
|
+
|
|
123
|
+
# Audit the codebase for issues
|
|
124
|
+
vemora audit --type security --root .
|
|
125
|
+
vemora audit --since HEAD~1 # only changed files (great for CI)
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### 4. Keep the index fresh
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
vemora index --watch # incremental re-index on file save
|
|
132
|
+
vemora index --no-embed # after code changes, update structure only
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Commands
|
|
136
|
+
|
|
137
|
+
### `vemora init`
|
|
138
|
+
|
|
139
|
+
Creates the `.vemora/` folder structure and adds `.vemora-cache/` to `.gitignore`.
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
Options:
|
|
143
|
+
--root <dir> project root (default: cwd)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### `vemora index`
|
|
147
|
+
|
|
148
|
+
Scans the repo, parses symbols, builds the dependency graph, extracts TODO/FIXME/HACK/XXX annotations, and generates embeddings. **Incremental** — only re-processes files whose SHA-256 hash has changed.
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
Options:
|
|
152
|
+
--root <dir> project root (default: cwd)
|
|
153
|
+
--force re-index all files, ignoring hashes
|
|
154
|
+
--no-embed skip embedding generation (index structure only)
|
|
155
|
+
-w, --watch watch for changes and re-index automatically
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### `vemora query "<question>"`
|
|
159
|
+
|
|
160
|
+
Searches the index using vector similarity (or keyword fallback). Results use a **three-tier display** that compresses output by relevance rank.
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
Options:
|
|
164
|
+
--root <dir> project root (default: cwd)
|
|
165
|
+
-k, --top-k <n> number of results (default: 10)
|
|
166
|
+
-c, --show-code show full code for all results (overrides tier system)
|
|
167
|
+
--keyword force keyword/BM25 search (no API call needed)
|
|
168
|
+
--format <fmt> output format: terminal (default) | json | markdown | terse
|
|
169
|
+
--rerank re-score results with a cross-encoder model
|
|
170
|
+
--hybrid use hybrid search (vector + BM25)
|
|
171
|
+
--alpha <n> hybrid weight for vector search (0-1, default 0.7)
|
|
172
|
+
--budget <n> max tokens to include across results
|
|
173
|
+
--mmr apply Maximal Marginal Relevance to diversify results
|
|
174
|
+
--merge merge adjacent chunks from the same file
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### Output formats
|
|
178
|
+
|
|
179
|
+
| Format | Use case |
|
|
180
|
+
|---|---|
|
|
181
|
+
| `terminal` | Default coloured output for interactive use |
|
|
182
|
+
| `json` | Machine-readable — for piping to scripts |
|
|
183
|
+
| `markdown` | Paste-ready Markdown with code blocks |
|
|
184
|
+
| `terse` | One line per result — recommended for small/local models |
|
|
185
|
+
|
|
186
|
+
#### Output tiers (terminal/markdown)
|
|
187
|
+
|
|
188
|
+
| Rank | Tier | Content shown |
|
|
189
|
+
|------|------|--------------|
|
|
190
|
+
| 1–3 | high | Full code block (capped at 30 lines) |
|
|
191
|
+
| 4–7 | med | Declaration signature only |
|
|
192
|
+
| 8+ | low | File path + symbol + score + AI summary |
|
|
193
|
+
|
|
194
|
+
### `vemora context`
|
|
195
|
+
|
|
196
|
+
Generates an **optimized LLM context block** combining project overview, a specific file, and relevant code chunks. Designed to be piped to a file or clipboard.
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
Options:
|
|
200
|
+
--root <dir> project root (default: cwd)
|
|
201
|
+
-q, --query <text> natural-language query to find relevant code
|
|
202
|
+
-f, --file <path> include a specific file in full with its dependency graph
|
|
203
|
+
-k, --top-k <n> number of search results to include (default: 5)
|
|
204
|
+
--keyword use keyword search instead of semantic search
|
|
205
|
+
--show-code show full code without line cap
|
|
206
|
+
--format <fmt> output format: markdown (default) | plain | terse
|
|
207
|
+
--rerank re-score results with a cross-encoder model
|
|
208
|
+
--hybrid use hybrid search (vector + BM25)
|
|
209
|
+
--budget <n> max tokens to include across retrieved chunks
|
|
210
|
+
--structured emit a structured block (Entry Point / Dependencies / Types / Patterns)
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
At least one of `--query` or `--file` is required.
|
|
214
|
+
|
|
215
|
+
When `--file` is used, the context block also includes:
|
|
216
|
+
- **Recent git commits** that touched the file (last 5, via `git log --follow`)
|
|
217
|
+
- **TODO/FIXME/HACK/XXX annotations** present in the file
|
|
218
|
+
- **Test files** linked to the file — convention-based and import-based discovery
|
|
219
|
+
- **Symbol callers** — for each symbol defined in the file, which other project symbols call it
|
|
220
|
+
|
|
221
|
+
### `vemora ask "<question>"`
|
|
222
|
+
|
|
223
|
+
One-shot Q&A: retrieves relevant context and calls the configured LLM to answer directly.
|
|
224
|
+
|
|
225
|
+
```
|
|
226
|
+
Options:
|
|
227
|
+
--root <dir> project root (default: cwd)
|
|
228
|
+
-k, --top-k <n> chunks to retrieve (default: 5)
|
|
229
|
+
--keyword use keyword search (no embeddings needed)
|
|
230
|
+
--hybrid use hybrid vector+BM25 search
|
|
231
|
+
--budget <n> max context tokens to send to LLM (default: 6000)
|
|
232
|
+
--show-context print the retrieved context before the answer
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
vemora ask "how does the IMAP reconnect logic work?" --root .
|
|
237
|
+
vemora ask "what does EmailService.send do?" --root . --keyword
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### `vemora plan "<task>"`
|
|
241
|
+
|
|
242
|
+
**Planner-executor pattern**: a capable LLM decomposes the task into a structured plan; a smaller/cheaper LLM executes each step against targeted code context.
|
|
243
|
+
|
|
244
|
+
The planner works from **file summaries and the symbol list** — not raw code — so its token cost stays low regardless of codebase size. The executor receives only the chunks relevant to its specific step (targeted by file/symbol, not just search).
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
Options:
|
|
248
|
+
--root <dir> project root (default: cwd)
|
|
249
|
+
-k, --top-k <n> chunks to retrieve per step when falling back to search (default: 5)
|
|
250
|
+
--keyword use keyword search (no embeddings required)
|
|
251
|
+
--budget <n> max context tokens per step (default: 4000)
|
|
252
|
+
--confirm show the plan and ask for confirmation before executing
|
|
253
|
+
--synthesize call the planner again after all steps to produce a single final answer
|
|
254
|
+
--show-context print retrieved context for each step
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
#### Step action types
|
|
258
|
+
|
|
259
|
+
| Action | Behaviour |
|
|
260
|
+
|---|---|
|
|
261
|
+
| `read` | Pull code into context — no LLM call, zero executor tokens |
|
|
262
|
+
| `analyze` | Executor answers a question in prose |
|
|
263
|
+
| `write` | Executor produces a unified diff ready to apply |
|
|
264
|
+
| `test` | Run a shell command; capture stdout/stderr as step result |
|
|
265
|
+
|
|
266
|
+
#### Key features
|
|
267
|
+
|
|
268
|
+
- **Parallel execution** — steps without dependencies run concurrently
|
|
269
|
+
- **Step dependencies** (`dependsOn`) — later steps receive prior results as context
|
|
270
|
+
- **Context deduplication** — the same file/symbol combination is retrieved only once per session
|
|
271
|
+
- **Adaptive re-planning** — if an executor step reports insufficient context (`INSUFFICIENT:`), the planner adds remediation steps automatically
|
|
272
|
+
- **Save synthesis** — after `--synthesize`, optionally save the result as a knowledge entry
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
# Plan, preview, and execute with final synthesis
|
|
276
|
+
vemora plan "add batch() method to OpenAIEmbeddingProvider" --confirm --synthesize
|
|
277
|
+
|
|
278
|
+
# Analysis only (no code changes)
|
|
279
|
+
vemora plan "explain how the hybrid search pipeline works" --keyword
|
|
280
|
+
|
|
281
|
+
# With explicit executor diff output
|
|
282
|
+
vemora plan "fix the N+1 query in UserRepository.findAll"
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
#### Configuration
|
|
286
|
+
|
|
287
|
+
```json
|
|
288
|
+
{
|
|
289
|
+
"planner": { "provider": "anthropic", "model": "claude-opus-4-6" },
|
|
290
|
+
"summarization": { "provider": "gemini", "model": "gemini-2.0-flash", "apiKey": "..." }
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
`summarization` acts as the executor. If `planner` is omitted, both roles use the same model.
|
|
295
|
+
|
|
296
|
+
### `vemora audit`
|
|
297
|
+
|
|
298
|
+
Systematic, checklist-driven code audit for **security vulnerabilities**, **performance issues**, and **bugs**. Covers every file in the codebase (or only changed files with `--since`).
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
Options:
|
|
302
|
+
--root <dir> project root (default: cwd)
|
|
303
|
+
--type <types> comma-separated: security, performance, bugs (default: all three)
|
|
304
|
+
--since <ref> only audit files changed since this git ref (e.g. HEAD~5, main)
|
|
305
|
+
--budget <n> max context tokens per step (default: 5000)
|
|
306
|
+
--keyword use keyword search (no embeddings required)
|
|
307
|
+
--output <fmt> terminal (default) | json | markdown
|
|
308
|
+
--save save critical/high findings as knowledge entries
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
#### Built-in checklists
|
|
312
|
+
|
|
313
|
+
| Type | Examples |
|
|
314
|
+
|---|---|
|
|
315
|
+
| `security` | SQL/command/path injection, hardcoded secrets, weak crypto, missing auth/authz, XSS, CSRF, prototype pollution |
|
|
316
|
+
| `performance` | N+1 queries, sync I/O in async context, unbounded data loading, memory accumulation, blocking event loop |
|
|
317
|
+
| `bugs` | Null dereference, unhandled promise rejections, race conditions, resource leaks, swallowed errors, off-by-one |
|
|
318
|
+
|
|
319
|
+
#### How it works
|
|
320
|
+
|
|
321
|
+
1. The **planner** receives the file list + summaries and generates a systematic audit plan, grouping 2-5 related files per step with specific checklist items.
|
|
322
|
+
2. Steps execute in **parallel waves of 3** — the executor returns structured JSON findings for each group.
|
|
323
|
+
3. Findings are **deduplicated, sorted by severity**, and displayed as a report.
|
|
324
|
+
4. `--save` persists critical/high findings to the knowledge store for future sessions.
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
# Full audit
|
|
328
|
+
vemora audit --root .
|
|
329
|
+
|
|
330
|
+
# Security only
|
|
331
|
+
vemora audit --type security --root .
|
|
332
|
+
|
|
333
|
+
# Audit only what changed in the last commit (ideal for CI/CD)
|
|
334
|
+
vemora audit --since HEAD~1 --root .
|
|
335
|
+
|
|
336
|
+
# Audit changes vs main branch, save findings
|
|
337
|
+
vemora audit --since main --type security,bugs --save --root .
|
|
338
|
+
|
|
339
|
+
# Export for a PR review
|
|
340
|
+
vemora audit --since main --output markdown --root . > audit-report.md
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
#### Example output
|
|
344
|
+
|
|
345
|
+
```
|
|
346
|
+
── Audit Report [security] ─────────────────────────────
|
|
347
|
+
12 file(s) analysed · 3 finding(s)
|
|
348
|
+
|
|
349
|
+
[CRITICAL] Injection src/api/users.ts:89
|
|
350
|
+
User input concatenated directly into SQL query without parameterization.
|
|
351
|
+
→ Use parameterized queries or a query builder.
|
|
352
|
+
|
|
353
|
+
[HIGH] Hardcoded Secret src/config.ts:12
|
|
354
|
+
API key hardcoded in source — will be exposed in version control.
|
|
355
|
+
→ Move to environment variables and rotate the key.
|
|
356
|
+
|
|
357
|
+
[MEDIUM] Missing Authorization src/api/admin.ts:34
|
|
358
|
+
Admin endpoint does not verify that the caller has the admin role.
|
|
359
|
+
→ Add role check before processing the request.
|
|
360
|
+
|
|
361
|
+
─────────────────────────────────────────────────────────
|
|
362
|
+
1 critical · 1 high · 1 medium
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
### `vemora remember "<text>"`
|
|
366
|
+
|
|
367
|
+
Saves a persistent knowledge entry to `.vemora/knowledge/entries.json`. The entry is committed to git and included automatically in future `context` and `ask` results when relevant.
|
|
368
|
+
|
|
369
|
+
When `--category` is omitted, the configured LLM classifies the entry automatically into one of the four categories. Falls back to `pattern` if no LLM is available.
|
|
370
|
+
|
|
371
|
+
```
|
|
372
|
+
Options:
|
|
373
|
+
--root <dir> project root (default: cwd)
|
|
374
|
+
--category <cat> decision | pattern | gotcha | glossary (auto-classified if omitted)
|
|
375
|
+
--files <paths> comma-separated related file paths
|
|
376
|
+
--symbols <names> comma-separated related symbol names
|
|
377
|
+
--confidence <level> high | medium | low (default: medium)
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
# Category auto-classified by the LLM
|
|
382
|
+
vemora remember "EmailService.send queues if SMTP offline — see OutboxRepository"
|
|
383
|
+
|
|
384
|
+
# Or specify explicitly
|
|
385
|
+
vemora remember "EmailService.send queues if SMTP offline — see OutboxRepository" \
|
|
386
|
+
--category gotcha \
|
|
387
|
+
--files src/core/email/services/email.service.ts \
|
|
388
|
+
--symbols EmailService.send
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### `vemora brief`
|
|
392
|
+
|
|
393
|
+
Prints a compact session primer — project overview and high-confidence knowledge entries — designed to be run at the start of each LLM session to re-establish context with minimal tokens.
|
|
394
|
+
|
|
395
|
+
```
|
|
396
|
+
Options:
|
|
397
|
+
--root <dir> project root (default: cwd)
|
|
398
|
+
--all include all knowledge entries, not only high-confidence ones
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
```bash
|
|
402
|
+
vemora brief --root . # overview + high-confidence entries only (~170 tokens)
|
|
403
|
+
vemora brief --root . --all # include all entries
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### `vemora knowledge`
|
|
407
|
+
|
|
408
|
+
Manages saved knowledge entries.
|
|
409
|
+
|
|
410
|
+
```bash
|
|
411
|
+
vemora knowledge list --root . # list all entries grouped by category
|
|
412
|
+
vemora knowledge forget <id> --root . # remove an entry by ID (prefix match)
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
### `vemora init-agent`
|
|
416
|
+
|
|
417
|
+
Generates AI agent instruction files from the existing index. Supports Claude Code, Gemini, GitHub Copilot, Cursor, and Windsurf.
|
|
418
|
+
|
|
419
|
+
```
|
|
420
|
+
Options:
|
|
421
|
+
--root <dir> project root (default: cwd)
|
|
422
|
+
--agent <name> target a single agent: claude, gemini, copilot, cursor, windsurf (default: all)
|
|
423
|
+
--force overwrite existing files that have no vemora markers
|
|
424
|
+
--hooks write Claude Code hooks to .claude/settings.json (claude target only)
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
Use `--hooks` to register a `PreCompact` hook that reminds Claude Code to persist key decisions before context is compressed:
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
vemora init-agent --agent claude --hooks --root .
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
| Agent | Output file |
|
|
434
|
+
|---|---|
|
|
435
|
+
| `claude` | `CLAUDE.md` |
|
|
436
|
+
| `gemini` | `GEMINI.md` |
|
|
437
|
+
| `copilot` | `.github/copilot-instructions.md` |
|
|
438
|
+
| `cursor` | `.cursor/rules/vemora.mdc` (with `alwaysApply: true`) |
|
|
439
|
+
| `windsurf` | `.windsurfrules` |
|
|
440
|
+
|
|
441
|
+
Re-running `init-agent` only updates the auto-generated block between `<!-- vemora:generated:start/end -->` markers. Custom content outside the markers is preserved.
|
|
442
|
+
|
|
443
|
+
### `vemora summarize`
|
|
444
|
+
|
|
445
|
+
Generates LLM-powered summaries for every indexed file and a high-level project overview. **Incremental** — only re-generates summaries for files whose content has changed.
|
|
446
|
+
|
|
447
|
+
Summaries are used by `vemora plan` and `vemora audit` as cheap planner context (instead of raw code chunks).
|
|
448
|
+
|
|
449
|
+
```
|
|
450
|
+
Options:
|
|
451
|
+
--root <dir> project root (default: cwd)
|
|
452
|
+
--force re-generate all summaries
|
|
453
|
+
--model <name> override LLM model (default: from config)
|
|
454
|
+
--files-only only generate per-file summaries
|
|
455
|
+
--project-only (re)generate project overview from existing file summaries
|
|
456
|
+
--show print the existing project overview without regenerating
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
```bash
|
|
460
|
+
vemora summarize --show --root . # print overview without regenerating
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
### `vemora status`
|
|
464
|
+
|
|
465
|
+
Prints index stats, embedding cache info, knowledge store summary, and a count of TODO/FIXME/HACK/XXX annotations by type.
|
|
466
|
+
|
|
467
|
+
### `vemora deps <file>`
|
|
468
|
+
|
|
469
|
+
Shows the full dependency context for a file: what it imports, what imports it.
|
|
470
|
+
|
|
471
|
+
```
|
|
472
|
+
Options:
|
|
473
|
+
--root <dir> project root (default: cwd)
|
|
474
|
+
-d, --depth <n> transitive depth for outgoing imports (default: 1)
|
|
475
|
+
-r, --reverse-depth <n> transitive depth for incoming importers (default: 1)
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
```bash
|
|
479
|
+
# All files that depend on SyncOrchestrator, up to 3 hops
|
|
480
|
+
vemora deps src/core/sync/SyncOrchestrator.ts --root . --reverse-depth 3
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
### `vemora usages <SymbolName>`
|
|
484
|
+
|
|
485
|
+
Finds all files that use a named symbol, following re-export chains.
|
|
486
|
+
|
|
487
|
+
```
|
|
488
|
+
Options:
|
|
489
|
+
--root <dir> project root (default: cwd)
|
|
490
|
+
-d, --depth <n> max re-export chain depth to follow (default: 10)
|
|
491
|
+
--callers-only show only files with call graph data
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### `vemora chat`
|
|
495
|
+
|
|
496
|
+
Interactive chat session with the codebase. Supports OpenAI, Anthropic, Gemini, and Ollama.
|
|
497
|
+
|
|
498
|
+
```bash
|
|
499
|
+
vemora chat --provider anthropic --model claude-opus-4-6
|
|
500
|
+
vemora chat --provider ollama --model qwen2.5-coder:14b
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### `vemora report`
|
|
504
|
+
|
|
505
|
+
Shows a usage statistics report: commands breakdown, token savings, and most frequent query terms.
|
|
506
|
+
|
|
507
|
+
```
|
|
508
|
+
Options:
|
|
509
|
+
--root <dir> project root (default: cwd)
|
|
510
|
+
--days <n> limit report to events from the last N days
|
|
511
|
+
-v, --verbose show per-query breakdown (last 20 queries)
|
|
512
|
+
--clear clear all recorded usage data
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
### `vemora triage`
|
|
516
|
+
|
|
517
|
+
Zero-LLM static heuristic scan for bugs, security issues, and performance problems. Works entirely from the existing index — no API key or network access required.
|
|
518
|
+
|
|
519
|
+
```
|
|
520
|
+
Options:
|
|
521
|
+
--root <dir> project root (default: cwd)
|
|
522
|
+
--type <types> comma-separated: bugs, security, performance (default: all)
|
|
523
|
+
-k, --top-k <n> max findings to return, ranked by score (default: 30)
|
|
524
|
+
--min-score <n> skip findings below this threshold (default: 1)
|
|
525
|
+
--file <path> restrict scan to files matching this substring
|
|
526
|
+
--output <fmt> terminal (default) | json | markdown
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
Each finding includes a severity (high/medium/low), a reason, and the exact code location.
|
|
530
|
+
|
|
531
|
+
```bash
|
|
532
|
+
# Full scan
|
|
533
|
+
vemora triage --root .
|
|
534
|
+
|
|
535
|
+
# Bugs only, top 10, export to Markdown
|
|
536
|
+
vemora triage --type bugs -k 10 --output markdown --root .
|
|
537
|
+
|
|
538
|
+
# Security scan limited to the API layer
|
|
539
|
+
vemora triage --type security --file src/api --root .
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
Heuristics cover: empty catch blocks, unguarded `JSON.parse`, sync I/O in loops, `any` casts, hardcoded secrets, dangerous `eval`/`exec`, prototype pollution, SQL/command injection patterns, and more.
|
|
543
|
+
|
|
544
|
+
### `vemora focus <target>`
|
|
545
|
+
|
|
546
|
+
Aggregates all structural context about a file or symbol in one call — replaces the need to run `context`, `deps`, `usages`, and `knowledge` separately.
|
|
547
|
+
|
|
548
|
+
```
|
|
549
|
+
Options:
|
|
550
|
+
--root <dir> project root (default: cwd)
|
|
551
|
+
--format <fmt> markdown (default) | plain
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
`<target>` can be a file path (full or partial) or a symbol name:
|
|
555
|
+
|
|
556
|
+
```bash
|
|
557
|
+
# File focus — exports, chunks, imports, importers, call graph, tests, knowledge
|
|
558
|
+
vemora focus src/core/email/services/email.service.ts --root .
|
|
559
|
+
vemora focus email.service --root . # partial path match
|
|
560
|
+
|
|
561
|
+
# Symbol focus — implementation, callers, callees, sibling members, tests
|
|
562
|
+
vemora focus EmailService.send --root .
|
|
563
|
+
|
|
564
|
+
# Pipe into a context block for any LLM
|
|
565
|
+
vemora focus src/search/hybrid.ts --root . --format plain > context.md
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
---
|
|
569
|
+
|
|
570
|
+
## Configuration
|
|
571
|
+
|
|
572
|
+
Edit `.vemora/config.json` after `init`:
|
|
573
|
+
|
|
574
|
+
```json
|
|
575
|
+
{
|
|
576
|
+
"projectId": "b88eb8199f78331e",
|
|
577
|
+
"projectName": "my-app",
|
|
578
|
+
"version": "1.0.0",
|
|
579
|
+
"include": ["**/*.ts", "**/*.tsx"],
|
|
580
|
+
"exclude": ["**/node_modules/**", "**/dist/**"],
|
|
581
|
+
"maxChunkLines": 80,
|
|
582
|
+
"maxChunkChars": 3000,
|
|
583
|
+
"embedding": {
|
|
584
|
+
"provider": "ollama",
|
|
585
|
+
"model": "nomic-embed-text",
|
|
586
|
+
"dimensions": 768
|
|
587
|
+
},
|
|
588
|
+
"summarization": {
|
|
589
|
+
"provider": "ollama",
|
|
590
|
+
"model": "gemma4:e4b",
|
|
591
|
+
"baseUrl": "http://localhost:11434"
|
|
592
|
+
},
|
|
593
|
+
"reranker": {
|
|
594
|
+
"provider": "ollama"
|
|
595
|
+
},
|
|
596
|
+
"display": {
|
|
597
|
+
"format": "terse"
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
### Planner-executor configuration
|
|
603
|
+
|
|
604
|
+
Add a `planner` block to use a more capable model for planning while a smaller model handles execution:
|
|
605
|
+
|
|
606
|
+
```json
|
|
607
|
+
{
|
|
608
|
+
"planner": {
|
|
609
|
+
"provider": "anthropic",
|
|
610
|
+
"model": "claude-opus-4-6"
|
|
611
|
+
},
|
|
612
|
+
"summarization": {
|
|
613
|
+
"provider": "gemini",
|
|
614
|
+
"model": "gemini-2.0-flash",
|
|
615
|
+
"apiKey": "your-google-ai-studio-key"
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
`planner` is used by `vemora plan` and `vemora audit`. `summarization` acts as the executor. If `planner` is omitted, both roles use `summarization`.
|
|
621
|
+
|
|
622
|
+
### `display.format`
|
|
623
|
+
|
|
624
|
+
Sets the default output format for `query`, `context`, and `ask`. Set to `"terse"` for small/local models with limited context windows.
|
|
625
|
+
|
|
626
|
+
### Embedding providers
|
|
627
|
+
|
|
628
|
+
| Provider | Config | Notes |
|
|
629
|
+
|---|---|---|
|
|
630
|
+
| `openai` | `OPENAI_API_KEY` env or `apiKey` in config | Best quality. Requires `npm install openai`. |
|
|
631
|
+
| `ollama` | `baseUrl`, `maxChars` (see below) | Local, no cost. |
|
|
632
|
+
| `none` | — | Keyword search only, no embeddings. |
|
|
633
|
+
|
|
634
|
+
#### Ollama embedding options
|
|
635
|
+
|
|
636
|
+
| Field | Default | Description |
|
|
637
|
+
|---|---|---|
|
|
638
|
+
| `model` | `"nomic-embed-text"` | Embedding model to pull and use |
|
|
639
|
+
| `dimensions` | `768` | Must match the model output dimensions |
|
|
640
|
+
| `baseUrl` | `"http://localhost:11434"` | Ollama server URL |
|
|
641
|
+
| `maxChars` | `3800` | Max characters per chunk before truncation. Prevents exceeding the model's context window. Increase for models with larger context (e.g. `mxbai-embed-large`: ~8000). |
|
|
642
|
+
|
|
643
|
+
```json
|
|
644
|
+
"embedding": {
|
|
645
|
+
"provider": "ollama",
|
|
646
|
+
"model": "nomic-embed-text",
|
|
647
|
+
"dimensions": 768,
|
|
648
|
+
"maxChars": 3800
|
|
649
|
+
}
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
### LLM providers
|
|
653
|
+
|
|
654
|
+
Used by `ask`, `chat`, `summarize`, `plan`, and `audit`.
|
|
655
|
+
|
|
656
|
+
| Provider | Config | Notes |
|
|
657
|
+
|---|---|---|
|
|
658
|
+
| `openai` | `OPENAI_API_KEY` env or `apiKey` in config | Also works with any OpenAI-compatible endpoint via `baseUrl`. |
|
|
659
|
+
| `anthropic` | `ANTHROPIC_API_KEY` env or `apiKey` in config | Requires `npm install @anthropic-ai/sdk`. |
|
|
660
|
+
| `gemini` | `GEMINI_API_KEY` or `GOOGLE_API_KEY` env or `apiKey` in config | Uses Google's OpenAI-compatible endpoint. Free tier available via Google AI Studio. |
|
|
661
|
+
| `ollama` | `baseUrl` (default: `http://localhost:11434`) | Local, no cost. |
|
|
662
|
+
|
|
663
|
+
#### OpenAI-compatible endpoints
|
|
664
|
+
|
|
665
|
+
The `openai` provider accepts a `baseUrl` field, enabling any compatible API:
|
|
666
|
+
|
|
667
|
+
```json
|
|
668
|
+
{ "provider": "openai", "model": "llama-3.3-70b-versatile", "baseUrl": "https://api.groq.com/openai/v1", "apiKey": "..." }
|
|
669
|
+
```
|
|
670
|
+
|
|
671
|
+
| Service | `baseUrl` | Free tier |
|
|
672
|
+
|---|---|---|
|
|
673
|
+
| Groq | `https://api.groq.com/openai/v1` | Yes (rate limited) |
|
|
674
|
+
| OpenRouter | `https://openrouter.ai/api/v1` | Some free models |
|
|
675
|
+
| Gemini (compat) | `https://generativelanguage.googleapis.com/v1beta/openai/` | Yes |
|
|
676
|
+
|
|
677
|
+
### Reranker
|
|
678
|
+
|
|
679
|
+
Controls how search results are re-scored when `--rerank` is passed to `query`, `context`, or `ask`, and always in `chat`.
|
|
680
|
+
|
|
681
|
+
| Provider | Config | Notes |
|
|
682
|
+
|---|---|---|
|
|
683
|
+
| `xenova` | _(no extra config)_ | Local cross-encoder (`ms-marco-MiniLM-L-6-v2`). Best quality. Requires `npm install @xenova/transformers`. |
|
|
684
|
+
| `ollama` | `model` (optional), `baseUrl` (optional) | Uses the configured LLM to rank results in a single call. No extra dependency. |
|
|
685
|
+
| `none` | — | Skip reranking entirely. |
|
|
686
|
+
|
|
687
|
+
```json
|
|
688
|
+
{
|
|
689
|
+
"reranker": { "provider": "ollama" }
|
|
690
|
+
}
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
When `provider` is `ollama` and `model` is omitted, the model from `summarization` is used.
|
|
694
|
+
|
|
695
|
+
### Recommended configurations
|
|
696
|
+
|
|
697
|
+
**Maximum quality (cloud)**
|
|
698
|
+
```json
|
|
699
|
+
{
|
|
700
|
+
"planner": { "provider": "anthropic", "model": "claude-opus-4-6" },
|
|
701
|
+
"summarization": { "provider": "openai", "model": "gpt-4o-mini" }
|
|
702
|
+
}
|
|
703
|
+
```
|
|
704
|
+
|
|
705
|
+
**Pro planner + free executor**
|
|
706
|
+
```json
|
|
707
|
+
{
|
|
708
|
+
"planner": { "provider": "anthropic", "model": "claude-opus-4-6" },
|
|
709
|
+
"summarization": { "provider": "gemini", "model": "gemini-2.0-flash", "apiKey": "..." }
|
|
710
|
+
}
|
|
711
|
+
```
|
|
712
|
+
|
|
713
|
+
**Fully local (no API keys)**
|
|
714
|
+
```json
|
|
715
|
+
{
|
|
716
|
+
"embedding": { "provider": "ollama", "model": "nomic-embed-text", "dimensions": 768 },
|
|
717
|
+
"summarization": { "provider": "ollama", "model": "gemma4:e4b" },
|
|
718
|
+
"reranker": { "provider": "ollama" },
|
|
719
|
+
"display": { "format": "terse" }
|
|
720
|
+
}
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
Other local models that work well: `qwen2.5-coder:14b`, `llama3.2`, `mistral`.
|
|
724
|
+
|
|
725
|
+
---
|
|
726
|
+
|
|
727
|
+
## What goes in git
|
|
728
|
+
|
|
729
|
+
```
|
|
730
|
+
✓ .vemora/config.json
|
|
731
|
+
✓ .vemora/metadata.json
|
|
732
|
+
✓ .vemora/index/files.json
|
|
733
|
+
✓ .vemora/index/chunks.json
|
|
734
|
+
✓ .vemora/index/symbols.json
|
|
735
|
+
✓ .vemora/index/deps.json
|
|
736
|
+
✓ .vemora/index/callgraph.json
|
|
737
|
+
✓ .vemora/summaries/file-summaries.json
|
|
738
|
+
✓ .vemora/summaries/project-summary.json
|
|
739
|
+
✓ .vemora/knowledge/entries.json ← shared knowledge store
|
|
740
|
+
|
|
741
|
+
✗ .vemora-cache/ ← local embedding vectors (gitignored)
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
## Incremental indexing
|
|
745
|
+
|
|
746
|
+
Chunk IDs are derived from `sha256(filePath + content)`. If a function's code doesn't change, its chunk ID is stable across branches — embeddings are reused without any API call.
|
|
747
|
+
|
|
748
|
+
## Tech stack
|
|
749
|
+
|
|
750
|
+
- **TypeScript + Node.js** (CommonJS, ES2022 target)
|
|
751
|
+
- **commander** — CLI framework
|
|
752
|
+
- **fast-glob** — repository scanning
|
|
753
|
+
- **tree-sitter** (optional) — AST-based symbol extraction for TS/JS
|
|
754
|
+
- **openai** SDK _(optional)_ — embedding generation, OpenAI and Gemini LLM provider; `npm install openai`
|
|
755
|
+
- **@anthropic-ai/sdk** _(optional)_ — Anthropic/Claude LLM provider; `npm install @anthropic-ai/sdk`
|
|
756
|
+
- **@xenova/transformers** _(optional)_ — local cross-encoder model for `--rerank` with `reranker.provider = "xenova"`; `npm install @xenova/transformers`. Not needed if using `reranker.provider = "ollama"` or `"none"`.
|
|
757
|
+
- **hnsw** — HNSW index for sub-millisecond vector search
|
|
758
|
+
- **chokidar** — file watching for `--watch` mode
|
|
759
|
+
- **chalk + ora** — terminal output
|