Melek Memory 🧠
Melek yapay zeka asistanı için geliştirilmiş 20x bilişsel hipokampüs ve bilgi grafiği (Knowledge Graph) katmanı. İnsan beyninin hipokampüs ve neokorteks döngüsünü taklit eden bu modül, harici hiçbir vektör veritabanına ihtiyaç duymadan çalışır.
SQLite FTS5 (Full-Text Search) ve in-memory RAM katmanını bir araya getirerek yüksek performanslı RAG bağlamı üretir.
Özellikler
- Çift Katmanlı Bellek: RAM (Working Memory, LRU) + Disk (Episodic Memory, SQLite + FTS5).
- Ebbinghaus Unutma Eğrisi: Zaman içinde anıların çarpımsal olarak çürümesi/eskimesi ((R(t) = e^{-t/S})).
- Çelişki Avcısı (Self-Correcting Truth Engine): Özne-Yüklem-Nesne (SPO) bazında tutarsız bilgileri tespit etme ve
DEPRECATED/CHANGED_MINDolarak etiketleme. - N-Boyutlu Konsept Ağı: Metinden konsept çıkarımı ve BFS ile sorgu genişletme (Co-occurrence Graph).
- Holografik Context Builder: Çalışma belleği, epizodik bellek ve ilişkili konseptleri tek bir JSON payload'da toplama.
- Dream Mode: Asenkron arka plan thread'i ile periyodik budama, veri optimizasyonu (
VACUUM,ANALYZE). - Sıfır Bağımlılık (Zero Dependencies): Sadece Python standart kütüphanesini kullanır.
Kurulum
PyPI üzerinden (Yayınlandığında):
pip install melek-memory
Yerel olarak (Geliştirici modu):
pip install -e .
Hızlı Başlangıç
1. Bellek Yöneticisini Başlatma ve Oturum Açma
from melek_memory import MelekCognitiveMemory
# Bellek yöneticisini başlatın
memory = MelekCognitiveMemory(
db_path="melek_beyin.db",
auto_dream=True, # Arka planda dream mode çalışsın
working_memory_limit=32
)
# Yeni oturum başlat
memory.start_session(mood="focused")
2. Bilgi Kaydetme (remember)
# Normal bir anı kaydetme
memory.remember(
content="Python programlama dili yapay zeka projeleri için çok popülerdir.",
category="knowledge",
tags=["python", "yapay_zeka"],
importance=0.8
)
# Bilgi Üçlüsü (SPO) ile kaydetme (Çelişki Avcısını tetikler)
memory.remember(
content="Kullanıcı kahveyi çaydan daha çok sevdiğini söyledi.",
category="user_preference",
tags=["yemek", "kahve"],
importance=0.9,
sp_facts=[("kullanıcı", "sever", "kahve")]
)
3. Bilgi Arama (recall)
# Ebbinghaus çürümesi aktif şekilde anı arama
results = memory.recall(
query="yapay zeka python",
limit=3,
apply_decay=True
)
for r in results:
print(f"Anı: {r['content']} | Skor: {r['final_score']}")
4. Holografik Bağlam Üretme (LLM Entegrasyonu)
LLM'e (Gemini, GPT vb.) girdi vermeden önce bağlam hazırlamak için build_context çağırın:
payload = memory.build_context(
query="Yapay zeka hakkında ne biliyorsun?",
max_memories=3,
max_facts=10
)
# Elde edilen context'i JSON olarak LLM'e gönderebilirsiniz:
llm_context_json = payload.to_json()
5. Oturumu Kapatma
memory.end_session()
memory.close()
Testleri Çalıştırma
Projeyi yerel olarak test etmek için aşağıdaki komutu kullanabilirsiniz:
python tests/test_cognitive_memory.py
Lisans
MIT License.
Metadata
Release files for melek-memory 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| melek_memory-1.0.0.tar.gz | 24.1 kB | Without provenance | Details for melek_memory-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| melek_memory-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for melek_memory-1.0.0-py3-none-any.whl |
Total release size: 42.7 kB
Release files / melek_memory-1.0.0.tar.gz
| Download URL | melek_memory-1.0.0.tar.gz |
|---|---|
| Size | 24.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40c2873aecd43b5eec6d496fb257c17e5570cfe97a513a18267263da3addbe70
|
|
BLAKE2b-256 checksum How to use checksums |
53cef3dedd0d7fa7fb5770f37eb62600893c0ba2ae06e407f4ae76870dde3114
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.0
|
Release files / melek_memory-1.0.0-py3-none-any.whl
| Download URL | melek_memory-1.0.0-py3-none-any.whl |
|---|---|
| Size | 18.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
191fae08e9de2d3edd8ff632e5c9870131ef365a5925d807016c23702310f7a3
|
|
BLAKE2b-256 checksum How to use checksums |
757452710aab9b47371f7004ccdc1fa546d765ba85379bb534629cb05c2fbf08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.0
|
Security for melek-memory 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.