What Is a Hindsight Bank Mission Statement? Purpose, Usage, and Implementation
A Hindsight bank mission statement is a free-form text field that defines an agent's identity and objectives, driving memory ingestion, reflection, and behavioral alignment across the Hindsight memory system.
The Hindsight bank mission statement serves as the foundational behavioral contract for AI agents within the vectorize-io/hindsight repository. Stored within every memory bank, this text tells the system who the agent is and what it should try to accomplish, directly influencing how observations are retained, filtered, and synthesized. Understanding its implementation across the database layer, LLM pipelines, and API surface is essential for configuring agent behavior effectively.
Core Purpose and Functional Role
A bank mission is free-form text that describes the agent's identity and purpose. According to the source code, it functions as a behavioral contract that guides four critical subsystems:
- Memory ingestion – The retain pipeline consults the mission to decide which facts are worth keeping and how they should be phrased (for example, "track customer preferences").
- Reflection and reasoning – The reflect step receives the mission so the LLM can generate higher-level summaries that stay aligned with the agent's stated purpose.
- Observations filtering – The mission guides the observations subsystem to prioritize stable facts relevant to the agent's role.
- API contract – Clients interact with the mission via the public
/banks/{bank_id}/missionendpoint, and the value is returned in everyBankProfileResponse.
Technical Implementation and Usage
Database Storage and Schema
The mission is persisted as a simple TEXT column in the banks table. In hindsight-api-slim/hindsight_api/engine/retain/bank_utils.py, the set_bank_mission function executes an UPDATE statement that sets this column directly:
# From bank_utils.py lines 72-89
# SET mission = $2 WHERE bank_id = $1
This storage layer validates that the bank exists before updating the column, ensuring referential integrity during mission updates.
Memory Ingestion and the Retain Pipeline
During the retain pipeline execution, the mission statement influences what observations are deemed worthy of permanent storage. The system uses the mission text as context when deciding whether to keep specific facts and how to phrase them for later retrieval.
Reflection and Higher-Level Reasoning
The reflect step explicitly receives the bank mission to ensure that generated summaries and insights remain aligned with the agent's defined purpose. This prevents the system from generating reflections that contradict the agent's core objectives or identity.
Mission Merging via LLM
New information can be merged into an existing mission through an LLM-driven process implemented in _llm_merge_mission. This function crafts a prompt that:
- Forces output in first-person perspective
- Resolves conflicts between existing and new content
- Enforces a 500-character limit
- Returns only the merged text without additional commentary
The implementation in bank_utils.py (lines 46-64) handles the prompt engineering required to maintain consistent voice and brevity.
API and Client Access
The Python client exposes mission management through the client.set_mission() method, which calls the internal set_bank_mission function through the REST endpoint. As shown in hindsight-clients/python/tests/test_main_operations.py (lines 704-713), the API returns the updated mission within the BankProfileResponse payload.
Code Examples and Usage Patterns
Setting a Mission via the Python Client
Use the HindsightClient to define an agent's purpose programmatically:
# Assume `client` is an instance of HindsightClient
bank_id = "my-bank-123"
# Set a new mission
response = client.set_mission(
bank_id=bank_id,
mission="I am a senior software architect. Keep track of system designs, API contracts and architectural trade‑offs."
)
print(response.mission) # → the newly stored mission text
This call maps directly to the set_bank_mission implementation in bank_utils.py.
Merging Additional Information
When you need to extend an existing mission without overwriting it, use the merge functionality:
# Merge new intent without overwriting existing purpose
merged = await memory.merge_bank_mission(
llm_config=my_llm,
bank_id=bank_id,
new_info="Also remember the preferred tech stack for each service."
)
print(merged["mission"])
The merge operation utilizes the _llm_merge_mission prompt logic to maintain first-person consistency and respect length constraints.
Direct Database Verification
For debugging or administrative purposes, query the mission directly:
SELECT bank_id, mission
FROM banks
WHERE bank_id = 'my-bank-123';
This reflects the same UPDATE statement executed by set_bank_mission in the retention engine.
Summary
- A Hindsight bank mission statement is stored as a
TEXTcolumn in thebankstable and defines agent identity and objectives. - The retain pipeline uses the mission to filter and phrase observations during memory ingestion.
- The reflect step consults the mission to ensure higher-level reasoning stays aligned with agent purpose.
- Mission updates flow through
set_bank_missioninbank_utils.py, while merges use_llm_merge_missionto enforce first-person output and 500-character limits. - Clients interact with missions via the
/banks/{bank_id}/missionendpoint and theclient.set_mission()Python SDK method.
Frequently Asked Questions
What format should a Hindsight bank mission statement follow?
The mission statement should be written in first-person perspective (e.g., "I am a...") and should clearly describe the agent's identity and objectives. While the system accepts free-form text, the LLM merge logic specifically enforces first-person output and recommends keeping the content under 500 characters for optimal processing.
How does the mission statement affect memory retention?
The mission drives the retain pipeline's decision-making process. When observations are ingested, the system uses the mission text as context to determine which facts are relevant enough to store and how they should be phrased for future retrieval. This ensures that only information aligned with the agent's purpose is preserved.
Can mission statements be updated dynamically?
Yes, missions can be updated at any time through the client.set_mission() method or the REST API endpoint /banks/{bank_id}/mission. For incremental updates, use the merge_bank_mission function, which uses an LLM to integrate new information while preserving the existing mission's intent and voice.
Is there a character limit for mission statements?
While the database stores the mission as a TEXT field capable of handling large strings, the mission merging logic enforces a 500-character limit during LLM-driven updates. This constraint ensures that missions remain concise and focused, preventing context window bloat during reflection and retention operations.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →