Opinions
How memory banks form, store, and evolve beliefs.
Prerequisites
Make sure you've completed the Quick Start to install the client and start the server.
What Are Opinions?
Opinions are beliefs formed by the memory bank based on evidence and disposition. Unlike world facts (objective information received) or experience (conversations and events), opinions are judgments with confidence scores.
| Type | Example | Confidence |
|---|---|---|
| World Fact | "Python was created in 1991" | — |
| Experience | "I recommended Python to Bob" | — |
| Opinion | "Python is the best language for data science" | 0.85 |
How Opinions Form
Opinions are created during reflect operations when the memory bank:
- Retrieves relevant facts
- Applies disposition traits
- Forms a judgment
- Assigns a confidence score
- Python
- Node.js
# Opinions are automatically formed when the bank encounters
# claims, preferences, or judgments in retained content
client.retain(
bank_id="my-bank",
content="I think Python is excellent for data science because of its libraries"
)
# The bank forms an opinion with confidence based on evidence
// Opinions are automatically formed when the bank encounters
// claims, preferences, or judgments in retained content
await client.retain('my-bank',
"I think Python is excellent for data science because of its libraries"
);
// The bank forms an opinion with confidence based on evidence
Searching Opinions
- Python
- Node.js
- CLI
# Search for opinions on a topic
response = client.recall(
bank_id="my-bank",
query="What do you think about Python?",
types=["opinion"]
)
for opinion in response.results:
print(f"Opinion: {opinion.text}")
print(f"Confidence: {opinion.confidence}")
// Search for opinions on a topic
const response = await client.recall('my-bank', 'What do you think about Python?', {
types: ['opinion']
});
for (const opinion of response.results) {
console.log(`Opinion: ${opinion.text}`);
console.log(`Confidence: ${opinion.confidence}`);
}
hindsight recall my-bank "programming" --types opinion
Opinion Evolution
Opinions change as new evidence arrives:
| Evidence Type | Effect |
|---|---|
| Reinforcing | Confidence increases (+0.1) |
| Weakening | Confidence decreases (-0.15) |
| Contradicting | Opinion revised, confidence reset |
Example evolution:
t=0: "Python is best for data science" (0.70)
↓ New evidence: Python dominates ML libraries
t=1: "Python is best for data science" (0.85)
↓ New evidence: Julia is 10x faster for numerical computing
t=2: "Python is best for data science, though Julia is faster" (0.75)
↓ New evidence: Most teams still use Python
t=3: "Python is best for data science" (0.82)
Disposition Influence
Different dispositions form different opinions from the same facts:
- Python
- Node.js
# Bank disposition affects how opinions are formed
# High skepticism = lower confidence, requires more evidence
# Low skepticism = higher confidence, accepts claims more readily
client.create_bank(
bank_id="skeptical-bank",
disposition={"skepticism": 5, "literalism": 3, "empathy": 2}
)
# Same content, different confidence due to disposition
client.retain(bank_id="skeptical-bank", content="Python is the best language")
// Bank disposition affects how opinions are formed
// High skepticism = lower confidence, requires more evidence
// Low skepticism = higher confidence, accepts claims more readily
await client.createBank('skeptical-bank', {
disposition: { skepticism: 5, literalism: 3, empathy: 2 }
});
// Same content, different confidence due to disposition
await client.retain('skeptical-bank', 'Python is the best language');
Opinions in Reflect Responses
When reflect uses opinions, they appear in based_on:
- Python
- Node.js
# Opinions influence reflect responses
response = client.reflect(
bank_id="my-bank",
query="Should I use Python for my data project?"
)
# The response incorporates the bank's opinions with appropriate confidence
print(response.text)
// Opinions influence reflect responses
const reflectResponse = await client.reflect('my-bank',
'Should I use Python for my data project?'
);
// The response incorporates the bank's opinions with appropriate confidence
console.log(reflectResponse.text);
Confidence Thresholds
Opinions below a confidence threshold may be:
- Excluded from responses
- Marked as uncertain
- Revised more easily
# Low confidence opinions are held loosely
# "I think Python might be good for this" (0.45)
# High confidence opinions are stated firmly
# "Python is definitely the right choice" (0.92)