Background
Technically AWorld supports multiple databases including OceanBase, but currently lacks official deployment documentation. This guide will help users quickly set up OceanBase for AWorld.
Task For Reference
Create a deployment guide at docs/deployment/oceanbase_setup.md covering:
1. OceanBase Docker Setup
- Launch OceanBase CE using
oceanbase/oceanbase-ce:latest
- Include Docker run command, port mappings, and connection details
- Provide verification steps (e.g., using
mysql CLI)
2. Database Initialization
Create database and tables:
-- Create database
CREATE DATABASE aworld_db;
USE aworld_db;
-- Memory items table
CREATE TABLE IF NOT EXISTS aworld_memory_items (
id VARCHAR(255) PRIMARY KEY,
content TEXT NOT NULL,
created_at VARCHAR(255) NOT NULL,
updated_at VARCHAR(255) NOT NULL,
memory_meta TEXT NOT NULL,
tags TEXT NOT NULL,
memory_type VARCHAR(50) NOT NULL,
version INT NOT NULL DEFAULT 1,
deleted TINYINT(1) NOT NULL DEFAULT 0
);
-- Memory histories table
CREATE TABLE IF NOT EXISTS aworld_memory_histories (
memory_id VARCHAR(255) NOT NULL,
history_id VARCHAR(255) NOT NULL,
created_at VARCHAR(255) NOT NULL,
PRIMARY KEY (memory_id, history_id),
FOREIGN KEY (memory_id) REFERENCES aworld_memory_items (id),
FOREIGN KEY (history_id) REFERENCES aworld_memory_items (id)
);
-- Indexes for performance
CREATE INDEX idx_memory_items_type ON aworld_memory_items (memory_type);
CREATE INDEX idx_memory_items_created ON aworld_memory_items (created_at);
CREATE INDEX idx_memory_items_deleted ON aworld_memory_items (deleted);
3. Python Connection Test
Provide a simple script using PyMySQL to:
- Connect to OceanBase
- Insert a test record
- Verify the insertion
4. Documentation Integration
- Ensure the file is discoverable in the docs navigation
- Add reference in relevant sections if needed
Reference
Definition of Done
Happy Hacking! This task is associated with "OceanBase Developer Carnival" event.
Background
Technically AWorld supports multiple databases including OceanBase, but currently lacks official deployment documentation. This guide will help users quickly set up OceanBase for AWorld.
Task For Reference
Create a deployment guide at
docs/deployment/oceanbase_setup.mdcovering:1. OceanBase Docker Setup
oceanbase/oceanbase-ce:latestmysqlCLI)2. Database Initialization
Create database and tables:
3. Python Connection Test
Provide a simple script using
PyMySQLto:4. Documentation Integration
Reference
aworld/memory/db/sqlite.pyDefinition of Done
docs/deployment/oceanbase_setup.mdcreated with all sectionsHappy Hacking! This task is associated with "OceanBase Developer Carnival" event.