Skip to main content
Feedback on recall answers is handled via Sessions: you record Q&A in a session, then attach feedback to specific entries using cognee.session.add_feedback and cognee.session.delete_feedback. Before you start:

Record feedback on a session Q&A

  1. Run recall() with session_id so the interaction is stored.
  2. Get the session history with cognee.session.get_session and identify the qa_id of the entry you want to rate.
  3. Call cognee.session.add_feedback with that qa_id, and optionally feedback_text and feedback_score (1–5).
  4. To make feedback influence future retrieval, run improve() with the relevant session_ids. If you are already writing new content with remember(), self_improvement=True can trigger this in the background automatically.
  5. To clear feedback, use cognee.session.delete_feedback(session_id=..., qa_id=...). Both add_feedback and delete_feedback return True on success, False if the entry was not found or the cache is unavailable.
get_session returns a list of SessionQAEntry objects. Each entry has: qa_id, question, answer, context, time, feedback_text, feedback_score. Entries are in chronological order (oldest first); use entries[-1] for the most recent. Pass optional user for multi-tenant or permission-scoped usage.
The per-call feedback_influence defaults to the DEFAULT_FEEDBACK_INFLUENCE environment variable, which is 0.0 (off) by default — so the learned feedback signal does not change ranking until you opt in. Set DEFAULT_FEEDBACK_INFLUENCE (e.g. 0.1) to activate the signal globally, or pass feedback_influence per call to recall() / search() to override it. Setting it back to 0.0 restores the prior baseline.

Feedback API Reference

add_feedback()

Attach a rating and optional text comment to a stored Q&A entry. Returns True if feedback was stored successfully, False if the entry was not found or the cache is unavailable.

delete_feedback()

Clear both feedback_text and feedback_score for an existing Q&A entry without deleting the entry itself. Returns True if feedback was cleared, False if the entry was not found or the cache is unavailable. When calling add_feedback(), provide at least one of feedback_text or feedback_score. If you pass feedback_score, it must be an integer between 1 and 5.

Example

Sessions

Enable conversation memory with sessions

Sessions and Caching

How sessions and caching work

Improve

Enrich the graph and bridge session memory