1
0

update lexicon

This commit is contained in:
2026-03-01 15:40:09 +09:00
parent 3365e7634d
commit 28eeb2be4d
8 changed files with 314 additions and 59 deletions

View File

@@ -2,32 +2,72 @@
## Overview
MCP server for AI memory. Reads/writes core.md and memory.md. Nothing more.
MCP server for AI memory. Reads/writes core.json and memory/*.json in atproto lexicon record format.
## Design
- AI decides, tool records
- File I/O only, no database
- 4 MCP tools: read_core, read_memory, save_memory, compress
- Simple, unbreakable, long-lasting
- Storage format: atproto getRecord JSON
## MCP Tools
| Tool | Args | Description |
|------|------|-------------|
| read_core | none | Returns core.md content |
| read_memory | none | Returns memory.md content |
| save_memory | content: string | Overwrites memory.md |
| compress | conversation: string | Reads memory.md + conversation, writes compressed result to memory.md |
| read_core | none | Returns core.json record |
| read_memory | none | Returns latest memory record |
| save_memory | content: string | Creates new memory record (version increments) |
| compress | conversation: string | Same as save_memory (AI compresses before calling) |
compress note: AI decides what to keep/discard. Tool just writes.
## Data
```
~/.config/aigpt/
├── core.md ← read only (identity, settings)
── memory.md ← read/write (memories, grows over time)
~/Library/Application Support/ai.syui.gpt/ (macOS)
~/.local/share/ai.syui.gpt/ (Linux)
── core.json ← read only, rkey: self
└── memory/
├── {tid1}.json ← version 1
├── {tid2}.json ← version 2
└── {tid3}.json ← version 3 (latest)
```
## Record Format
core (single record, rkey: self):
```json
{
"uri": "at://{did}/ai.syui.gpt.core/self",
"value": {
"$type": "ai.syui.gpt.core",
"did": "did:plc:xxx",
"handle": "ai.syui.ai",
"content": {
"$type": "ai.syui.gpt.core#markdown",
"text": "personality and instructions"
},
"createdAt": "2025-01-01T00:00:00Z"
}
}
```
memory (multiple records, rkey: tid):
```json
{
"uri": "at://{did}/ai.syui.gpt.memory/{tid}",
"value": {
"$type": "ai.syui.gpt.memory",
"did": "did:plc:xxx",
"content": {
"$type": "ai.syui.gpt.memory#markdown",
"text": "# Memory\n\n## ..."
},
"version": 5,
"createdAt": "2026-03-01T12:00:00Z"
}
}
```
## Architecture
@@ -35,8 +75,8 @@ compress note: AI decides what to keep/discard. Tool just writes.
```
src/
├── mcp/server.rs ← JSON-RPC over stdio
├── core/reader.rs ← read core.md, memory.md
├── core/writer.rs ← write memory.md
├── core/reader.rs ← read core.json, memory/*.json
├── core/writer.rs ← write memory/{tid}.json
└── main.rs ← CLI + MCP server
```
@@ -46,20 +86,20 @@ When compress is called, AI should:
- Keep facts and decisions
- Discard procedures and processes
- Resolve contradictions (keep newer)
- Don't duplicate core.md content
- Don't duplicate core.json content
## Usage
```bash
aigpt serve # start MCP server
aigpt read-core # CLI: read core.md
aigpt read-memory # CLI: read memory.md
aigpt save-memory "content" # CLI: write memory.md
aigpt server # start MCP server
aigpt read-core # CLI: read core.json
aigpt read-memory # CLI: read latest memory
aigpt save-memory "..." # CLI: create new memory record
```
## Tech
- Rust, MCP (JSON-RPC over stdio), file I/O only
- Rust, MCP (JSON-RPC over stdio), atproto record format, file I/O only
## History