我构建了一个像人类记忆一样工作的数据库——无SQLite,无ORM,零外部依赖

📄 中文摘要

该项目开发了一种从零开始用Python编写的仅追加二进制数据库引擎,完全不依赖SQLite或ORM等外部库。每条记忆包含一个概念、15种情感之一以及可选的媒体。系统具备LLM认知层,能够进行感知(从原始文本中提取结构)、提问(在记忆中进行RAG)、反思(情感弧线)、梦境(自由联想)和内省(心理画像)。该数据库支持多种提供者,通过.env文件配置,兼容本地的LM Studio/Ollama。媒体存储方式与文件系统相适应,支持ext4/NFS/NTFS的硬链接、btrfs/APFS的重链接以及FAT32的原子复制。使用AATEL许可证,要求Python 3.12及以上版本。

📄 English Summary

I Built a Database That Works Like Human Memory — No SQLite, No ORM, Zero External Dependencies

This project presents an append-only binary database engine built from scratch in Python, with no reliance on SQLite, ORM, or any external dependencies. Each memory consists of a concept, one of 15 emotions, and optional media. The system features an LLM cognitive layer that enables perception (extracting structure from raw text), asking (RAG over memories), reflecting (emotional arcs), dreaming (free association), and introspection (psychological portraits). It is provider-agnostic, configurable via a .env file, and compatible with local LLM Studio/Ollama. Media storage is filesystem-aware, supporting hard links on ext4/NFS/NTFS, reflinks on btrfs/APFS, and atomic copies on FAT32. The project is licensed under AATEL and requires Python 3.12 or higher.

Powered by Cloudflare Workers + Payload CMS + Claude 3.5

数据源: OpenAI, Google AI, DeepMind, AWS ML Blog, HuggingFace 等