Expand description
Operations endpoints. Operations endpoints: maintenance, enrichment, documents, backups, database management, readiness.
Per database (mounted under /v1 and /v1/db/{db}):
POST /maintenance/decay,/maintenance/archive,/maintenance/consolidate,/maintenance/sweep: the rule based upkeep jobs, on demand.POST /enrich: the LLM enrichment pipeline (extraction, entity linking, communities, user model).POST /documents,DELETE /documents/{document_id}: load a long text as overlapping chunks, and forget it again.POST /backup,GET /backups(admin): snapshot the database into a single backup file and list those snapshots.
Global:
GET/POST /v1/databases,DELETE /v1/databases/{name}(admin).GET /v1/ready: readiness, separate from/v1/healthliveness.
There is deliberately no restore endpoint: replacing the files of a live,
open database is unsafe. Restore is offline: stop the server, then call
mentedb::storage::backup::BackupManager::restore_backup(file, dir) with
an empty target directory (the data directory root for the default
database, <data>/dbs/<name> for a named one) and start the server again.
Structs§
- Admin
Guard - Admits only admins: a token with the admin claim, or the configured admin
key in
x-api-key/Authorization: Bearer. Listed beforeDbin a handler so a refused request never opens or creates a database. - Document
Config - How documents are split into chunks.
- Maintenance
Guard - Admits a database maintenance call (drop, backup) on the database in the path: the admin key, an admin token, or a token with the maintenance scope naming that database.
- OpsConfig
- Settings for the operations endpoints.
- Readiness
Config - How
/v1/readyprobes its dependencies.
Functions§
- backup_
file_ name - Check a caller chosen backup name and give the file name to write: a
relative path of segments made of letters, digits,
-,_and., separated by/, with no empty,.or..segment and no leading/. The backup extension is appended when missing. The file lands under<backup dir>/<database>/. - chunk_
text - Split text into chunks of at most
chunk_charscharacters. Paragraphs (separated by blank lines) are kept whole when they fit; longer ones are split on sentence boundaries, and sentences longer than a chunk on word boundaries. Each chunk after the first starts with up tooverlap_charscharacters from the end of the previous one, cut at a word boundary. - global_
routes - Routes outside any one database (database management, readiness).
- ops_
config - The operations settings, read from the environment once.
- routes
- Routes on one database, mounted under
/v1and/v1/db/{db}.