Cognee’s self-improving memory capabilities enable your knowledge graphs to continuously learn and adapt through user feedback and automatic optimization. The system creates a feedback loop where user interactions improve future search results and system performance.
Self-improving memory in Cognee uses user feedback to automatically enhance knowledge graph quality, search relevance, and system performance through continuous learning mechanisms.

Key Features

User Feedback Loop

Continuous LearningCollect user feedback on search results to improve future responses and graph quality.

Automatic Weight Updates

Smart OptimizationFeedback scores are automatically applied to knowledge graph relationships for better results.

Sentiment Analysis

Intelligent ProcessingLLM-powered sentiment analysis converts feedback text into actionable improvement signals.

Graph Enhancement

Quality ImprovementKnowledge graph relationships are continuously refined based on user interactions.

How Self-Improvement Works

1

User Feedback Collection

Users provide feedback on search results and system responses through the feedback API.
2

Sentiment Analysis

Feedback text is analyzed using LLM to determine sentiment and assign numerical scores.
3

Graph Weight Updates

Feedback scores are applied to knowledge graph relationships to improve future results.
4

Improved Future Results

Enhanced graph weights lead to better search results and more relevant responses.

Feedback System

Providing Feedback

Use the feedback search type to improve system performance:
import cognee
from cognee import SearchType

# Provide positive feedback
await cognee.search(
    query_text="Great answer, very comprehensive and accurate!",
    query_type=SearchType.FEEDBACK,
    last_k=1  # Apply to last interaction
)

Feedback Workflow

Simple Feedback Loop
import cognee
from cognee import SearchType

# 1. Perform a search (save interaction for feedback)
results = await cognee.search(
    query_type=SearchType.GRAPH_COMPLETION,
    query_text="What are the main themes in my data?",
    save_interaction=True  # Required for feedback
)

# 2. User evaluates results
print("Search results:", results)

# 3. Provide feedback based on quality
await cognee.search(
    query_type=SearchType.FEEDBACK,
    query_text="Perfect! Exactly what I was looking for",
    last_k=1
)

print("✅ Feedback applied to improve future results")

Feedback Processing

Sentiment Analysis

Advanced Features

Monitor Improvement
# Track feedback patterns (conceptual - implement as needed)
feedback_stats = await cognee.get_feedback_analytics(
    time_period="last_30_days",
    metrics=["average_sentiment", "feedback_volume", "improvement_trend"]
)

print(f"Average sentiment: {feedback_stats.average_sentiment}")
print(f"Feedback volume: {feedback_stats.feedback_count}")
print(f"Improvement trend: {feedback_stats.trend}")

Configuration

Basic Setup

Benefits

For End Users

Better Experience
  • Improved search results over time
  • Personalized responses based on preferences
  • Higher quality answers through learning

For Administrators

System Insights
  • Performance monitoring through feedback patterns
  • Quality assurance and improvement identification
  • User satisfaction tracking

For Developers

Easy Integration
  • Simple API for feedback collection
  • Graph-native feedback storage
  • Extensible design for custom feedback types

For Organizations

Continuous Improvement
  • Self-improving knowledge base
  • Reduced manual curation needs
  • Better ROI on knowledge management

Best Practices

1

Enable Interaction Saving

Prerequisite SetupAlways set save_interaction=True for searches you plan to collect feedback on.
2

Encourage Specific Feedback

Quality GuidelinesGuide users to provide specific, constructive feedback rather than simple “good” or “bad” responses.
3

Regular Feedback Collection

Consistent LearningImplement regular feedback collection in your application workflow for continuous improvement.
4

Monitor Feedback Patterns

Track ImprovementMonitor feedback trends to understand system improvement and identify areas needing attention.

Troubleshooting

Feedback Not Working

Next Steps