개발자 경험
설치하고, 열고, 기억을 쓰세요.
TriviumDB는 임베디드라서, 로컬 개발은 서비스 클러스터가 아니라 패키지 하나와 데이터베이스 경로에서 시작합니다.
v0.9.4
- Python
pip install triviumdb - Node.js
npm install triviumdb - Rust
cargo add triviumdb
import triviumdb
with triviumdb.TriviumDB("agent-memory.tdb", dim=3) as db:
alice = db.insert([0.12, -0.45, 0.78], {
"type": "memory",
"text": "Alice works on embedded databases",
})
cafe = db.insert([0.08, -0.52, 0.81], {
"type": "place",
"name": "Blue Bottle",
})
db.link(alice, cafe, label="visited", weight=0.8)
hits = db.search([0.10, -0.48, 0.80], top_k=5, expand_depth=2, min_score=0.1)
for hit in hits:
print(hit.id, hit.score, hit.payload)