> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Weekly Knowledge Deduplication and Cleanup

export const UseCaseHero = ({title, description, prompt, category, features, devinUrl, agent, intent, playbookId, type}) => {
  const encodedPrompt = encodeURIComponent(prompt || '');
  const tag = 'docs-use-case-gallery';
  const utm = 'utm_source=docs&utm_medium=use-case-gallery&utm_campaign=hero-cta';
  const agentParams = (agent ? '&agent=' + agent : '') + (intent ? '&intent=' + intent : '') + (playbookId ? '&playbookId=' + playbookId : '');
  const devinHref = type === 'schedule' ? 'https://app.devin.ai/settings/schedules/create?' + utm + agentParams + (prompt ? '&prompt=' + encodedPrompt : '') : type === 'review' ? 'https://app.devin.ai/review?' + utm : agent === 'ada' ? 'https://app.devin.ai/search?' + utm + '&noSubmit=true' + (prompt ? '&prompt=' + encodedPrompt : '') : devinUrl ? devinUrl.includes('?') ? devinUrl + '&' + utm + agentParams : devinUrl + '?' + utm + agentParams : prompt ? 'https://app.devin.ai/?tags=' + tag + '&' + utm + agentParams + '&prompt=' + encodedPrompt : 'https://app.devin.ai/?' + utm + agentParams;
  const buttonLabel = type === 'schedule' ? 'Schedule in Devin ↗' : type === 'review' ? 'Set Up Devin Review ↗' : agent === 'advanced' ? 'Try in Devin ↗' : agent === 'dana' ? 'Try in Dana ↗' : agent === 'ada' ? 'Try in Ask Devin ↗' : 'Try in Devin ↗';
  const featureList = features ? features.split(',').map(f => f.trim()) : [];
  return <div className="uc-hero">
      <div className="uc-hero-inner">
        <div className="uc-hero-left">
          <h1 className="uc-hero-title">{title}</h1>
          <p className="uc-hero-desc">{description}</p>
          <div>
            <a href={devinHref} target="_blank" rel="noopener noreferrer" className="try-in-devin-btn">
              {buttonLabel}
            </a>
          </div>
        </div>
        <div className="uc-hero-meta">
          <div className="uc-meta-item">
            <span className="uc-meta-label">Author</span>
            <span className="uc-meta-value">Cognition</span>
          </div>
          <div className="uc-meta-item">
            <span className="uc-meta-label">Category</span>
            <span className="uc-meta-value">{category}</span>
          </div>
          {featureList.length > 0 && <div className="uc-meta-item">
              <span className="uc-meta-label">Features</span>
              <span className="uc-meta-value">{featureList.join(', ')}</span>
            </div>}
        </div>
      </div>
    </div>;
};

export const PromptBlock = ({children, type, agent, intent, playbookId}) => {
  var utm = 'utm_source=docs&utm_medium=use-case-gallery&utm_campaign=prompt-block';
  var tag = 'docs-use-case-gallery';
  var agentParams = (agent ? '&agent=' + agent : '') + (intent ? '&intent=' + intent : '') + (playbookId ? '&playbookId=' + playbookId : '');
  var label = type === 'schedule' ? 'Schedule in Devin' : type === 'playbook' ? 'Create Playbook' : type === 'knowledge' ? 'Add to Knowledge' : agent === 'advanced' ? 'Try in Devin' : agent === 'dana' ? 'Try in Dana' : agent === 'ada' ? 'Try in Ask Devin' : 'Try in Devin';
  var buildUrl = function (text) {
    var encoded = encodeURIComponent(text);
    if (type === 'schedule') return 'https://app.devin.ai/settings/schedules/create?' + utm + agentParams + '&prompt=' + encoded;
    if (type === 'playbook') return 'https://app.devin.ai/settings/playbooks/create?' + utm + '&body=' + encoded;
    if (type === 'knowledge') return 'https://app.devin.ai/knowledge?' + utm + '&body=' + encoded;
    if (agent === 'ada') return 'https://app.devin.ai/search?' + utm + '&noSubmit=true&prompt=' + encoded;
    return 'https://app.devin.ai/?tags=' + tag + '&' + utm + agentParams + '&prompt=' + encoded;
  };
  const ref = React.useRef(null);
  const [href, setHref] = React.useState('#');
  React.useEffect(() => {
    if (!ref.current) return;
    var codeEl = ref.current.querySelector('pre code');
    if (codeEl) {
      var text = codeEl.textContent.trim();
      if (text) setHref(buildUrl(text));
    }
    var header = ref.current.querySelector('[data-component-part="code-block-header"]');
    if (header && !header.querySelector('.prompt-block-devin-link')) {
      var link = document.createElement('a');
      link.href = href;
      link.target = '_blank';
      link.rel = 'noopener noreferrer';
      link.className = 'prompt-block-devin-link';
      link.style.cssText = 'display:inline-flex;align-items:center;gap:6px;text-decoration:none;color:#fff;font-size:11px;font-weight:500;padding:4px 10px;border-radius:6px;white-space:nowrap;background:#317CFF;transition:background 0.2s;margin-left:8px;';
      link.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg> ' + label;
      link.onmouseenter = function () {
        link.style.background = '#2968D9';
      };
      link.onmouseleave = function () {
        link.style.background = '#317CFF';
      };
      header.appendChild(link);
    }
    var existingLink = ref.current.querySelector('.prompt-block-devin-link');
    if (existingLink && href !== '#') existingLink.href = href;
  });
  return <div className="prompt-block" ref={ref}>{children}</div>;
};

