forked from topoteretes/cognee
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecall_core.py
More file actions
25 lines (20 loc) · 714 Bytes
/
Copy pathrecall_core.py
File metadata and controls
25 lines (20 loc) · 714 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
import asyncio
import cognee
async def main():
# Start clean (optional in your app)
await cognee.forget(everything=True)
# Prepare knowledge base
await cognee.remember(
[
"Alice moved to Paris in 2010. She works as a software engineer.",
"Bob lives in New York. He is a data scientist.",
"Alice and Bob met at a conference in 2015.",
],
self_improvement=False,
)
# Make sure you've already run cognee.remember(...) so the graph has content
answers = await cognee.recall(query_text="What are the main themes in my data?")
for answer in answers:
print(answer)
if __name__ == "__main__":
asyncio.run(main())