Cogneeは、AIエージェントに信頼性の高い記憶機能を提供することを目的とした、オープンソースのAI記憶エンジンフレームワークです。このプロジェクトの中核となる理念は、わずか5行のコードでAIアプリケーションやエージェントのための動的な記憶システムを構築できることです。
Cogneeは、独自のECL(Extract, Cognify, Load)パイプラインアーキテクチャを採用しています。
pip install cognee
import os
os.environ["LLM_API_KEY"] = "YOUR OPENAI_API_KEY"
import cognee
import asyncio
async def main():
# cogneeにテキストを追加
await cognee.add("Natural language processing (NLP) is an interdisciplinary subfield of computer science and information retrieval.")
# 知識グラフを生成
await cognee.cognify()
# 知識グラフを検索
results = await cognee.search("Tell me about NLP")
# 結果を表示
for result in results:
print(result)
if __name__ == '__main__':
asyncio.run(main())
Natural Language Processing (NLP) is a cross-disciplinary and interdisciplinary field that involves computer science and information retrieval. It focuses on the interaction between computers and human language, enabling machines to understand and process natural language.
.env
ファイルを作成して設定します。
LLM_API_KEY=your_openai_api_key
# その他の設定オプション...
Cogneeは、AI記憶管理の新しい方向性を示しており、シンプルで使いやすいAPIと強力な技術アーキテクチャを通じて、インテリジェントな記憶システムを構築するための完全なソリューションを開発者に提供します。インテリジェントな対話システム、知識管理プラットフォーム、または複雑なAIエージェントの構築に使用する場合でも、Cogneeは信頼性の高い記憶インフラストラクチャのサポートを提供できます。