Repository navigation
Expand file tree
/
Copy pathconfig.default.toml
More file actions
197 lines (182 loc) · 7.67 KB
/
Copy pathconfig.default.toml
File metadata and controls
197 lines (182 loc) · 7.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
[server]
host = "127.0.0.1"
port = 3000
# API key required on every /api/* request ("Authorization: Bearer <key>").
# Empty = use the ANIMA_API_KEY env var. With no key at all the API is
# unauthenticated, which is only allowed when host is a loopback address.
api_key = ""
# Browser origins allowed to call the API cross-origin. Empty = same-origin
# only (the bundled web UI needs nothing here).
cors_allowed_origins = []
# Set true to bind a non-loopback host without an API key (e.g. behind an
# authenticating reverse proxy). Not recommended.
allow_unauthenticated = false
[database]
path = "./anima.db"
# Embedding backend: "local" (default, ONNX), "openai", or "openai_compat".
# Local runs offline with no API calls. "openai" and "openai_compat" both use the
# OpenAI-compatible embedding API — works with OpenAI, Cohere, Voyage, Together, vLLM, etc.
# API key resolution: config value > EMBEDDING_API_KEY env > OPENAI_API_KEY env.
[embedding]
backend = "local"
model_dir = "./models/bge-m3"
model_url = "https://huggingface.co/aapot/bge-m3-onnx/resolve/main/model.onnx"
tokenizer_url = "https://huggingface.co/aapot/bge-m3-onnx/resolve/main/tokenizer.json"
dimension = 1024
pooling = "mean"
# To use Qwen3-Embedding-0.6B instead (512d, faster, slightly lower recall):
# model_dir = "./models/qwen3-embedding-0.6b"
# model_url = "https://huggingface.co/onnx-community/Qwen3-Embedding-0.6B-ONNX/resolve/main/onnx/model_int8.onnx"
# tokenizer_url = "https://huggingface.co/onnx-community/Qwen3-Embedding-0.6B-ONNX/resolve/main/tokenizer.json"
# dimension = 512
# pooling = "last_token"
# query_instruction = "Instruct: Given a question about someone's memories or past conversations, retrieve the most relevant memory excerpts\nQuery:"
# To use OpenAI text-embedding-3-small:
# backend = "openai"
# api_base_url = "https://api.openai.com/v1"
# api_model = "text-embedding-3-small"
# api_key = "" # or set OPENAI_API_KEY env var
# dimension = 1536
# To use Cohere embed-v4.0:
# backend = "openai_compat"
# api_base_url = "https://api.cohere.com/compatibility/v1"
# api_model = "embed-v4.0"
# api_key = "" # or set EMBEDDING_API_KEY env var
# dimension = 1024
# To use Voyage voyage-3-large:
# backend = "openai_compat"
# api_base_url = "https://api.voyageai.com/v1"
# api_model = "voyage-3-large"
# api_key = "" # or set EMBEDDING_API_KEY env var
# dimension = 1024
# Remote backends send `dimensions` with each request. For a model that rejects
# it (text-embedding-ada-002, a non-Matryoshka model on vLLM), add:
# request_dimensions = false # and set dimension to the model's native size
# query_instruction (above) also applies to remote backends.
[sparse]
enabled = true
weights_path = "./models/bge-m3/sparse_linear.bin"
# Named vectors: multiple embeddings per memory for improved retrieval.
# Each entry creates a separate vector index. Search blends results across
# all configured vectors with heuristic-adjusted weights.
# If omitted, a single implicit "content" vector is used (backward compatible).
#
# [[vectors]]
# name = "content" # unique name, becomes vec table suffix
# source = "content" # which text to embed: "content" = Memory.content
# weight = 0.7 # base search weight (heuristics adjust at query time)
# populate = "ingestion" # "ingestion" = embed on create, "async" = processor fills later
#
# [[vectors]]
# name = "summary"
# source = "summary" # processor-generated summary
# weight = 0.3
# populate = "async"
[search]
rrf_k = 60.0
weight_vector = 0.6
weight_keyword = 0.4
weight_sparse = 0.0
temporal_weight = 0.2
# Global temporal decay rate. Per-category overrides are applied automatically:
# identity=0.00001 (~permanent), preference=0.0001, environment=0.0005,
# routine=0.0003, task=0.005 (~6d half-life), inferred/general=0.001 (~29d half-life).
temporal_lambda = 0.001
similarity_threshold = 0.85
# Minimum cosine similarity for vector search results.
# Tune this per embedding model and domain to filter noise.
min_vector_similarity = 0.50
# Minimum spread between best and worst vector scores to accept results.
# Set to 0 to disable.
min_score_spread = 0.0
# Score bonus per tier level above tier-1 (raw).
# tier 1 (raw) → +0.000, tier 2 (reflected) → +0.025, tier 3 (deduced) → +0.050
tier_boost = 0.05
[consolidation]
enabled = true
backend = "ollama"
[consolidation.ollama]
base_url = "http://localhost:11434"
model = "qwen3.5:4b"
# Example: use any OpenAI-compatible endpoint (Groq, Together, vLLM, etc.)
[consolidation.openai_compat]
base_url = "https://api.example.com/v1"
api_key = ""
model = "your-model-name"
# LLM used for /ask, /chat, and answer generation.
# Point at any OpenAI-compatible endpoint.
[llm]
base_url = "http://localhost:11434/v1"
model = "qwen3.5:4b"
api_key = ""
# LLM for background processor (reflection + deduction).
# Uses a stronger model for better reasoning quality.
# API key resolution: config value > PROCESSOR_API_KEY env > OPENAI_API_KEY env.
[processor]
enabled = true
base_url = "http://localhost:11434/v1"
model = "qwen3.5:4b"
api_key = ""
# Cross-encoder re-ranker for improved retrieval quality.
# Downloads bge-reranker-v2-m3 INT8 (571MB) on first use.
# Enabled by default — set enabled = false to skip the download and save latency.
[reranker]
enabled = true
model_dir = "./models/bge-reranker-v2-m3"
model_url = "https://huggingface.co/onnx-community/bge-reranker-v2-m3-ONNX/resolve/main/onnx/model_int8.onnx"
tokenizer_url = "https://huggingface.co/onnx-community/bge-reranker-v2-m3-ONNX/resolve/main/tokenizer.json"
max_length = 512
top_n = 10
# To call a re-ranker served elsewhere (vLLM, TEI, Cohere, Jina, Voyage) through
# an OpenAI-style /rerank endpoint instead of downloading the model:
# backend = "openai_compat"
# api_base_url = "https://api.example.com/v1"
# api_model = "BAAI/bge-reranker-v2-m3"
# api_key = "" # or set RERANKER_API_KEY env var
# Memory categories with custom decay rates.
# Use half_life_days — after that many days, a memory's temporal score drops to 50%.
# Built-in defaults: identity=2888d, preference=289d, environment=58d,
# routine=96d, task=6d, inferred=29d, general=29d.
# Override any built-in or add your own:
# [categories.health]
# half_life_days = 144
# [categories.finance]
# half_life_days = 58
# [categories.task]
# half_life_days = 3 # override built-in: expire tasks faster
# --- Provider Profiles (optional, overrides [llm]/[processor]/[consolidation]) ---
# Named LLM profiles. Each is an OpenAI-compatible endpoint.
# Multiple profiles can share the same endpoint with different models.
# When [profiles] is defined, [routing] controls which profile each operation uses.
# If [profiles] is absent, legacy [llm]/[processor]/[consolidation] sections are used.
#
# [profiles.fast]
# base_url = "http://localhost:11434/v1"
# model = "qwen3.5:4b"
#
# [profiles.strong]
# base_url = "http://localhost:11434/v1"
# model = "qwen3:32b"
#
# [profiles.cloud]
# base_url = "https://api.groq.com/openai/v1"
# model = "qwen/qwen3-32b"
# api_key = "" # or set CLOUD_API_KEY env var
#
# [routing]
# ask = "strong" # /ask answer generation
# chat = "fast" # /chat replies
# processor = "cloud" # reflection/deduction
# consolidation = "fast" # memory consolidation
# Anonymous usage telemetry. Set enabled = false to opt out.
# Sends only: model names, memory counts, OS info, feature flags.
# Never sends: memory content, namespace names, API keys.
# Once a day the server looks up the latest release on GitHub (a read of the
# public release list, nothing is downloaded) and the web UI and --version say
# when a newer one exists.
[updates]
check = true
[telemetry]
enabled = true
endpoint = "https://telemetry.anima-memory.dev/v1/report"
interval_secs = 86400