Universal memory module for LLMs
Project description
๐ง Greeum v2.0.1
๐ฐ๐ท ํ๊ตญ์ด | ๐บ๐ธ English | ๐จ๐ณ ไธญๆ | ๐ฏ๐ต ๆฅๆฌ่ช | ๐ช๐ธ Espaรฑol | ๐ฉ๐ช Deutsch | ๐ซ๐ท Franรงais
๋ค๊ตญ์ด ์ง์ LLM ๋ ๋ฆฝ์ ์ธ ๊ธฐ์ต ๊ด๋ฆฌ ์์คํ
๐ ๊ฐ์
Greeum (๋ฐ์: ๊ทธ๋ฆฌ์)์ ๋ชจ๋ LLM(๋๊ท๋ชจ ์ธ์ด ๋ชจ๋ธ)์ ์ฐ๊ฒฐํ ์ ์๋ ๋ฒ์ฉ ๊ธฐ์ต ๋ชจ๋๋ก์ ๋ค์๊ณผ ๊ฐ์ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค:
- ์ฌ์ฉ์์ ๋ฐํ, ๋ชฉํ, ๊ฐ์ , ์๋ ๋ฑ ์ฅ๊ธฐ์ ์ธ ๊ธฐ๋ก ์ถ์
- ํ์ฌ ๋งฅ๋ฝ๊ณผ ๊ด๋ จ๋ ๊ธฐ์ต ํ์
- ๋ค๊ตญ์ด ํ๊ฒฝ์์์ ์๊ฐ ํํ ์ธ์ ๋ฐ ์ฒ๋ฆฌ
- "๊ธฐ์ต์ ๊ฐ์ง AI"๋ก์์ ๊ธฐ๋ฅ
์ด๋ฆ "Greeum"์ ํ๊ตญ์ด "๊ทธ๋ฆฌ์"์์ ์๊ฐ์ ๋ฐ์์ผ๋ฉฐ, ๊ธฐ์ต ์์คํ ์ ๋ณธ์ง์ ์๋ฒฝํ๊ฒ ๋ด๊ณ ์์ต๋๋ค.
Greeum์ RAG(Retrieval-Augmented Generation) ์ํคํ ์ฒ์ ๊ธฐ๋ฐํ LLM ๋ ๋ฆฝ์ ๋ฉ๋ชจ๋ฆฌ ์์คํ ์ ๋๋ค. ์ ๋ณด ์ ์ฅ ๋ฐ ๊ฒ์(block_manager.py), ๊ด๋ จ ๊ธฐ์ต ๊ด๋ฆฌ(cache_manager.py), ํ๋กฌํํธ ์ฆ๊ฐ(prompt_wrapper.py) ๋ฑ RAG์ ํต์ฌ ๊ตฌ์ฑ ์์๋ฅผ ๊ตฌํํ์ฌ ๋ ์ ํํ๊ณ ๋งฅ๋ฝ์ ๋ง๋ ์๋ต์ ์์ฑํฉ๋๋ค.
๐ ์ฃผ์ ๊ธฐ๋ฅ
- ๋ธ๋ก์ฒด์ธ ์ ์ฌ ๊ตฌ์กฐ์ ์ฅ๊ธฐ ๊ธฐ์ต(LTM): ๋ถ๋ณ์ฑ์ ๊ฐ์ง ๋ธ๋ก ๋จ์ ๋ฉ๋ชจ๋ฆฌ ์ ์ฅ์
- TTL ๊ธฐ๋ฐ์ ๋จ๊ธฐ ๊ธฐ์ต(STM): ์ผ์์ ์ผ๋ก ์ค์ํ ์ ๋ณด๋ฅผ ํจ์จ์ ์ผ๋ก ๊ด๋ฆฌ
- ์๋ฏธ์ ์ฐ๊ด์ฑ: ํค์๋/ํ๊ทธ/๋ฒกํฐ ๊ธฐ๋ฐ ๊ธฐ์ต ํ์ ์์คํ
- ์จ์ดํฌ์ธํธ ์บ์: ํ์ฌ ๋งฅ๋ฝ๊ณผ ๊ด๋ จ๋ ๊ธฐ์ต์ ์๋์ผ๋ก ๊ฒ์
- ํ๋กฌํํธ ์กฐํฉ๊ธฐ: ๊ด๋ จ ๊ธฐ์ต์ ํฌํจํ LLM ํ๋กฌํํธ ์๋ ์์ฑ
- ์๊ฐ์ ์ถ๋ก ๊ธฐ: ๋ค๊ตญ์ด ํ๊ฒฝ์์ ๊ณ ๊ธ ์๊ฐ ํํ ์ธ์ ์ฒ๋ฆฌ
- ๋ค๊ตญ์ด ์ง์: ํ๊ตญ์ด, ์์ด ๋ฑ ์๋ ์ธ์ด ๊ฐ์ง ๋ฐ ์ฒ๋ฆฌ
- Model Control Protocol: v2.0.1๋ถํฐ ๋ด์ฅ๋ MCP ์๋ฒ๋ก Claude Code ๋ฑ ์ธ๋ถ ๋๊ตฌ์ ์ง์ ์ฐ๋ ์ง์
โ๏ธ ์ค์น ๋ฐฉ๋ฒ
๐ ๊ถ์ฅ: pipx ์ค์น (๊ฐํธํจ)
# pipx๊ฐ ์๋ค๋ฉด ๋จผ์ ์ค์น
brew install pipx # macOS
# ๋๋ pip install --user pipx
# Greeum v2.0 ๋ชจ๋ ๊ธฐ๋ฅ ํฌํจ ์ค์น
pipx install greeum[all]
# ์ค์น ํ์ธ
greeum --version
๐ Claude Code MCP ์ฐ๋
# MCP ์๋ฒ ์์
greeum mcp serve
# Claude Code์์ ์ฌ์ฉ ๊ฐ๋ฅํ 9๊ฐ ๋ฉ๋ชจ๋ฆฌ ๋๊ตฌ:
# - add_memory, search_memory, get_memory_stats
# - ltm_analyze, ltm_verify, ltm_export
# - stm_add, stm_promote, stm_cleanup
๐ง ๊ฐ๋ฐ์์ฉ: ์์ค์์ ์ค์น
git clone https://github.com/DryRainEnt/Greeum.git
cd Greeum
pip install -e .
๐งช ์ฌ์ฉ ๋ฐฉ๋ฒ
CLI ์ธํฐํ์ด์ค (v2.0.1 ํตํฉ ๋ช ๋ น์ด)
# ๊ธฐ๋ณธ ๋ฉ๋ชจ๋ฆฌ ๊ธฐ๋ฅ
greeum memory add "์๋ก์ด ํ๋ก์ ํธ๋ฅผ ์์ํ๊ณ ์ ๋ง ํฅ๋ฏธ๋ก์์"
greeum memory search "ํ๋ก์ ํธ"
greeum memory stats
# STM (๋จ๊ธฐ ๊ธฐ์ต) ์ ์ฉ
greeum stm add "์์ ๋ฉ๋ชจ" --ttl 1h --importance 0.7
greeum stm promote --threshold 0.8
greeum stm cleanup --smart
# LTM (์ฅ๊ธฐ ๊ธฐ์ต) ์ ์ฉ
greeum ltm analyze --trends --period 6m
greeum ltm verify --integrity
greeum ltm export --format blockchain
# MCP ์๋ฒ (Claude Code ์ฐ๋)
greeum mcp serve --transport stdio
# API ์๋ฒ ์์
greeum api serve --port 5000
REST API ์๋ฒ
# API ์๋ฒ ์คํ
python api/memory_api.py
์น ์ธํฐํ์ด์ค: http://localhost:5000
API ์๋ํฌ์ธํธ:
- GET
/api/v1/health- ์ํ ํ์ธ - GET
/api/v1/blocks- ๋ธ๋ก ๋ชฉ๋ก ์กฐํ - POST
/api/v1/blocks- ๋ธ๋ก ์ถ๊ฐ - GET
/api/v1/search?keywords=keyword1,keyword2- ํค์๋ ๊ฒ์ - GET
/api/v1/search/time?query=yesterday&language=en- ์๊ฐ ํํ ๊ฒ์ - GET, POST, DELETE
/api/v1/stm- ๋จ๊ธฐ ๊ธฐ์ต ๊ด๋ฆฌ - POST
/api/v1/prompt- ํ๋กฌํํธ ์์ฑ - GET
/api/v1/verify- ๋ธ๋ก์ฒด์ธ ๋ฌด๊ฒฐ์ฑ ๊ฒ์ฆ
Python ๋ผ์ด๋ธ๋ฌ๋ฆฌ
from greeum import BlockManager, STMManager, CacheManager, PromptWrapper
from greeum.text_utils import process_user_input
from greeum.temporal_reasoner import TemporalReasoner
# ์ฌ์ฉ์ ์
๋ ฅ ์ฒ๋ฆฌ
user_input = "์๋ก์ด ํ๋ก์ ํธ๋ฅผ ์์ํ๊ณ ์ ๋ง ํฅ๋ฏธ๋ก์์"
processed = process_user_input(user_input)
# ๋ธ๋ก ๋งค๋์ ๋ก ๊ธฐ์ต ์ ์ฅ
block_manager = BlockManager()
block = block_manager.add_block(
context=processed["context"],
keywords=processed["keywords"],
tags=processed["tags"],
embedding=processed["embedding"],
importance=processed["importance"]
)
# ์๊ฐ ๊ธฐ๋ฐ ๊ฒ์ (๋ค๊ตญ์ด)
temporal_reasoner = TemporalReasoner(db_manager=block_manager, default_language="auto")
time_query = "3์ผ ์ ์ ๋ฌด์์ ํ์ง?"
time_results = temporal_reasoner.search_by_time_reference(time_query)
# ํ๋กฌํํธ ์์ฑ
cache_manager = CacheManager(block_manager=block_manager)
prompt_wrapper = PromptWrapper(cache_manager=cache_manager)
user_question = "ํ๋ก์ ํธ๋ ์ด๋ป๊ฒ ์งํ๋๊ณ ์๋์?"
prompt = prompt_wrapper.compose_prompt(user_question)
# LLM์ ์ ๋ฌ
# llm_response = call_your_llm(prompt)
๐งฑ ์ํคํ ์ฒ
greeum/
โโโ greeum/ # ํต์ฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ
โ โโโ block_manager.py # ์ฅ๊ธฐ ๊ธฐ์ต ๊ด๋ฆฌ
โ โโโ stm_manager.py # ๋จ๊ธฐ ๊ธฐ์ต ๊ด๋ฆฌ
โ โโโ cache_manager.py # ์จ์ดํฌ์ธํธ ์บ์
โ โโโ prompt_wrapper.py # ํ๋กฌํํธ ์กฐํฉ
โ โโโ text_utils.py # ํ
์คํธ ์ฒ๋ฆฌ ์ ํธ๋ฆฌํฐ
โ โโโ temporal_reasoner.py # ์๊ฐ ๊ธฐ๋ฐ ์ถ๋ก
โ โโโ embedding_models.py # ์๋ฒ ๋ฉ ๋ชจ๋ธ ํตํฉ
โโโ api/ # REST API ์ธํฐํ์ด์ค
โโโ cli/ # ๋ช
๋ น์ค ๋๊ตฌ
โโโ data/ # ๋ฐ์ดํฐ ์ ์ฅ ๋๋ ํ ๋ฆฌ
โโโ tests/ # ํ
์คํธ ์ค์ํธ
๋ธ๋์น ๊ด๋ฆฌ ๊ท์น
- main: ์์ ์ ์ธ ๋ฆด๋ฆฌ์ฆ ๋ฒ์ ๋ธ๋์น
- dev: ํต์ฌ ํผ์ณ ๊ฐ๋ฐ ๋ธ๋์น (๊ฐ๋ฐ ํ ํ ์คํธ ๊ฒ์ฆ์ด ์๋ฃ๋๋ฉด main์ผ๋ก ๋จธ์ง)
- test-collect: ์ฑ๋ฅ ์งํ ๋ฐ A/B ํ ์คํธ ๋ฐ์ดํฐ ์์ง์ฉ ๋ธ๋์น
๐ ์ฑ๋ฅ ํ ์คํธ
Greeum์ ๋ค์๊ณผ ๊ฐ์ ์์ญ์์ ์ฑ๋ฅ ํ ์คํธ๋ฅผ ์งํํฉ๋๋ค:
T-GEN-001: ์๋ต์ ๊ตฌ์ฒด์ฑ ์ฆ๊ฐ์จ
- Greeum ๋ฉ๋ชจ๋ฆฌ ํ์ฉ ์ ์๋ต ํ์ง ํฅ์๋ ์ธก์
- ํ๊ท 18.6% ํ์ง ํฅ์ ํ์ธ
- ๊ตฌ์ฒด์ ์ ๋ณด ํฌํจ๋ 4.2๊ฐ ์ฆ๊ฐ
T-MEM-002: ๋ฉ๋ชจ๋ฆฌ ๊ฒ์ Latency
- ์จ์ดํฌ์ธํธ ์บ์๋ฅผ ํตํ ๊ฒ์ ์๋ ํฅ์ ์ธก์
- ํ๊ท 5.04๋ฐฐ ์๋ ํฅ์ ํ์ธ
- 1,000๊ฐ ์ด์ ๋ฉ๋ชจ๋ฆฌ ๋ธ๋ก์์ ์ต๋ 8.67๋ฐฐ ์๋ ๊ฐ์
T-API-001: API ํธ์ถ ํจ์จ์ฑ
- ๊ธฐ์ต ๊ธฐ๋ฐ ๋งฅ๋ฝ ์ ๊ณต์ผ๋ก ์ธํ ์ฌ์ง๋ฌธ ๊ฐ์์จ ์ธก์
- ์ฌ์ง๋ฌธ ํ์์ฑ 78.2% ๊ฐ์ ํ์ธ
- API ํธ์ถ ํ์ ๊ฐ์๋ก ๋น์ฉ ์ ๊ฐ ํจ๊ณผ
๐ ๋ฉ๋ชจ๋ฆฌ ๋ธ๋ก ๊ตฌ์กฐ
{
"block_index": 143,
"timestamp": "2025-05-08T01:02:33",
"context": "์๋ก์ด ํ๋ก์ ํธ๋ฅผ ์์ํ๊ณ ์ ๋ง ํฅ๋ฏธ๋ก์์",
"keywords": ["ํ๋ก์ ํธ", "์์", "ํฅ๋ฏธ๋ก์ด"],
"tags": ["๊ธ์ ์ ", "์์", "๋๊ธฐ๋ถ์ฌ"],
"embedding": [0.131, 0.847, ...],
"importance": 0.91,
"hash": "...",
"prev_hash": "..."
}
๐ค ์ง์ ์ธ์ด
Greeum์ ๋ค์ ์ธ์ด์ ์๊ฐ ํํ ์ธ์์ ์ง์ํฉ๋๋ค:
- ๐ฐ๐ท ํ๊ตญ์ด: ํ๊ตญ์ด ์๊ฐ ํํ ๊ธฐ๋ณธ ์ง์ (์ด์ , ์ง๋์ฃผ, 3์ผ ์ ๋ฑ)
- ๐บ๐ธ ์์ด: ์์ด ์๊ฐ ํ์ ์์ ์ง์ (yesterday, 3 days ago ๋ฑ)
- ๐ ์๋ ๊ฐ์ง: ์ธ์ด๋ฅผ ์๋์ผ๋ก ๊ฐ์งํ๊ณ ์ ์ ํ ์ฒ๋ฆฌ
๐ ์๊ฐ์ ์ถ๋ก ์์
# ํ๊ตญ์ด
result = evaluate_temporal_query("3์ผ ์ ์ ๋ญ ํ์ด?", language="ko")
# ๋ฐํ๊ฐ: {detected: True, language: "ko", best_ref: {term: "3์ผ ์ "}}
# ์์ด
result = evaluate_temporal_query("What did I do 3 days ago?", language="en")
# ๋ฐํ๊ฐ: {detected: True, language: "en", best_ref: {term: "3 days ago"}}
# ์๋ ๊ฐ์ง
result = evaluate_temporal_query("What happened yesterday?")
# ๋ฐํ๊ฐ: {detected: True, language: "en", best_ref: {term: "yesterday"}}
๐ง ํ๋ก์ ํธ ํ์ฅ ๊ณํ
- Model Control Protocol: MCP ์ง์์ ๋ํด์๋ GreeumMCP ๋ ํฌ์งํ ๋ฆฌ๋ฅผ ํ์ธํ์ธ์ - Greeum์ Cursor, Unity, Discord ๋ฑ์ ๋๊ตฌ์ ์ฐ๊ฒฐํ ์ ์๋ ๋ณ๋์ ํจํค์ง์ ๋๋ค
- ๋ค๊ตญ์ด ์ง์ ๊ฐํ: ์ผ๋ณธ์ด, ์ค๊ตญ์ด, ์คํ์ธ์ด ๋ฑ ์ถ๊ฐ ์ธ์ด ์ง์
- ์๋ฒ ๋ฉ ๊ฐ์ : ์ค์ ์๋ฒ ๋ฉ ๋ชจ๋ธ ํตํฉ (์: sentence-transformers)
- ํค์๋ ์ถ์ถ ํฅ์: ์ธ์ด๋ณ ํค์๋ ์ถ์ถ ๊ตฌํ
- ํด๋ผ์ฐ๋ ํตํฉ: ๋ฐ์ดํฐ๋ฒ ์ด์ค ๋ฐฑ์๋ ์ถ๊ฐ (SQLite, MongoDB ๋ฑ)
- ๋ถ์ฐ ์ฒ๋ฆฌ: ๋๊ท๋ชจ ๋ฉ๋ชจ๋ฆฌ ๊ด๋ฆฌ๋ฅผ ์ํ ๋ถ์ฐ ์ฒ๋ฆฌ ๊ตฌํ
๐ ์น์ฌ์ดํธ
์น์ฌ์ดํธ ๋ฐฉ๋ฌธ: greeum.app
๐ ๋ผ์ด์ ์ค
MIT License
๐ฅ ๊ธฐ์ฌ
๋ฒ๊ทธ ๋ณด๊ณ , ๊ธฐ๋ฅ ์ ์, ํ ๋ฆฌํ์คํธ ๋ฑ ๋ชจ๋ ๊ธฐ์ฌ๋ฅผ ํ์ํฉ๋๋ค!
๐ฑ ์ฐ๋ฝ์ฒ
์ด๋ฉ์ผ: playtart@play-t.art
๐ v0.6.0 ํ์ด๋ผ์ดํธ (Python 3.12 ์ง์)
| ํญ๋ชฉ | ์ค๋ช |
|---|---|
| Python ํธํ์ฑ | 3.10 / 3.11 / 3.12 ํ ์คํธ ํต๊ณผ(Tox & CI) |
| Working Memory | STMWorkingSet ๋ก ํ์ฑ ์ฌ๋กฏ ๊ด๋ฆฌ |
| ๊ฒ์ ์ฑ๋ฅ | FAISS ๋ฒกํฐ ์ธ๋ฑ์ค + BERT Cross-Encoder ์ฌ๋ญํฌ |
| ํ๋กฌํํธ | ํ ํฐ-Budget ๊ธฐ๋ฐ ๊ธฐ์ต ์ฝ์ , KeyBERT ๊ณ ๊ธ ํค์๋ |
| Evolution | ๋ธ๋ก ์์ฝ/๋ณํฉ, ์์ถฉ ๋ ธํธ API |
๋น ๋ฅธ ์ค์น (Python 3.12 + ๋ชจ๋ ํ์ฅ ์์กด์ฑ)
python3.12 -m venv .venv && source .venv/bin/activate
pip install --upgrade pip
pip install greeum[all] # faiss + transformers + keybert + openai ์ง์
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file greeum-2.0.2.tar.gz.
File metadata
- Download URL: greeum-2.0.2.tar.gz
- Upload date:
- Size: 98.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b308843d853880df3e2d68629cd905b9e24b4161f386376bce17eb951102c5d0
|
|
| MD5 |
c2fc2994a6664359f9adf971f50a64e1
|
|
| BLAKE2b-256 |
35b9d91d5d3bdf1fda4de3431a08918cb4408b7ca5b8c377a8dbf95ee5f7610a
|
File details
Details for the file greeum-2.0.2-py3-none-any.whl.
File metadata
- Download URL: greeum-2.0.2-py3-none-any.whl
- Upload date:
- Size: 101.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
733084745c7265411bc7e56f7237ec88af51b78c7a14fdf5ae36c6d6ad1ed052
|
|
| MD5 |
a2e110d46458ee378cbcff38760c93a5
|
|
| BLAKE2b-256 |
1ffebc69357a56096312e1ac43d80dea74d3cf908d9139fa0a7a9ba60356f8b6
|