Skip to content

API Reference parrot.tools.working_memory.tests.test_answer_memory_bridge

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.tools.working_memory.tests.test_answer_memory_bridge

View source

Tests for the AnswerMemory bridge in WorkingMemoryToolkit.

Covers:

  • save_interaction() with / without AnswerMemory
  • recall_interaction() by exact turn_id
  • recall_interaction() by query (fuzzy/substring)
  • recall_interaction() with import_as
  • recall_interaction() validation (neither turn_id nor query)
  • BasicAgent auto-injection of answer_memory

Alias AnswerMemory

Re-exported from parrot.memory.AnswerMemory.

Alias EntryType

Re-exported from parrot.tools.working_memory.EntryType.

Alias GenericEntry

Re-exported from parrot.tools.working_memory.GenericEntry.

Class TestAutoInjection

BasicAgent._inject_answer_memory_into_toolkits auto-wires answer_memory.

Method TestAutoInjection.test_toolkit_starts_with_no_memory

test_toolkit_starts_with_no_memory()

Method TestAutoInjection.test_explicit_wiring_preserved

test_explicit_wiring_preserved()

Method TestAutoInjection.test_auto_inject_sets_memory

test_auto_inject_sets_memory()

Method TestAutoInjection.test_auto_inject_no_overwrite

test_auto_inject_no_overwrite()

Class TestRecallByQuery

recall_interaction() with substring query lookup.

Method TestRecallByQuery.test_recall_by_query

test_recall_by_query(toolkit_with_memory, answer_memory)

Parameter Type Default Description
toolkit_with_memory
answer_memory

Method TestRecallByQuery.test_recall_by_query_case_insensitive

test_recall_by_query_case_insensitive(toolkit_with_memory, answer_memory)

Parameter Type Default Description
toolkit_with_memory
answer_memory

Method TestRecallByQuery.test_recall_by_query_most_recent

test_recall_by_query_most_recent(toolkit_with_memory, answer_memory)

Parameter Type Default Description
toolkit_with_memory
answer_memory

Method TestRecallByQuery.test_recall_by_query_no_match

test_recall_by_query_no_match(toolkit_with_memory, answer_memory)

Parameter Type Default Description
toolkit_with_memory
answer_memory

Method TestRecallByQuery.test_recall_by_query_no_memory

test_recall_by_query_no_memory()

Method TestRecallByQuery.test_recall_by_query_with_import

test_recall_by_query_with_import(toolkit_with_memory, answer_memory)

Parameter Type Default Description
toolkit_with_memory
answer_memory

Class TestRecallByTurnId

recall_interaction() with exact turn_id lookup.

Method TestRecallByTurnId.test_recall_existing

test_recall_existing(toolkit_with_memory, answer_memory)

Parameter Type Default Description
toolkit_with_memory
answer_memory

Method TestRecallByTurnId.test_recall_not_found

test_recall_not_found(toolkit_with_memory)

Parameter Type Default Description
toolkit_with_memory

Method TestRecallByTurnId.test_recall_no_memory

test_recall_no_memory()

Method TestRecallByTurnId.test_recall_and_import

test_recall_and_import(toolkit_with_memory, answer_memory)

Parameter Type Default Description
toolkit_with_memory
answer_memory

Method TestRecallByTurnId.test_recall_without_import_as

test_recall_without_import_as(toolkit_with_memory, answer_memory)

Parameter Type Default Description
toolkit_with_memory
answer_memory

Class TestRecallValidation

recall_interaction() must require at least one of turn_id or query.

Method TestRecallValidation.test_neither_turn_id_nor_query_returns_error

test_neither_turn_id_nor_query_returns_error(toolkit_with_memory)

Parameter Type Default Description
toolkit_with_memory

Class TestSaveInteraction

save_interaction() tool method.

Method TestSaveInteraction.test_save_stores_in_answer_memory

test_save_stores_in_answer_memory(toolkit_with_memory, answer_memory)

Parameter Type Default Description
toolkit_with_memory
answer_memory

Method TestSaveInteraction.test_save_no_memory_returns_error

test_save_no_memory_returns_error()

Alias WorkingMemoryToolkit

Re-exported from parrot.tools.working_memory.WorkingMemoryToolkit.

Attribute pytestmark

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally