fix formatting in search_basics_core guide example
This commit is contained in:
parent
6ab127c85d
commit
7ae44a4565
1 changed files with 10 additions and 8 deletions
|
|
@ -1,24 +1,26 @@
|
||||||
import asyncio
|
import asyncio
|
||||||
import cognee
|
import cognee
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
async def main():
|
||||||
# Start clean (optional in your app)
|
# Start clean (optional in your app)
|
||||||
await cognee.prune.prune_data()
|
await cognee.prune.prune_data()
|
||||||
await cognee.prune.prune_system(metadata=True)
|
await cognee.prune.prune_system(metadata=True)
|
||||||
# Prepare knowledge base
|
# Prepare knowledge base
|
||||||
await cognee.add([
|
await cognee.add(
|
||||||
"Alice moved to Paris in 2010. She works as a software engineer.",
|
[
|
||||||
"Bob lives in New York. He is a data scientist.",
|
"Alice moved to Paris in 2010. She works as a software engineer.",
|
||||||
"Alice and Bob met at a conference in 2015."
|
"Bob lives in New York. He is a data scientist.",
|
||||||
])
|
"Alice and Bob met at a conference in 2015.",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
await cognee.cognify()
|
await cognee.cognify()
|
||||||
|
|
||||||
# Make sure you've already run cognee.cognify(...) so the graph has content
|
# Make sure you've already run cognee.cognify(...) so the graph has content
|
||||||
answers = await cognee.search(
|
answers = await cognee.search(query_text="What are the main themes in my data?")
|
||||||
query_text="What are the main themes in my data?"
|
|
||||||
)
|
|
||||||
for answer in answers:
|
for answer in answers:
|
||||||
print(answer)
|
print(answer)
|
||||||
|
|
||||||
|
|
||||||
asyncio.run(main())
|
asyncio.run(main())
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue