forked from topoteretes/cognee
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimprove_quickstart.py
More file actions
41 lines (30 loc) · 918 Bytes
/
Copy pathimprove_quickstart.py
File metadata and controls
41 lines (30 loc) · 918 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
import asyncio
import cognee
DATASET = "demo_dataset"
SESSION = "demo_session"
async def main():
await cognee.forget(everything=True)
await cognee.remember(
"Einstein developed general relativity.",
dataset_name=DATASET,
self_improvement=False,
)
await cognee.remember(
"Niels Bohr worked on atomic structure.",
dataset_name=DATASET,
session_id=SESSION,
self_improvement=False,
)
answer_before_improve = await cognee.recall(
"What did Bohr work on?",
datasets=[DATASET],
)
await cognee.improve(dataset=DATASET, session_ids=[SESSION])
answer_after_improve = await cognee.recall(
"What did Bohr work on?",
datasets=[DATASET],
)
print("Before improve:", answer_before_improve)
print("After improve:", answer_after_improve)
if __name__ == "__main__":
asyncio.run(main())