Profiles
Profiles are named configuration bundles that tune every aspect of db0 for a specific workload. A chatbot needs fast decay and high recency. A coding assistant needs slow decay and high precision. Profiles let you configure this without touching individual parameters.
Built-in profiles
| Profile | Use case | Scoring weights | Decay | Extraction |
|---|---|---|---|---|
PROFILE_CONVERSATIONAL |
Chat agents | 0.5 sim / 0.35 rec / 0.15 pop | 7 days | rules |
PROFILE_AGENT_CONTEXT |
Agent harnesses | 0.65 / 0.2 / 0.15 | 14 days | rules |
PROFILE_KNOWLEDGE_BASE |
Document retrieval | 0.8 / 0.1 / 0.1 | 30 days | rules |
PROFILE_CODING_ASSISTANT |
IDE and code tools | 0.85 / 0.1 / 0.05 | 30 days | rules |
PROFILE_CURATED_MEMORY |
Human-authored files | 0.9 / 0.05 / 0.05 | 90 days | manual |
PROFILE_HIGH_RECALL |
Benchmarks, research | 0.6 / 0.25 / 0.15 | 14 days | rules |
PROFILE_MINIMAL |
Testing | similarity only | none | rules |
Using a profile
import { db0, PROFILE_AGENT_CONTEXT } from "@db0-ai/core"
const harness = db0.harness({
agentId: "my-agent",
sessionId: "session-1",
backend,
profile: PROFILE_AGENT_CONTEXT,
})
Profile structure
Each profile configures five sections:
Ingest
Controls how raw content is processed into memories.
ingest: {
mode: "chunk", // "session" | "chunk" | "turn-context"
chunkSize: 1600, // max characters per chunk
chunkOverlap: 320, // overlap between chunks
enrich: true, // augment chunks with surrounding context
enrichMode: "augment", // "augment" | "rewrite"
enrichWindowSize: 1, // context window for enrichment
latentBridging: false, // create latent semantic bridges
}
Retrieval
Controls how memories are searched and scored.
retrieval: {
topK: 8, // max results
minScore: 0.4, // minimum score threshold
scoring: "hybrid", // "similarity" | "hybrid" | "rrf"
hybridWeights: {
similarity: 0.65,
recency: 0.2,
popularity: 0.15,
},
decayHalfLifeDays: 14, // recency decay half-life
queryExpansion: false, // expand query with related terms
graphExpand: { maxExpand: 3 }, // traverse relationship edges
}
Extraction
Controls how facts are extracted from conversations.
extraction: {
strategy: "rules", // "rules" | "manual" | "llm"
batchInterval: 5, // buffer N turns before extracting
maxBufferSize: 10, // max buffer before force-extract
}
Context
Controls how memories are packed into the token window.
context: {
budgetRatio: 0.6, // fraction of token budget to use
includeEdges: true, // include relationship context
maxPackItems: 20, // max memories per pack
}
Reconciliation
Controls background maintenance.
reconciliation: {
promotionThreshold: 5, // access count to promote
batchSize: 50, // memories per reconcile batch
autoReconcile: true, // auto-run reconciliation
reconcileInterval: 25, // run every N turns
}
Custom profiles
You can create a custom profile by spreading a built-in one and overriding specific fields:
const myProfile = {
...PROFILE_AGENT_CONTEXT,
retrieval: {
...PROFILE_AGENT_CONTEXT.retrieval,
topK: 15,
decayHalfLifeDays: 7,
},
}