-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcortex.example.toml
More file actions
234 lines (202 loc) · 8.03 KB
/
cortex.example.toml
File metadata and controls
234 lines (202 loc) · 8.03 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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# Cortex Configuration
# Copy to cortex.toml and adjust for your setup.
# All values shown are defaults unless noted.
# ─── Server ───────────────────────────────────────────────
[server]
grpc_addr = "0.0.0.0:9090" # gRPC API (SDKs, agents)
http_addr = "0.0.0.0:9091" # HTTP API + graph visualiser
data_dir = "./data" # Where the redb database lives
# ─── Node & Edge Types ────────────────────────────────────
# Define your own kinds and relations. Lowercase + hyphens/underscores only.
[kinds]
allowed = [
"fact", "decision", "goal", "event", "pattern",
"observation", "preference", "agent",
]
[relations]
allowed = [
"relates-to", "supports", "contradicts", "caused-by",
"depends-on", "similar-to", "supersedes",
]
# ─── Auto-Linker ──────────────────────────────────────────
# Background process that discovers relationships automatically.
[auto_linker]
enabled = true
interval_seconds = 60 # How often to run
similarity_threshold = 0.75 # Min cosine similarity for auto-edges
max_edges_per_node = 20 # Cap outgoing similarity edges
decay_enabled = true # Set to false for legal/compliance (nothing fades)
decay_rate_per_day = 0.01 # Ignored when decay_enabled = false
entity_promote_every_n_cycles = 60 # How often to run entity promotion (cycles)
entity_promote_min_agents = 2 # Min agents referencing an entity before promotion
# Default structural rules (equivalent to legacy hardcoded rules).
# Remove or modify these for non-personal-assistant agents.
# When rules are defined, legacy hardcoded rules are automatically disabled.
[[auto_linker.rules]]
name = "same-agent-linking"
from_kind = "*"
to_kind = "*"
relation = "related_to"
weight = 0.6
condition = { type = "same_agent" }
[[auto_linker.rules]]
name = "temporal-proximity"
from_kind = "*"
to_kind = "*"
relation = "related_to"
weight = 0.5
condition = { type = "temporal_proximity", window_minutes = 30 }
[[auto_linker.rules]]
name = "shared-tags"
from_kind = "*"
to_kind = "*"
relation = "related_to"
weight = 0.7
condition = { type = "shared_tags", min_shared = 2 }
[[auto_linker.rules]]
name = "decision-leads-to-event"
from_kind = "decision"
to_kind = "event"
relation = "led_to"
weight = 0.8
condition = { type = "temporal_proximity", window_minutes = 60 }
[[auto_linker.rules]]
name = "observation-instance-of-pattern"
from_kind = "observation"
to_kind = "pattern"
relation = "instance_of"
weight = 0.7
condition = { type = "min_similarity", threshold = 0.75 }
[[auto_linker.rules]]
name = "fact-supersedes-fact"
from_kind = "fact"
to_kind = "fact"
relation = "supersedes"
weight = 0.9
condition = { type = "newer_than" }
# ─── Trust Scoring ───────────────────────────────────────
# Trust is computed from graph topology at query time (like PageRank for knowledge).
# These settings tune the five trust signals.
[trust]
corroboration_saturation = 3 # Max independent agents before corroboration maxes out
corroboration_min_weight = 0.6 # Minimum edge weight to count as corroboration
contradiction_weight = 0.3 # How much an unresolved contradiction reduces trust
access_saturation = 20 # Access count at which reinforcement maxes out
freshness_halflife = 90 # Days until freshness signal halves
# Relative importance of each trust signal. Must sum to 1.0.
[trust.weights]
corroboration = 0.30
contradiction = 0.25
source = 0.20
access = 0.15
freshness = 0.10
# ─── Embedding ────────────────────────────────────────────
[embedding]
# model = "all-MiniLM-L6-v2" # Local embedding model
# dimensions = 384
# ─── Briefing ─────────────────────────────────────────────
# Context briefings synthesised for agents on demand.
[briefing]
max_tokens = 2000
# Role-to-kind mapping. Each role determines how nodes of that kind are
# presented in the briefing. Kinds not listed here are auto-discovered.
# These are the defaults (personal assistant); override for your agent type.
[briefing.roles]
identity = ["agent"]
persistent = ["preference"]
trackable = ["goal"]
temporal = ["event"]
reviewable = ["pattern"]
superseding = ["fact", "decision"]
# Optional section title overrides (role name = custom title):
# [briefing.titles]
# persistent = "Standing constraints"
# temporal = "Recent activity"
# Example: coding agent roles
# [briefing.roles]
# identity = ["agent"]
# persistent = ["constraint", "architecture-decision"]
# trackable = ["task", "milestone"]
# temporal = ["commit", "deployment", "incident"]
# reviewable = ["pattern", "anti-pattern", "code-smell"]
# superseding = ["dependency", "api-version"]
# Example: research agent roles
# [briefing.roles]
# identity = ["agent"]
# persistent = ["hypothesis", "methodology"]
# trackable = ["research-question", "objective"]
# temporal = ["experiment", "observation"]
# reviewable = ["finding", "pattern"]
# superseding = ["claim", "measurement", "citation"]
[[briefing.sections]]
name = "identity"
mode = "filter"
max_items = 5
[[briefing.sections]]
name = "goals"
mode = "filter"
max_items = 10
[[briefing.sections]]
name = "patterns"
mode = "hybrid_search"
query = "recurring patterns and insights"
max_items = 5
[[briefing.sections]]
name = "active_context"
mode = "filter"
max_items = 10
sort = "recent"
# ─── Retention ────────────────────────────────────────────
# Automatic node expiry. Disabled by default.
[retention]
default_ttl_days = 0 # 0 = keep forever
grace_days = 7 # Days before hard-deleting soft-deleted nodes
# Per-kind TTL overrides (days). 0 = keep forever.
[retention.by_kind]
observation = 90
event = 90
decision = 0 # Decisions kept forever
pattern = 0
# Hard cap on total node count (optional)
# [retention.max_nodes]
# limit = 100000
# strategy = "oldest_lowest_importance"
# ─── Write Gate ──────────────────────────────────────────
# Quality checks applied before accepting writes.
# [write_gate]
# enabled = true
# conflict_threshold = 0.85
# duplicate_threshold = 0.92
# min_title_length = 10
# min_body_length = 20
# ─── Schema Validation ──────────────────────────────────
# Per-kind metadata constraints. Only validated kinds are checked.
# Kinds without schemas pass freely.
# [schemas.decision]
# required_fields = ["rationale"]
#
# [schemas.decision.fields.rationale]
# type = "string"
#
# [schemas.decision.fields.priority]
# type = "number"
# min = 1.0
# max = 5.0
#
# [schemas.decision.fields.status]
# type = "string"
# allowed_values = ["proposed", "accepted", "rejected"]
# ─── Security ─────────────────────────────────────────────
[security]
encryption = false
# Set CORTEX_ENCRYPTION_KEY env var (base64, 32 bytes).
# Generate with: cortex security generate-key
# ─── Ingest ───────────────────────────────────────────────
# NATS subscription for event-driven ingest (optional).
# [ingest.nats]
# url = "nats://localhost:4222"
# subjects = ["cortex.ingest.>"]
# ─── Stdin Ingest ─────────────────────────────────────────
# Pipe text directly: echo '{"kind":"fact","title":"..."}' | cortex serve --stdin
# [ingest.stdin]
# enabled = false