5. Knowledge & Memory

Great agents need great context. Sutra's memory and knowledge system ensures your agents always have the right information at the right time — from facts they should never forget, to conversations from last week, to the 200-page product manual you uploaded yesterday. Everything is searchable, everything is cited, and everything stays up to date.

Three-Tier Memory System

The Memory dashboard (/memory) allows you to inspect exactly what your agents "know." Sutra categorizes memory into three tiers to balance context window limits against historical recall.

Placeholder: Memory Dashboard

Tier 1: Core Memory

  • What it is: High-priority, fixed facts that are always injected into the agent's system prompt.
  • Example: "The user prefers Python code to use type hints." or "The company's core product is Sutra."
  • Management: Core memory is manually editable by the user and actively updated by agents when explicitly instructed to remember a critical fact.

Core memory is intentionally small — think of it as the agent's "always-on" context. Keep it focused on high-value facts that the agent needs in every single conversation. Examples: the user's preferred programming language, the company's brand voice guidelines, or critical compliance rules the agent must never violate.

Tier 2: Recall Memory (Vector Store)

  • What it is: A searchable history of past conversations and events.
  • How it works: As you chat or as agents complete tasks, the transcripts are embedded into a pgvector database. When a new prompt is received, the agent performs a semantic search to find related past interactions and pulls them into the current context window.

This means your agents genuinely improve over time. If you corrected an agent's formatting three weeks ago, that correction lives in recall memory — and the agent will retrieve it next time a similar situation arises. The semantic search is smart enough to match by meaning, not just keywords, so a conversation about "deployment failures" will surface when the agent encounters a question about "production rollback issues."

Tier 3: Archival Memory

  • What it is: Long-term storage for extremely old interactions.
  • How it works: Sutra runs nightly background jobs (default: 3 AM) to consolidate recall memories older than 14 days with low decay scores into dense archival summaries. Memories are hard-deleted after 90 days if their decay score drops below 0.01.

You can configure the consolidation threshold and decay half-life globally. The memory decay half-life defaults to 7 days — meaning a memory's relevance score halves every week unless it's accessed. Frequently accessed memories maintain high decay scores and stay in recall. Archived memories aren't deleted immediately — they're condensed into summaries that still appear in search results, just with less granularity.


Knowledge Base (RAG)

The Knowledge Base (/knowledge) allows you to upload proprietary company data that isn't part of conversational history.

Placeholder: Knowledge Base Upload

Document Ingestion

  • File Uploads: Upload PDFs, Markdown files, or raw Text documents. Sutra intelligently chunks the text, preserving paragraph and heading boundaries, and embeds them.
  • Web Scraping: Provide a URL, and Sutra will scrape the webpage, extract the primary content, and index it.
  • Structured Data: Upload CSV or JSON files and Sutra will index each row or record individually — perfect for product catalogs, FAQ databases, or employee directories that agents need to query.
Tip: For best results, upload documents that are well-structured with clear headings and sections. Sutra's chunking algorithm uses heading boundaries to create semantically meaningful chunks, which dramatically improves retrieval accuracy compared to arbitrary fixed-size splits.

Agent Retrieval

Agents must be equipped with the search_knowledge_base tool. When asked a question, the agent uses the tool to query the vector database, reads the returned chunks, and synthesizes an answer complete with citations pointing back to your original uploaded documents.

Citations are displayed inline in the agent's response — each claim links back to the specific document chunk it came from, including the file name and section header. This makes it easy for users to verify the agent's answers and builds trust in the system's output.


Google Drive Integration

Keep your agents synced with your living documents using the Google Drive integration (/google-drive).

Placeholder: Google Drive Sync

Configuration

  1. Authenticate via Google OAuth.
  2. Select specific Folders or Shared Drives.
  3. Sutra will automatically sync supported documents (Docs, Sheets, Slides, PDFs) into the Knowledge Base.

Continuous Sync

As your team updates documents in Google Drive, Sutra periodically re-indexes them, ensuring your agents never provide outdated answers based on stale data.

As your team updates documents in Google Drive, Sutra can periodically re-index them, ensuring your agents never provide outdated answers based on stale data.

Tip: Organize your Google Drive folders by topic or department before connecting them to Sutra. This makes it easier to scope knowledge access per project — a marketing agent only needs the marketing folder, not the entire company drive.