Skip to content

Commit 321aca5

Browse files
committed
docs: add comprehensive configuration reference and usage guides
- Add detailed configuration reference documentation covering all configuration layers, environment variables, and TOML file options including LLM settings, retry mechanisms, fallback strategies, retrieval configurations, and metrics tracking - Create Python usage guide with installation instructions, configuration methods (zero config, custom settings, config files), indexing examples from various sources (files, content, bytes), querying techniques, and document management operations - Develop Rust usage guide featuring engine builder patterns, multiple configuration approaches (presets, custom endpoints), indexing workflows with different input types and options, advanced querying with retrieve options and strategy preferences, streaming capabilities, and document graph functionality - Include comprehensive examples section for both Python and Rust with links to example repositories demonstrating various use cases
1 parent 831176b commit 321aca5

4 files changed

Lines changed: 768 additions & 0 deletions

File tree

docs/design/lovable-vectorless.png

-41.9 KB
Binary file not shown.

docs/guide/configuration.md

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
# Configuration Reference
2+
3+
Vectorless supports multiple configuration layers. Settings from higher-priority sources override lower ones.
4+
5+
## Priority (highest → lowest)
6+
7+
1. Builder/constructor parameters
8+
2. Environment variables
9+
3. Explicit config file (`config_path`)
10+
4. Auto-detected config file (`vectorless.toml`, `config.toml`, `.vectorless.toml`)
11+
5. Default values
12+
13+
## Environment Variables
14+
15+
| Variable | Description | Example |
16+
|----------|-------------|---------|
17+
| `OPENAI_API_KEY` | LLM API key | `sk-...` |
18+
| `VECTORLESS_MODEL` | Default model | `gpt-4o-mini` |
19+
| `VECTORLESS_ENDPOINT` | Custom API endpoint | `https://api.openai.com/v1` |
20+
| `VECTORLESS_WORKSPACE` | Workspace directory | `./data` |
21+
22+
## Configuration File
23+
24+
Create `vectorless.toml` for full control:
25+
26+
```bash
27+
cp vectorless.example.toml ./vectorless.toml
28+
```
29+
30+
### LLM Configuration
31+
32+
Three separate LLM clients for different tasks:
33+
34+
```toml
35+
[llm]
36+
api_key = "sk-your-api-key"
37+
38+
# Summarization — used during indexing
39+
[llm.summary]
40+
model = "gpt-4o-mini"
41+
endpoint = "https://api.openai.com/v1"
42+
max_tokens = 200
43+
temperature = 0.0
44+
45+
# Retrieval — used during query analysis
46+
[llm.retrieval]
47+
model = "gpt-4o"
48+
endpoint = "https://api.openai.com/v1"
49+
max_tokens = 100
50+
temperature = 0.0
51+
52+
# Pilot — used for tree navigation guidance
53+
[llm.pilot]
54+
model = "gpt-4o-mini"
55+
endpoint = "https://api.openai.com/v1"
56+
max_tokens = 300
57+
temperature = 0.0
58+
```
59+
60+
### Retry and Rate Limiting
61+
62+
```toml
63+
[llm.retry]
64+
max_attempts = 3
65+
initial_delay_ms = 500
66+
max_delay_ms = 30000
67+
multiplier = 2.0
68+
retry_on_rate_limit = true
69+
70+
[llm.throttle]
71+
max_concurrent_requests = 10
72+
requests_per_minute = 500
73+
enabled = true
74+
```
75+
76+
### Fallback
77+
78+
```toml
79+
[llm.fallback]
80+
enabled = true
81+
models = ["gpt-4o-mini", "glm-4-flash"]
82+
on_rate_limit = "retry_then_fallback"
83+
on_timeout = "retry_then_fallback"
84+
on_all_failed = "return_error"
85+
```
86+
87+
### Retrieval Configuration
88+
89+
```toml
90+
[retrieval]
91+
top_k = 3
92+
max_tokens = 1000
93+
94+
[retrieval.search]
95+
top_k = 5
96+
beam_width = 3
97+
max_iterations = 10
98+
min_score = 0.1
99+
100+
[retrieval.sufficiency]
101+
min_tokens = 500
102+
target_tokens = 2000
103+
max_tokens = 4000
104+
confidence_threshold = 0.7
105+
106+
[retrieval.cache]
107+
max_entries = 1000
108+
ttl_secs = 3600
109+
```
110+
111+
### Strategy Configuration
112+
113+
```toml
114+
# Hybrid (BM25 + LLM)
115+
[retrieval.strategy.hybrid]
116+
enabled = true
117+
pre_filter_ratio = 0.3
118+
bm25_weight = 0.4
119+
llm_weight = 0.6
120+
121+
# Cross-document search
122+
[retrieval.strategy.cross_document]
123+
enabled = true
124+
max_documents = 10
125+
max_results_per_doc = 3
126+
merge_strategy = "TopK"
127+
parallel_search = true
128+
129+
# Page range (PDF)
130+
[retrieval.strategy.page_range]
131+
enabled = true
132+
include_boundary_nodes = true
133+
expand_context_pages = 0
134+
```
135+
136+
### Pilot Configuration
137+
138+
```toml
139+
[pilot]
140+
mode = "Balanced" # "Conservative", "Balanced", "Aggressive"
141+
guide_at_start = true
142+
guide_at_backtrack = true
143+
144+
[pilot.budget]
145+
max_tokens_per_query = 2000
146+
max_tokens_per_call = 500
147+
max_calls_per_query = 5
148+
149+
[pilot.intervention]
150+
fork_threshold = 3
151+
score_gap_threshold = 0.15
152+
low_score_threshold = 0.3
153+
```
154+
155+
### Multi-turn Retrieval
156+
157+
```toml
158+
[retrieval.multiturn]
159+
enabled = true
160+
max_sub_queries = 3
161+
decomposition_model = "gpt-4o-mini"
162+
aggregation_strategy = "merge"
163+
```
164+
165+
### Reference Following
166+
167+
```toml
168+
[retrieval.reference]
169+
enabled = true
170+
max_depth = 3
171+
max_references = 10
172+
follow_pages = true
173+
follow_tables_figures = true
174+
min_confidence = 0.5
175+
```
176+
177+
### Storage Configuration
178+
179+
```toml
180+
[storage]
181+
workspace_dir = "./workspace"
182+
cache_size = 100
183+
atomic_writes = true
184+
file_lock = true
185+
checksum_enabled = true
186+
187+
[storage.compression]
188+
enabled = false
189+
algorithm = "gzip"
190+
level = 6
191+
```
192+
193+
### Metrics
194+
195+
```toml
196+
[metrics]
197+
enabled = true
198+
storage_path = "./workspace/metrics"
199+
retention_days = 30
200+
201+
[metrics.llm]
202+
track_tokens = true
203+
track_latency = true
204+
track_cost = true
205+
cost_per_1k_input_tokens = 0.00015
206+
cost_per_1k_output_tokens = 0.0006
207+
208+
[metrics.pilot]
209+
track_decisions = true
210+
track_accuracy = true
211+
track_feedback = true
212+
213+
[metrics.retrieval]
214+
track_paths = true
215+
track_scores = true
216+
track_iterations = true
217+
track_cache = true
218+
```

0 commit comments

Comments
 (0)