-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_memory.py
More file actions
30 lines (25 loc) · 857 Bytes
/
check_memory.py
File metadata and controls
30 lines (25 loc) · 857 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
from dotenv import load_dotenv
from pymilvus import MilvusClient
from langchain_openai import OpenAIEmbeddings
load_dotenv()
# Docker Compose로 띄운 Milvus 연결
milvus_client = MilvusClient(uri="http://127.0.0.1:19530")
COLLECTION_NAME = "editor_feedback"
# 1. 총 데이터 개수 확인
res = milvus_client.query(
collection_name=COLLECTION_NAME,
output_fields=["count(*)"]
)
print(f"📊 저장된 기억 개수: {res}")
# 2. 최근 저장된 피드백 3개 확인
results = milvus_client.query(
collection_name=COLLECTION_NAME,
filter="id >= 0", # 모든 데이터 조회
output_fields=["text", "topic", "timestamp"],
limit=3
)
print("\n📝 최근 저장된 피드백 내용:")
for r in results:
print(f"- 주제: {r['topic']}")
print(f"- 내용: {r['text'][:50]}...") # 앞부분만 출력
print("-" * 30)