|
1 | | -# CodeCart |
2 | | -CodeCart: A portable, single-file cognitive memory cartridge for AI collaboration. End long-context pollution and save tokens with DSL-driven knowledge graphs. / 专为 AI 协作设计的便携单文件认知记忆卡带,终结上下文污染并极致节省 Token。 |
3 | | - |
4 | | -🇺🇸 English Version |
5 | | -CodeCart: The Single-File Cognitive Memory Cartridge |
6 | | -CodeCart is a portable, evolvable, and token-efficient knowledge graph stored in a single HTML file. It solves the "Long Context Inflation" and "Memory Pollution" issues in AI collaboration. |
7 | | - |
8 | | -🌟 Key Features |
9 | | -Dual-Drive I/O: High-efficiency DSL instructions instead of bulky JSON. |
10 | | - |
11 | | -4D Timeline: Temporal playback to revisit historical decision points. |
12 | | - |
13 | | -Lens System: Multi-perspective projection (Engineering, Patent, Security, etc.). |
14 | | - |
15 | | -Physical Portability: Single-file HTML, zero-dependency, U-disk ready. |
16 | | - |
17 | | -🛠 How to Use |
18 | | -Sync: Click "Copy for AI" to get a compressed Markdown context. |
19 | | - |
20 | | -Chat: Paste it to AI. AI replies with DSL commands (e.g., +CLAIM). |
21 | | - |
22 | | -Execute: Paste DSL back into the console and click "Execute". |
23 | | - |
24 | | -🇨🇳 中文说明 |
25 | | -CodeCart:单文件认知记忆卡带 |
26 | | -CodeCart 是一款便携、可演化且极致节省 Token 的认知图谱容器,封装于单个 HTML 文件中。它旨在解决 AI 协作中常见的“长上下文膨胀”与“记忆污染”痛点。 |
27 | | - |
28 | | -🌟 核心特性 |
29 | | -非对称双擎 I/O:使用极简 DSL 指令取代臃肿的 JSON,节省 90% 输出 Token。 |
30 | | - |
31 | | -4D 时间轴:状态时空切片,支持回溯任何历史决策现场。 |
32 | | - |
33 | | -多维透镜:根据任务切换视角(工程、专利、安全等),精准过滤噪声。 |
34 | | - |
35 | | -物理级便携:单文件零依赖,优盘即插即用,数据主权完全掌控。 |
36 | | - |
37 | | -🛠 使用步骤 |
38 | | -同步:点击“复制给 AI”获取压缩后的 Markdown 上下文。 |
39 | | - |
40 | | -对话:贴给 AI。AI 会输出 DSL 指令(如 +CLAIM)。 |
41 | | - |
42 | | -回写:将指令贴回 CodeCart 控制台并点击“执行”。 |
| 1 | +# CodeCart: The Cognitive Memory Cartridge for Human-AI Collaboration |
| 2 | +# CodeCart:人机协作认知记忆卡带 |
| 3 | + |
| 4 | +CodeCart is a portable, single-file cognitive memory cartridge designed to end "AI Memory Pollution." It collapses thousands of words into structured logic nodes using a robust DSL engine. |
| 5 | +CodeCart 是一款专为终结“AI 记忆污染”而生的单文件认知图谱容器。它通过强大的 DSL 引擎,将万字长谈坍缩为结构化的认知节点。 |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 🚀 快速上手指南 / Quick Start Guide |
| 10 | + |
| 11 | +### 第一步:开启认知白板 / Step 1: Initialize |
| 12 | +* **🆕 New Cartridge**: Click left-bottom button to clear all nodes. |
| 13 | +* **🆕 新建卡带**:点击左下角按钮,抹除所有节点,开启纯净画布。 |
| 14 | +* **⚓ Set Anchors**: In the console, enter your hard constraints. |
| 15 | +* **⚓ 设定锚点**:在控制台输入物理级红线。 |
| 16 | + - *Example:* `+ANCHOR("Budget limit: $1000")` / `+ANCHOR("预算限额 1000 元")` |
| 17 | + |
| 18 | +### 第二步:认知同步循环 / Step 2: The Cognitive Loop |
| 19 | +1. **📋 Copy for AI**: Click the button to get a compressed Markdown context. |
| 20 | +1. **📋 复制给 AI**:点击按钮,系统自动将当前逻辑状态压缩为 Markdown。 |
| 21 | +2. **💬 Chat with AI**: Paste the text to any AI (Gemini, Perplexity, Grok). |
| 22 | +2. **💬 对话 AI**:将文本贴给任意 AI,并要求其以 DSL 格式回答。 |
| 23 | +3. **⚡ Get & Exec**: Copy the DSL commands from AI, paste back to console, and click **Execute**. |
| 24 | +3. **⚡ 执行指令**:复制 AI 回复的 DSL 指令,贴回控制台点击“执行”,见证节点涌现。 |
| 25 | + |
| 26 | +--- |
| 27 | + |
| 28 | +## 🧠 高阶方案:安插文档与跨模型协作 / Advanced Workflows |
| 29 | + |
| 30 | +### 方案 A:认知坍缩(安插长文档/对话) / Scenario A: Cognitive Collapse |
| 31 | +If you have long PDF documents or 100+ chat logs, do not paste them directly to all AIs. |
| 32 | +如果您有长篇 PDF 或上百轮聊天记录,不要直接发给所有 AI。 |
| 33 | +1. **Feeding**: Upload document to AI A (e.g., Claude/Gemini). |
| 34 | +1. **喂料**:将文档发给 AI A。 |
| 35 | +2. **Shrinking**: Ask AI A to "Collapse the core logic into 3-5 CodeCart `+CLAIM` commands." |
| 36 | +2. **坍缩**:要求 AI A “将核心逻辑坍缩为 3-5 条 CodeCart `+CLAIM` 指令”。 |
| 37 | +3. **Injecting**: Paste these commands into CodeCart. |
| 38 | +3. **注入**:将指令贴入 CodeCart。这样,复杂的文档就变成了可参与讨论的结构化节点。 |
| 39 | + |
| 40 | +### 方案 B:跨模型逻辑接力 / Scenario B: Cross-Model Relay |
| 41 | +1. **AI A (Strategist)**: Ask Perplexity to propose a solution. Execute its `+CLAIM`. |
| 42 | +1. **AI A(战略家)**:让 Perplexity 提出方案,执行其 `+CLAIM`。 |
| 43 | +2. **AI B (Critic)**: Sync to Grok and ask: "Find logic holes in AI A's claim and optimize." |
| 44 | +2. **AI B(批判家)**:同步上下文给 Grok 并问:“找出 AI A 的逻辑漏洞并进行优化。” |
| 45 | +3. **Evolution**: AI B will output `>SUPERSEDE` to refine the knowledge graph. |
| 46 | +3. **演化**:AI B 会输出 `>SUPERSEDE` 指令,看图谱如何从旧逻辑中进化。 |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +## 🤖 针对 API 用户与 Agent 协议 / For API & Agent Users |
| 51 | + |
| 52 | +If you are an API developer, inject this into your **System Prompt**: |
| 53 | +如果您是 API 开发者,请将此段加入您的**系统提示词**: |
| 54 | + |
| 55 | +> "You are an expert cognitive architect. Refer to the CodeCart Context. Your output MUST conclude with DSL: |
| 56 | +> - `+CLAIM(ID, 'Statement')` for new logic. |
| 57 | +> - `>SUPERSEDE(old_id, new_id, 'Reason')` for updates. |
| 58 | +> - No explanations. Just the logic commit." |
| 59 | +
|
| 60 | +--- |
| 61 | + |
| 62 | +## 🛠 指令集参考 / DSL Syntax Reference |
| 63 | + |
| 64 | +| Command 指令 | Effect 作用 | Example 示例 | |
| 65 | +| :--- | :--- | :--- | |
| 66 | +| **+CLAIM** | Add new knowledge 新增节点 | `+CLAIM(ent_01, "方案 A 可行")` | |
| 67 | +| **>SUPERSEDE** | Refute/Update 替代旧逻辑 | `>SUPERSEDE(clm_01, clm_02, "发现漏洞")` | |
| 68 | +| **+ANCHOR** | Hard constraint 物理红线 | `+ANCHOR("所有代码须使用 Python 3.10")` | |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +## 🌍 全球化适用 / Global Design |
| 73 | +* **Partitioned UI**: Shades of gray distinguish sidebar, canvas, and console. |
| 74 | +* **分区 UI**:通过不同深浅的灰色区分边栏、画布与控制台,减少视觉疲劳。 |
| 75 | +* **Micro-Precision Timeline**: Backtrack through decisions second-by-second. |
| 76 | +* **高精度时间轴**:支持分秒级回溯,即使是连续快速操作也能精准还原。 |
| 77 | +* **Data Sovereignty**: 100% Offline. Your logic never leaves your local file. |
| 78 | +* **数据主权**:100% 离线,您的认知逻辑永远不会离开本地文件。 |
| 79 | + |
| 80 | +--- |
| 81 | +Created by **AgentLex**. Open Source under MIT License. |
0 commit comments