Smart-Notes-backend / app /graph /nodes /rag_agent.py
pluto90's picture
Upload 6 files
195e631 verified
raw
history blame
932 Bytes
# # app/graph/rag_agent.py
# from app.core.rag_service import get_rag_context
# def rag_agent_node(state):
# print("DEBUG β†’ state received:", state)
# query= state["query"]
# doc_id= state["doc_id"]
# print("DEBUG β†’ query:", query)
# print("DEBUG β†’ doc_id:", doc_id)
# context, sources= get_rag_context(query, doc_id)
# print("DEBUG β†’ context:", context[:200] if context else "EMPTY")
# return {
# **state,
# "context": context,
# "sources": sources
# }
def rag_agent_node(state):
print("DEBUG β†’ state received:", state)
# βœ… context already comes from router now
context = state.get("context")
sources = state.get("sources")
print("DEBUG β†’ context:", context[:200] if context else "EMPTY")
return {
**state,
"context": context,
"sources": sources
}