created search_basics_core example and renamed search_basics to search_basics_additional

This commit is contained in:
Milenko Gavric 2026-01-16 12:54:17 +01:00
parent 8761eab0c0
commit be829dcc3f
2 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,24 @@
import asyncio
import cognee
async def main():
# Start clean (optional in your app)
await cognee.prune.prune_data()
await cognee.prune.prune_system(metadata=True)
# Prepare knowledge base
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 and Bob met at a conference in 2015."
])
await cognee.cognify()
# Make sure you've already run cognee.cognify(...) so the graph has content
answers = await cognee.search(
query_text="What are the main themes in my data?"
)
for answer in answers:
print(answer)
asyncio.run(main())