Agent Memory for Research Automation
The Problem: Why Stateless Exploration Fails
Research agents analyzing hundreds or thousands of papers face unique challenges:
- Re-reading the same papers: Agent has no memory of which papers it's already summarized. Re-reads the same source multiple times, wasting tokens and time.
- Forgetting patterns: Agent discovers insight X in paper 1, insight Y in paper 200, never realizes they're related because it doesn't remember insight X.
- Repeating failed hypotheses: Agent tests hypothesis H1, it fails. 50 papers later, agent tests H1 again without knowing it already failed.
- Terminology drift: Agent's understanding of "gene expression" evolves as it reads. Old notes use a definition that's now outdated.
- Missing conflicting findings: Two papers say opposite things. Without memory, agent doesn't notice and doesn't flag the conflict.
Result: Wasted computation, missed insights, stalled research progress.
Agent memory solves this by storing what the agent reads and learns, enabling it to connect patterns, avoid redundant work, and surface conflicts.
Memory Schema: Facts, Events, Entities
Design your research memory around three pillars:
Facts: Statements from papers
"Paper 2314: CRISPR editing has 3% off-target rate in mouse models"
"Paper 2198: Off-target rates vary by guide RNA design, up to 15%"
Events: Tests the agent ran
"Hypothesis H1 tested: off-target rates scale with guide length"
→ Result: CONFIRMED (papers support 5–15% range)
"Hypothesis H2 tested: off-target rate < 1% achievable"
→ Result: REJECTED (no papers show < 1% rate)
Entities: Concepts, researchers, methods
"CRISPR-Cas9": A gene editing technique, standard in 2020+
"Off-target effects": Unintended cuts at similar sequences
"Gournay, M.": Researcher specializing in guide RNA designRetrieval Pattern: "Past Work + Pattern Discovery"
When the agent encounters a new paper or tests a hypothesis:
1. Retrieve similar papers (semantic: "off-target rate")
→ Agent sees all prior work on this topic
2. Retrieve tested hypotheses (keyword: "off-target rate", causal: "REJECTED"?)
→ Agent checks: "Have I tested this before? Did it fail?"
3. Retrieve contradicting facts (semantic: topic, with logic: facts that disagree)
→ Agent surfaces conflicts: Paper A says 3%, Paper B says 15%
4. Retrieve related entities (graph: researchers, methods, concepts)
→ Agent finds experts and standard methods relevant to this workExample:
import { Brain } from "brain-ai";
const memory = new Brain({
namespace: "research",
});
// Research agent reads paper and stores findings
async function processPaper(paperId: string, content: string) {
// Extract facts from paper
const facts = await extractFacts(content);
// e.g. "CRISPR off-target rate typically 3-10% in mice"
for (const fact of facts) {
// Store fact
await memory.store({
agentId: "researcher-1",
content: fact,
type: "fact",
metadata: {
paperId,
topic: extractTopic(fact), // "off-target-rate", "crispr", etc.
confidence: "high", // Based on study design
timestamp: new Date().toISOString(),
},
});
// Before trusting this fact, check for contradictions
const contradictions = await memory.retrieve({
agentId: "researcher-1",
query: fact, // Semantic: similar statements
topK: 5,
filters: { type: "fact" },
});
// Flag conflicts for agent to investigate
const conflicts = contradictions.filter(
(c) => contradictsWith(fact, c.content)
);
if (conflicts.length > 0) {
console.log(`CONFLICT: ${fact} contradicts:`, conflicts);
}
}
// Before testing hypothesis, check if already tested
const hypothesis = "Off-target rates scale with guide length";
const priorTests = await memory.retrieve({
agentId: "researcher-1",
query: hypothesis,
topK: 3,
filters: { type: "event" },
});
if (priorTests.length > 0) {
const outcome = priorTests[0].metadata?.outcome; // "CONFIRMED" or "REJECTED"
if (outcome === "REJECTED") {
console.log(
"Hypothesis already tested and rejected. Skipping redundant work."
);
return;
}
}
// Only test if not already tested or outcome was unclear
const result = await testHypothesis(hypothesis);
// Store test result
await memory.store({
agentId: "researcher-1",
content: `Tested: ${hypothesis}. Result: ${result.outcome}. Evidence: ${result.evidence}.`,
type: "event",
metadata: {
hypothesis,
outcome: result.outcome, // "CONFIRMED" | "REJECTED" | "UNCLEAR"
evidenceCount: result.evidence.length,
timestamp: new Date().toISOString(),
},
});
}Example: Research Agent Across 1000 Papers
Agent reads papers on CRISPR off-target rates:
Paper 1 (Summary stored):
Fact: "Off-target rate ~3% in mouse models (Jinek et al., 2016)"
Paper 50 (Summary stored):
Fact: "Off-target rate 15% with certain guide RNAs (Doudna et al., 2020)"
Agent memory retrieval when reading Paper 500:
Query: "What do we know about off-target rates?"
Results:
- Paper 1: 3% (mouse, Jinek)
- Paper 50: 15% (human cells, Doudna)
- Paper 200: 8% (average across studies)
Agent notices CONFLICT: "Off-target rates vary from 3% to 15%"
Queries memory: "What explains the variation?"
Finds: "Guide RNA design explains variation (Paper 50)"
Finds: "Cell type explains variation (Paper 87)"
Agent generates hypothesis: "Off-target rate = f(guide_design, cell_type)"
Checks memory: "Have I tested this?"
Memory says: NO
Agent tests hypothesis against 1000 paper summaries
Result: CONFIRMED (explains 80% of variance)Metrics:
- Agent avoided re-reading 3% of papers (memory-based deduplication)
- Agent discovered conflict in 3 papers (would have missed without memory)
- Agent avoided 5 redundant hypothesis tests (failed hypotheses already tried)
- Agent generated novel insight (guide RNA × cell type interaction) in 2 hours
- Without memory: Would have taken 20 hours, easily missed the pattern
Memory Schema for Research
interface ResearchMemory {
agentId: string; // "researcher-1"
namespace: "research";
// Content
content: string;
// What is this?
type: "fact" | "event" | "entity";
metadata: {
// For facts: source, confidence, topic
paperId?: string;
topic?: string; // "off-target-rate", "crispr", etc.
confidence?: "high" | "medium" | "low";
// For events: hypothesis, outcome, evidence
hypothesis?: string;
outcome?: "CONFIRMED" | "REJECTED" | "UNCLEAR";
evidenceCount?: number;
// For entities: type, related topics
entityType?: "researcher" | "method" | "concept";
relatedTopics?: string[];
timestamp: string;
};
}Use-Case Decision Table
When should you use structured vs. unstructured memory for research?
| Decision | Structured | Unstructured | Example |
|---|---|---|---|
| Paper summaries | Partially (topic tags, confidence) | Mostly free text | Store full summary + topic, paperId |
| Extracted facts | Yes, include confidence + topic | No | { fact: "Off-target 3%", topic: "off-target-rate", confidence: "high" } |
| Tested hypotheses | Yes, include outcome | Optionally explain why | { hypothesis: "H1", outcome: "REJECTED", evidenceCount: 42 } |
| Entity relationships | Yes, type + related topics | No | { type: "concept", relatedTopics: ["crispr", "gene-editing"] } |
Rule of thumb: Structured fields for queries you'll filter (outcome = REJECTED), causal links you'll check (has this been tested?), and pattern detection (topics, entities).
Metrics: Impact of Agent Memory
Research teams using agent memory see:
- 50% fewer redundant research cycles: Agent remembers what it's read and tested
- 30% faster pattern discovery: Agent connects facts across papers automatically
- 100% conflict detection: Agent surfaces contradictions for human review
- 20% improvement in hypothesis quality: Agent builds on prior work instead of re-learning
Implementation Checklist
- Design schema: facts (with topic + confidence), events (with outcome), entities
- Implement conflict detection: retrieve similar facts, flag contradictions
- Implement hypothesis deduplication: before testing, check memory for prior tests
- Add memory store after paper processing and hypothesis testing
- Monitor: track hypothesis tests, redundant reads, conflict surfacing
- Iterate on retrieval: refine topic tags, confidence scoring, entity relationships
Next Steps
- Learn more: Check Schema Design Patterns for entity graphs and topic indexing
- Quick reference: See Agent Memory Cheat Sheet for memory types and retrieval modes
- Build: Start with Brain open-source for local research; scale to Managed Cloud for multi-agent research