Tutorial

How to Build an Agent Memory Wiki with Search

Build a diffable markdown wiki for agent memory with search grounding for freshness. Architecture pattern for persistent agents.

An open-source 'super memory' for AI agents was posted — multi-agent RAG + hybrid wiki search + transparency score. This tutorial builds the search-grounded memory layer.

Prerequisites

  • Scavio API key
  • Git repository for the wiki
  • LLM API key

Walkthrough

Step 1: Design the wiki structure

Markdown files organized by topic with metadata frontmatter.

# wiki/topics/search-api-pricing.md
# ---
# topic: Search API Pricing
# last_verified: 2026-05-03
# confidence: high
# sources: [scavio.dev, serpapi.com, tavily.com]
# ---
# Scavio: $0.005/query, $30/mo for 7K credits
# SerpAPI: $75/mo for 5K searches
# ...

Step 2: Build the refresh function

Search API verifies and updates stale entries.

Python
import requests, os, datetime
H = {'x-api-key': os.environ['SCAVIO_API_KEY']}

def refresh_entry(topic, current_content):
    results = requests.post('https://api.scavio.dev/api/v1/search', headers=H,
        json={'platform': 'google', 'query': f'{topic} 2026 current'}).json()
    # LLM compares current wiki content vs fresh search results
    # Updates only if facts changed
    # Logs the diff for transparency

Step 3: Add transparency scoring

Each entry gets a confidence score based on recency and source count.

Python
def transparency_score(entry):
    days_since_verified = (datetime.date.today() - entry['last_verified']).days
    if days_since_verified < 7: return 'high'
    if days_since_verified < 30: return 'medium'
    return 'stale'

Step 4: Schedule refresh cron

Daily cron refreshes stale entries.

Bash
# crontab: 0 3 * * * python refresh_wiki.py
# Refreshes entries with confidence < 'high'
# Budget: ~50 queries/day = $0.25/day

Step 5: Git-track changes

Every refresh is a git commit for full diff history.

Bash
# After refresh:
git add wiki/
git commit -m "refresh: $(date +%Y-%m-%d) - N entries updated"
# Full diff history in git log

Python Example

Python
# Agent memory wiki: markdown files + search grounding + git history
# The wiki IS the memory. Git IS the audit trail.
# Search API keeps it fresh. LLM decides what changed.

JavaScript Example

JavaScript
// Same pattern in JS/TS with file system operations.

Expected Output

JSON
Git-tracked markdown wiki with daily search-grounded freshness verification, transparency scores, and full diff history.

Related Tutorials

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Scavio API key. Git repository for the wiki. LLM API key. A Scavio API key gives you 500 free credits per month.

Yes. The free tier includes 500 credits per month, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Start Building

Build a diffable markdown wiki for agent memory with search grounding for freshness. Architecture pattern for persistent agents.