-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteach.py
More file actions
43 lines (33 loc) · 933 Bytes
/
Copy pathteach.py
File metadata and controls
43 lines (33 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env python3
"""
Teacher bridge for Azurro Memory Vault.
Usage:
.venv/bin/python teach.py "I noticed SuperLiga 73' with >18 shots is dangerous."
"""
from __future__ import annotations
import sys
from dotenv import load_dotenv
load_dotenv(".env")
from memory_embeddings import embed_text # noqa: E402
from memory_db import insert_memory_item # noqa: E402
def main(argv: list[str]) -> int:
if len(argv) < 2:
print("Usage: teach.py \"your lesson or observation here\"")
return 1
text = argv[1].strip()
if not text:
print("Empty lesson text.")
return 1
emb = embed_text(text)
insert_memory_item(
kind="note",
source="teacher",
text=text,
embedding=emb,
importance=0.9,
tags=["teacher"],
)
print("Saved lesson to Memory Vault.")
return 0
if __name__ == "__main__":
raise SystemExit(main(sys.argv))