- Set correct table ID: mx149yctebfwvys (ai_data_Memory) - Updated type column with SingleSelect options - Added all required columns for corrections, preferences, episodes, decisions, validation - Fixed column options for type, severity, status fields
3.8 KiB
3.8 KiB
NocoDB Setup for Self-Correcting Memory
Current Configuration
Agent Base ID: pedwxnsn51vxdq2
Memory Table ID: mwdr70ocb7iwnrg
Issue
The automation token (svc-automation role) cannot access the Agent base. This is a permissions issue.
Solution Options
Option 1: Grant Automation Role Access to Agent Base (Recommended)
In NocoDB web UI:
- Go to Agent base settings
- Add role
svc-automationwith Read/Write permissions - Or add user associated with automation role
Option 2: Create Tables with Admin Token
Use a token with broader permissions to create these tables in the Agent base:
Table: corrections
CREATE TABLE corrections (
id VARCHAR(50) PRIMARY KEY,
pattern VARCHAR(500) NOT NULL,
exclude_pattern VARCHAR(500),
severity VARCHAR(20) NOT NULL,
message VARCHAR(500) NOT NULL,
suggestion VARCHAR(500),
blocking BOOLEAN DEFAULT TRUE,
auto_detected BOOLEAN DEFAULT FALSE,
manual_entry BOOLEAN DEFAULT FALSE,
hit_count INTEGER DEFAULT 0,
last_triggered TIMESTAMP,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
context VARCHAR(200)
);
Table: memory_preferences
CREATE TABLE memory_preferences (
id VARCHAR(50) PRIMARY KEY,
category VARCHAR(50) NOT NULL,
key VARCHAR(100) NOT NULL,
value TEXT NOT NULL,
importance INTEGER DEFAULT 5,
confidence FLOAT DEFAULT 1.0,
tags TEXT, -- JSON array
access_count INTEGER DEFAULT 0,
last_accessed TIMESTAMP,
confirmed_count INTEGER DEFAULT 0,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Table: memory_episodes
CREATE TABLE memory_episodes (
id VARCHAR(50) PRIMARY KEY,
date DATE NOT NULL,
summary TEXT NOT NULL,
details TEXT,
project VARCHAR(100),
outcomes TEXT, -- JSON
corrections_triggered TEXT, -- JSON array
vector_embedding TEXT, -- Future use
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Table: memory_decisions
CREATE TABLE memory_decisions (
id VARCHAR(50) PRIMARY KEY,
date DATE NOT NULL,
project VARCHAR(100),
decision TEXT NOT NULL,
alternatives TEXT, -- JSON
rationale TEXT NOT NULL,
status VARCHAR(20) DEFAULT 'active',
reversed_by VARCHAR(50),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
Table: validation_runs
CREATE TABLE validation_runs (
id VARCHAR(50) PRIMARY KEY,
session_id VARCHAR(50),
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
input_length INTEGER,
output_length INTEGER,
violations_found INTEGER DEFAULT 0,
new_patterns_detected INTEGER DEFAULT 0,
corrections_auto_stored INTEGER DEFAULT 0,
processing_time_ms INTEGER,
blocked BOOLEAN DEFAULT FALSE,
workflow VARCHAR(50)
);
Option 3: Use Existing Memory Table
Update memory-service.js to use the existing mwdr70ocb7iwnrg table:
-
Add these columns to the existing table (via NocoDB UI):
pattern(LongText)severity(SingleSelect: error/warning/auto-correct)message(LongText)blocking(Checkbox)auto_detected(Checkbox)context(LongText)created_at(DateTime)
-
Update the service to use these columns
Next Steps
- Choose one of the options above
- Update
architecture/memory-service.jswith actual table IDs - Test connection:
node architecture/test-memory-connection.js
Current Fallback
Until NocoDB is connected, the system uses JSON files:
memory/corrections/_index.json- Correction patternsmemory/items/*.json- Preferencesmemory/*.md- Episodes
This works but lacks:
- Concurrent access
- Query capabilities
- Validation logging
- Statistics tracking