Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

877 B
Raw Blame
-- Remembered agent approvals: "allow for the rest of this conversation" and
-- the grants an automation carries between runs.
CREATE TABLE IF NOT EXISTS agent_grants (
    id VARCHAR(36) PRIMARY KEY,
    tenant_id BIGINT NOT NULL,
    user_id VARCHAR(128) NOT NULL,
    scope VARCHAR(16) NOT NULL,
    scope_id VARCHAR(64) NOT NULL,
    grant_key VARCHAR(512) NOT NULL,
    label TEXT,
    binding_hash VARCHAR(64) NOT NULL DEFAULT '',
    risk VARCHAR(16) NOT NULL DEFAULT 'write',
    prompt_id VARCHAR(36),
    created_at DATETIME NOT NULL,
    updated_at DATETIME NOT NULL,
    last_used_at DATETIME,
    expires_at DATETIME,
    revoked_at DATETIME
);
CREATE UNIQUE INDEX IF NOT EXISTS idx_agent_grants_key
    ON agent_grants(tenant_id, user_id, scope, scope_id, grant_key);
CREATE INDEX IF NOT EXISTS idx_agent_grants_scope ON agent_grants(tenant_id, scope, scope_id);