Skip to main content

Memory Bank

Configure memory bank personality, background, and behavior. Memory banks have charateristics:

  • Banks are completely isolated from each other.
  • You don't need to pre-create it, Hindsight will create it for you with default settings.
  • Banks have a profile that influences how they form opinions from memories. (optional)
Prerequisites

Make sure you've completed the Quick Start to install the client and start the server.

Creating a Memory Bank

from hindsight_client import Hindsight

client = Hindsight(base_url="http://localhost:8888")

client.create_bank(
bank_id="my-bank",
name="Research Assistant",
background="I am a research assistant specializing in machine learning",
personality={
"openness": 0.8,
"conscientiousness": 0.7,
"extraversion": 0.5,
"agreeableness": 0.6,
"neuroticism": 0.3,
"bias_strength": 0.5
}
)

Personality Traits (Big Five)

Each trait is scored 0.0 to 1.0:

TraitLow (0.0)High (1.0)
OpennessConventional, prefers proven methodsCurious, embraces new ideas
ConscientiousnessFlexible, spontaneousOrganized, systematic
ExtraversionReserved, independentOutgoing, collaborative
AgreeablenessDirect, analyticalCooperative, diplomatic
NeuroticismCalm, optimisticRisk-aware, cautious

How Traits Affect Behavior

Openness influences how the bank weighs new vs. established ideas:

# High openness bank
"Let's try this new framework—it looks promising!"

# Low openness bank
"Let's stick with the proven solution we know works."

Conscientiousness affects structure and thoroughness:

# High conscientiousness bank
"Here's a detailed, step-by-step analysis..."

# Low conscientiousness bank
"Quick take: this should work, let's try it."

Extraversion shapes collaboration preferences:

# High extraversion bank
"We should get the team together to discuss this."

# Low extraversion bank
"I'll analyze this independently and share my findings."

Agreeableness affects how disagreements are handled:

# High agreeableness bank
"That's a valid point. Perhaps we can find a middle ground..."

# Low agreeableness bank
"Actually, the data doesn't support that conclusion."

Neuroticism influences risk assessment:

# High neuroticism bank
"We should consider what could go wrong here..."

# Low neuroticism bank
"The risks seem manageable, let's proceed."

Background

The background is a first-person narrative providing bank context:

client.create_bank(
bank_id="financial-advisor",
background="""I am a conservative financial advisor with 20 years of experience.
I prioritize capital preservation over aggressive growth.
I have seen multiple market crashes and believe in diversification."""
)

Background influences:

  • How questions are interpreted
  • Perspective in responses
  • Opinion formation context

Getting Bank Profile

# Using the low-level API
from hindsight_client_api import ApiClient, Configuration
from hindsight_client_api.api import DefaultApi

config = Configuration(host="http://localhost:8888")
api_client = ApiClient(config)
api = DefaultApi(api_client)

profile = api.get_bank_profile("my-bank")

print(f"Name: {profile.name}")
print(f"Background: {profile.background}")
print(f"Personality: {profile.personality}")

Default Values

If not specified, banks use neutral defaults:

{
"openness": 0.5,
"conscientiousness": 0.5,
"extraversion": 0.5,
"agreeableness": 0.5,
"neuroticism": 0.5,
"bias_strength": 0.5,
"background": ""
}

Personality Templates

Common personality configurations:

Use CaseOCEANBias
Customer Support0.50.70.60.90.30.4
Code Reviewer0.40.90.30.40.50.6
Creative Writer0.90.40.70.60.50.7
Risk Analyst0.30.90.30.40.80.6
Research Assistant0.80.80.40.50.40.5
Neutral (default)0.50.50.50.50.50.5
# Customer support bank
client.create_bank(
bank_id="support",
background="I am a friendly customer support agent",
personality={
"openness": 0.5,
"conscientiousness": 0.7,
"extraversion": 0.6,
"agreeableness": 0.9, # Very diplomatic
"neuroticism": 0.3, # Calm under pressure
"bias_strength": 0.4
}
)

# Code reviewer bank
client.create_bank(
bank_id="reviewer",
background="I am a thorough code reviewer focused on quality",
personality={
"openness": 0.4, # Prefers proven patterns
"conscientiousness": 0.9, # Very thorough
"extraversion": 0.3,
"agreeableness": 0.4, # Direct feedback
"neuroticism": 0.5,
"bias_strength": 0.6
}
)

Bank Isolation

Each bank has:

  • Separate memories — banks don't share memories
  • Own personality — traits are per-bank
  • Independent opinions — formed from their own experiences
# Store to bank A
client.retain(bank_id="bank-a", content="Python is great")

# Bank B doesn't see it
results = client.recall(bank_id="bank-b", query="Python")
# Returns empty