-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathquickstart.py
More file actions
35 lines (28 loc) · 1.24 KB
/
quickstart.py
File metadata and controls
35 lines (28 loc) · 1.24 KB
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
"""ZettelForge quickstart — runnable copy of the README's 30-second hello world.
Works on a fresh ``pip install zettelforge`` with NO Ollama, NO API keys, and
no other external services. Embeddings run in-process via fastembed
(downloaded on first call). Writes to ``~/.amem/`` by default; override with
``ZETTELFORGE_DATA_DIR`` if you don't want the demo to share storage with a
real workspace.
Run::
pip install zettelforge
python examples/quickstart.py
Expected output: three notes stored with auto-extracted entities, plus a
recall query that demonstrates threat-actor alias resolution
(Fancy Bear → APT28).
"""
from zettelforge import MemoryManager
mm = MemoryManager()
# Store threat intelligence — entities extracted automatically (regex; no LLM call)
note, status = mm.remember(
"APT28 uses Cobalt Strike and XAgent for lateral movement. "
"They exploit CVE-2024-3094 for initial access via T1021.",
domain="security_ops",
)
print(f"Stored: {note.id} ({status})")
print(f"Entities: {note.semantic.entities}")
# Recall with alias resolution (APT28 = Fancy Bear). Blends vector + graph
# retrieval; no LLM required.
results = mm.recall("What tools does Fancy Bear use?")
for r in results:
print(f"Found: {r.content.raw[:80]}...")