
Building an AI Research Agent with Persistent Memory
TL;DR
The Quercle Research Agent is an AI assistant that remembers what it learns. Unlike standard chatbots that forget everything between sessions, this agent builds knowledge over time using Quercle for web research, OpenRouter for LLM access, and MongoDB for persistent memory.
Links:
The Problem with AI Research
You're researching AI agent frameworks. You spend 30 minutes with ChatGPT, learn a lot, then move on. Weeks later, you want to continue - but what exactly did you learn? Which sources did you use? What's changed since then?
Standard chatbots aren't designed for ongoing research. Even with memory features, they store general facts about you - not structured research findings with sources, timestamps, and topics you can query later.
The Quercle Research Agent solves this by maintaining a dedicated research memory you can search and build on over time.
How It Works
When you ask a question, the agent:
- Checks memory first - Do I already know this?
- Searches if needed - Uses Quercle to find current information
- Stores findings - Saves key facts to MongoDB for future sessions
- Cites sources - Every answer includes source links
Both your research memories and conversation history are stored in MongoDB - not browser storage. Your data persists across devices and won't disappear if you clear your browser.
Example: Building Knowledge Over Time
Session 1: Initial Research
You: What are the main approaches to AI agent memory?
Agent: [recall] No previous research found
[search] "AI agent memory architectures 2025"
[fetch] langchain.com/docs/memory
[remember] Stored 6 findings about agent memory
Report: There are three main approaches...
1. Buffer memory (recent context)
2. Vector memory (semantic search)
3. Entity memory (knowledge graphs)Session 2: Follow-up (days later)
You: How does LangChain implement vector memory?
Agent: [recall] Found 2 memories about LangChain memory...
[search] "LangChain vector memory implementation" (for details)
[remember] Updated findings with implementation specifics
Report: Based on my previous research and new findings...Session 3: Checking for updates
You: Any new developments in AI agent memory since my last research?
Agent: [recall] Last researched: 2 weeks ago
[search] "AI agent memory latest developments"
Report: Since your last research, two notable developments...Who Is This For?
Individual researchers, analysts, and curious minds who:
- Track evolving topics over weeks/months
- Return to the same domains repeatedly
- Want to see exactly what sources the AI used
- Prefer building cumulative knowledge over one-shot answers
Not for:
- One-off questions (just use ChatGPT/Claude/Perplexity)
- Team collaboration (no multi-user support yet)
- Real-time data needs (memory is point-in-time snapshots)
Tech Stack
| Component | Choice | Why |
|---|---|---|
| Framework | Next.js | App router, server components |
| Runtime | Bun | Fast, modern |
| Web Search | Quercle API | Returns analyzed content, not raw HTML |
| Memory & History | MongoDB Atlas | Stores research findings and conversation history |
| LLM | OpenRouter | Access to multiple models |
| AI SDK | Vercel AI SDK | Streaming, tool calling |
Agent Tools
| Tool | Purpose |
|---|---|
quercleSearch | Search the web, get AI-synthesized results |
quercleFetch | Read and analyze a specific webpage |
remember | Store facts in long-term memory |
recall | Retrieve past research |
Quick Start
git clone https://github.com/quercledev/quercle-research-agent.git
cd quercle-research-agent
bun install
cp .env.example .env
# Edit .env with your API keys
bun devConfiguration
# .env
QUERCLE_API_KEY=qk_... # Web search
MONGODB_URI=mongodb+srv://... # Memory storage
OPENROUTER_API_KEY=sk-or-... # LLM provider
MODEL=openai/gpt-5-nano # Or any OpenRouter model that supports tool callsLimitations
- Single user - No authentication or multi-user support
- No sharing - Can't share research or collaborate
- Memory grows - No automatic cleanup of old memories
Get Started
Clone the repo, add your API keys, and start building cumulative knowledge:
github.com/quercledev/quercle-research-agent
Have ideas for new features or want to contribute? Pull requests and suggestions are welcome on GitHub!
Ready to try Quercle?
Built for AI agents. See how it compares in real-world tests.
More Articles

Quercle Chat: Open Source AI Chat with Web Tools
Quercle Chat runs entirely in your browser - no backend, no data collection. An open source, model-agnostic AI chat with web search and fetch capabilities. Use any OpenRouter model.

SERP MCP: Local Google Search for AI Agents
Get Google search results locally with SERP MCP - an open source MCP server with fingerprint rotation. Learn when to use it vs Quercle for your AI agents.

Quercle + xpander.ai: Powering AI Agents with Web Data
Quercle integrates with xpander.ai to give AI agents reliable web access. See how to build agents that monitor GitHub trends, research topics, and more.

Testing LLM Security: A Prompt Injection Testing Ground
Sunny Valley Farm is not what it seems. An open source website for testing whether LLM web tools can defend against prompt injection attacks.

How Claude Code Web Tools Work: WebFetch and WebSearch Internals
A deep dive into how Claude Code implements WebFetch and WebSearch tools internally. Learn about secondary conversations, Haiku processing, and how to build better alternatives.

Quercle vs Tavily: Which Web API is Best for AI Agents?
A detailed comparison of Quercle and Tavily for AI agent web access. Compare features, pricing, security, and when to use each.

Quercle vs Exa: Choosing the Right Web API for Your AI Agents
Compare Quercle and Exa for AI-powered web access. Learn about their differences in search, content extraction, and agent integration.

Quercle vs Firecrawl: Web Scraping APIs for AI Agents Compared
Compare Quercle and Firecrawl as web fetching APIs for AI agents. See how they differ in security, pricing, and developer experience.