<UseCaseHero title="Weekly Knowledge Deduplication and Cleanup" description="Schedule a Monday Devin session that triages new suggestions, merges duplicate entries, and resolves conflicting guidance — so your knowledge base stays accurate without manual effort." prompt="Review all knowledge suggestions from the past week. Merge duplicates, resolve conflicts between entries, dismiss outdated suggestions, and incorporate genuinely new ones with clear trigger descriptions. Then scan existing knowledge for entries referencing deprecated patterns." category="Devin Optimization" features="Schedules, Advanced" type="schedule" agent="advanced" />

<div className="uc-detail-wrapper">
  <Tip>Don't want to set this up manually? Paste a link to this page into a Devin session and ask it to set everything up for you.</Tip>

  <Steps>
    <Step title="Write your Monday cleanup prompt">
      As your team works with Devin throughout the week, [knowledge suggestions](/product-guides/knowledge) accumulate from every session — patterns Devin learned, commands that worked, conventions it discovered. By Friday, you might have a dozen new suggestions waiting alongside existing entries that reference renamed files or deprecated APIs. A recurring Monday morning Devin session can process all of this before your team starts the week.

      Your prompt should cover two jobs: triaging the past week's suggestions, and deduplicating existing entries. Here's a prompt that handles both:

      <PromptBlock type="schedule" agent="advanced">
        ```txt Monday knowledge deduplication and cleanup theme={null}
        Review and maintain our knowledge base:

        1. Triage pending suggestions from the past week:
           - If new and useful, propose a knowledge entry with a specific trigger description
           - If it overlaps with an existing entry, propose merging into the existing one
           - If outdated or too vague, propose dismissing it
        2. Deduplicate and resolve conflicts in existing entries:
           - Find entries covering the same topic (e.g., two entries about Docker build steps) and propose consolidating into one
           - Identify entries giving contradictory advice (e.g., different pool sizes) and propose a resolution based on recency
           - Flag entries referencing old file paths, deprecated APIs, or removed packages
        ```
      </PromptBlock>

      To get notified when each run completes, configure a **Slack channel** for the schedule — Devin will post a summary of proposed changes there so your team can review without opening the session.
    </Step>

    <Step title="Create the Monday 8 AM schedule">
      You need a [scheduled session](/product-guides/scheduled-sessions) so Devin has access to the knowledge management tools.

      1. Navigate to **Schedules** in the left sidebar of [app.devin.ai](https://app.devin.ai/?utm_source=docs\&utm_medium=use-case-gallery), or use the **Schedule Devin** option in the input box context menu on the home page
      2. Click **Create schedule** and set the frequency to **Weekly — every Monday at 8:00 AM** in your team's timezone, giving a full week of suggestions to process before the new week starts
      3. Paste your Monday cleanup prompt
      4. Optionally attach a [playbook](/product-guides/creating-playbooks) if you want to standardize how Devin formats new entries or organizes knowledge folders

      Devin sends email notifications when each scheduled run starts and completes. If your team uses the [Slack integration](/integrations/slack), Devin will also post the summary directly to your channel. For more on scheduling options, see the [Scheduled Sessions guide](/product-guides/scheduled-sessions).
    </Step>

    <Step title="Review and approve the first Monday run">
      After the first Monday run completes, open the session to review what Devin proposes. **Devin does not automatically apply knowledge changes** — it proposes creates, merges, and deletions, and you manually approve or reject each one. A typical summary looks like this:

      ```
      Knowledge Deduplication & Cleanup — Monday, Feb 10

      Proposed new entries (3):
        - "Run prisma migrate deploy before integration tests" — from session #4821
        - "Redis cache TTL for user profiles is 5 minutes" — from session #4835
        - "Use vitest, not jest, for frontend unit tests" — from session #4802

      Proposed merges (2):
        - Consolidate "Docker build steps" + "Container build process" → single entry
        - Merge two overlapping entries about API error handling conventions

      Proposed removal (1):
        - "Bundle with webpack" — project migrated to Vite in December

      Proposed dismissals (4 suggestions):
        - Already covered by existing knowledge

      Conflict resolution (1):
        - Two entries disagreed on connection pool size (5 vs 10)
        - Recommends pool_size=10 based on the more recent performance tuning session
      ```

      Review each proposal and approve or reject it from the session. Use the first few runs to calibrate — if Devin is too aggressive about proposing removals, add a note to your prompt: *"When in doubt, keep the entry and flag it for review rather than proposing removal."*
    </Step>

    <Step title="Go deeper with monthly audits">
      Once your weekly Monday cleanup is running smoothly, use these prompts in a one-off Devin session every month or two for deeper maintenance:

      <PromptBlock agent="advanced">
        ```txt Monthly knowledge staleness audit theme={null}
        Cross-check every knowledge entry against the current state of our
        connected repos. Flag entries that reference renamed files, removed
        packages, deprecated APIs, or outdated conventions. For each stale
        entry, propose an updated version based on what the codebase
        actually does today.
        ```
      </PromptBlock>

      <PromptBlock agent="advanced">
        ```txt Reorganize knowledge into folders theme={null}
        Reorganize the knowledge base into folders: "Backend", "Frontend",
        "DevOps", "Testing", "API Design". Move existing entries into the
        right folders and update trigger descriptions to be more specific.
        ```
      </PromptBlock>

      **Tip:** The weekly Monday schedule handles ongoing deduplication and suggestion triage. These deeper audits — coverage gap analysis and folder reorganization — are one-time tasks best run manually every month or two.
    </Step>
  </Steps>
</div>
