Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions hindsight-clients/python/hindsight_client/hindsight_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def recall(
include_source_facts: bool = False,
max_source_facts_tokens: int = 4096,
tags: list[str] | None = None,
tags_match: Literal["any", "all", "any_strict", "all_strict"] = "any",
tags_match: Literal["any", "all", "any_strict", "all_strict", "exact"] = "any",
tag_groups: list[dict[str, Any]] | None = None,
) -> RecallResponse:
"""
Expand All @@ -406,7 +406,8 @@ def recall(
max_source_facts_tokens: Maximum tokens for source facts (default: 4096)
tags: Optional list of tags to filter memories by
tags_match: How to match tags - "any" (OR, includes untagged), "all" (AND, includes untagged),
"any_strict" (OR, excludes untagged), "all_strict" (AND, excludes untagged). Default: "any"
"any_strict" (OR, excludes untagged), "all_strict" (AND, excludes untagged),
"exact" (set equality, excludes untagged). Default: "any"
tag_groups: Optional list of tag group filters for advanced boolean tag matching.

Returns:
Expand Down Expand Up @@ -442,7 +443,7 @@ def reflect(
max_tokens: int | None = None,
response_schema: dict[str, Any] | None = None,
tags: list[str] | None = None,
tags_match: Literal["any", "all", "any_strict", "all_strict"] = "any",
tags_match: Literal["any", "all", "any_strict", "all_strict", "exact"] = "any",
include_facts: bool = False,
include_tool_calls: bool = False,
include_tool_call_output: bool = True,
Expand All @@ -465,7 +466,8 @@ def reflect(
response parsed according to this schema.
tags: Optional list of tags to filter memories by
tags_match: How to match tags - "any" (OR, includes untagged), "all" (AND, includes untagged),
"any_strict" (OR, excludes untagged), "all_strict" (AND, excludes untagged). Default: "any"
"any_strict" (OR, excludes untagged), "all_strict" (AND, excludes untagged),
"exact" (set equality, excludes untagged). Default: "any"
include_facts: If True, the response will include a 'based_on' field listing
the memories, mental models, and directives used to construct the answer.
include_tool_calls: If True, the response will include a 'trace' field with the
Expand Down Expand Up @@ -855,7 +857,7 @@ async def arecall(
include_source_facts: bool = False,
max_source_facts_tokens: int = 4096,
tags: list[str] | None = None,
tags_match: Literal["any", "all", "any_strict", "all_strict"] = "any",
tags_match: Literal["any", "all", "any_strict", "all_strict", "exact"] = "any",
tag_groups: list[dict[str, Any]] | None = None,
) -> RecallResponse:
"""
Expand All @@ -878,7 +880,8 @@ async def arecall(
max_source_facts_tokens: Maximum tokens for source facts (default: 4096)
tags: Optional list of tags to filter memories by
tags_match: How to match tags - "any" (OR, includes untagged), "all" (AND, includes untagged),
"any_strict" (OR, excludes untagged), "all_strict" (AND, excludes untagged). Default: "any"
"any_strict" (OR, excludes untagged), "all_strict" (AND, excludes untagged),
"exact" (set equality, excludes untagged). Default: "any"
tag_groups: Optional list of tag group filters for advanced boolean tag matching.
Each element is a dict representing a tag group node (TagGroupLeaf, TagGroupAnd,
TagGroupOr, or TagGroupNot). Example::
Expand Down Expand Up @@ -935,7 +938,7 @@ async def areflect(
max_tokens: int | None = None,
response_schema: dict[str, Any] | None = None,
tags: list[str] | None = None,
tags_match: Literal["any", "all", "any_strict", "all_strict"] = "any",
tags_match: Literal["any", "all", "any_strict", "all_strict", "exact"] = "any",
include_facts: bool = False,
include_tool_calls: bool = False,
include_tool_call_output: bool = True,
Expand All @@ -958,7 +961,8 @@ async def areflect(
response parsed according to this schema.
tags: Optional list of tags to filter memories by
tags_match: How to match tags - "any" (OR, includes untagged), "all" (AND, includes untagged),
"any_strict" (OR, excludes untagged), "all_strict" (AND, excludes untagged). Default: "any"
"any_strict" (OR, excludes untagged), "all_strict" (AND, excludes untagged),
"exact" (set equality, excludes untagged). Default: "any"
include_facts: If True, the response will include a 'based_on' field listing
the memories, mental models, and directives used to construct the answer.
include_tool_calls: If True, the response will include a 'trace' field with the
Expand Down
8 changes: 4 additions & 4 deletions hindsight-clients/typescript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ export class HindsightClient {
maxSourceFactsTokens?: number;
/** Optional list of tags to filter memories by */
tags?: string[];
/** How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged). Default: 'any' */
tagsMatch?: "any" | "all" | "any_strict" | "all_strict";
/** How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged), 'exact' (set equality, excludes untagged). Default: 'any' */
tagsMatch?: "any" | "all" | "any_strict" | "all_strict" | "exact";
/** Compound tag filter using boolean groups. Groups are AND-ed. Each group is a leaf {tags, match} or compound {and: [...]}, {or: [...]}, {not: ...}. Mutually exclusive with tags/tagsMatch. */
tagGroups?: Array<TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput>;
signal?: AbortSignal;
Expand Down Expand Up @@ -370,8 +370,8 @@ export class HindsightClient {
budget?: Budget;
/** Optional list of tags to filter memories by */
tags?: string[];
/** How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged). Default: 'any' */
tagsMatch?: "any" | "all" | "any_strict" | "all_strict";
/** How to match tags: 'any' (OR, includes untagged), 'all' (AND, includes untagged), 'any_strict' (OR, excludes untagged), 'all_strict' (AND, excludes untagged), 'exact' (set equality, excludes untagged). Default: 'any' */
tagsMatch?: "any" | "all" | "any_strict" | "all_strict" | "exact";
/** Compound tag filter using boolean groups. Groups are AND-ed. Mutually exclusive with tags/tagsMatch. */
tagGroups?: Array<TagGroupLeaf | TagGroupAndInput | TagGroupOrInput | TagGroupNotInput>;
/** Optional JSON Schema for structured output. When provided, the response includes a 'structured_output' field. */
Expand Down
2 changes: 2 additions & 0 deletions hindsight-control-plane/src/components/mental-models-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,7 @@ function CreateMentalModelDialog({
<SelectItem value="all">{t("optionsTagsMatchAll")}</SelectItem>
<SelectItem value="any_strict">{t("optionsTagsMatchAnyStrict")}</SelectItem>
<SelectItem value="all_strict">{t("optionsTagsMatchAllStrict")}</SelectItem>
<SelectItem value="exact">{t("optionsTagsMatchExact")}</SelectItem>
</SelectContent>
</Select>
<p className="text-xs text-muted-foreground">
Expand Down Expand Up @@ -1366,6 +1367,7 @@ function UpdateMentalModelDialog({
<SelectItem value="all">{t("optionsTagsMatchAll")}</SelectItem>
<SelectItem value="any_strict">{t("optionsTagsMatchAnyStrict")}</SelectItem>
<SelectItem value="all_strict">{t("optionsTagsMatchAllStrict")}</SelectItem>
<SelectItem value="exact">{t("optionsTagsMatchExact")}</SelectItem>
</SelectContent>
</Select>
<p className="text-xs text-muted-foreground">
Expand Down
3 changes: 2 additions & 1 deletion hindsight-control-plane/src/components/search-debug-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import "react18-json-view/src/style.css";
import { MemoryDetailPanel } from "./memory-detail-panel";

type Budget = "low" | "mid" | "high";
type TagsMatch = "any" | "all" | "any_strict" | "all_strict";
type TagsMatch = "any" | "all" | "any_strict" | "all_strict" | "exact";
type ViewMode = "results" | "trace" | "json";

export function SearchDebugView() {
Expand Down Expand Up @@ -277,6 +277,7 @@ export function SearchDebugView() {
<SelectItem value="all">{t("tagsMatchAll")}</SelectItem>
<SelectItem value="any_strict">{t("tagsMatchAnyStrict")}</SelectItem>
<SelectItem value="all_strict">{t("tagsMatchAllStrict")}</SelectItem>
<SelectItem value="exact">{t("tagsMatchExact")}</SelectItem>
</SelectContent>
</Select>
</div>
Expand Down
3 changes: 2 additions & 1 deletion hindsight-control-plane/src/components/think-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { MentalModelDetailModal } from "./mental-model-detail-modal";
import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm";

type TagsMatch = "any" | "all" | "any_strict" | "all_strict";
type TagsMatch = "any" | "all" | "any_strict" | "all_strict" | "exact";
type ViewMode = "answer" | "trace" | "json";
type BasedOnTab = "directives" | "mental_models" | "observations" | "world" | "experience";

Expand Down Expand Up @@ -286,6 +286,7 @@ export function ThinkView() {
<SelectItem value="all">{t("tagsMatchAll")}</SelectItem>
<SelectItem value="any_strict">{t("tagsMatchAnyStrict")}</SelectItem>
<SelectItem value="all_strict">{t("tagsMatchAllStrict")}</SelectItem>
<SelectItem value="exact">{t("tagsMatchExact")}</SelectItem>
</SelectContent>
</Select>
</div>
Expand Down
6 changes: 3 additions & 3 deletions hindsight-control-plane/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export interface OperationProgress {
detail?: Record<string, number> | null;
}

export type TagsMatch = "any" | "all" | "any_strict" | "all_strict";
export type TagsMatch = "any" | "all" | "any_strict" | "all_strict" | "exact";

export type TagGroup =
| { tags: string[]; match?: TagsMatch }
Expand Down Expand Up @@ -354,7 +354,7 @@ export class ControlPlaneClient {
};
query_timestamp?: string;
tags?: string[];
tags_match?: "any" | "all" | "any_strict" | "all_strict";
tags_match?: "any" | "all" | "any_strict" | "all_strict" | "exact";
}) {
return this.fetchApi("/api/recall", {
method: "POST",
Expand All @@ -373,7 +373,7 @@ export class ControlPlaneClient {
include_facts?: boolean;
include_tool_calls?: boolean;
tags?: string[];
tags_match?: "any" | "all" | "any_strict" | "all_strict";
tags_match?: "any" | "all" | "any_strict" | "all_strict" | "exact";
fact_types?: Array<"world" | "experience" | "observation">;
exclude_mental_models?: boolean;
exclude_mental_model_ids?: string[];
Expand Down
3 changes: 3 additions & 0 deletions hindsight-control-plane/src/messages/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@
"optionsTagsMatchAll": "all — UND-Abgleich, schließt Einträge ohne Tags ein",
"optionsTagsMatchAnyStrict": "any_strict — ODER-Abgleich, schließt Einträge ohne Tags aus",
"optionsTagsMatchAllStrict": "all_strict — UND-Abgleich, schließt Einträge ohne Tags aus",
"optionsTagsMatchExact": "exact — Mengengleichheit, schließt Einträge ohne Tags aus",
"optionsTagsMatchDescription": "Steuert, wie die Tags des Modells Erinnerungen während der Aktualisierung filtern.",
"optionsTagGroupsLabel": "Tag-Gruppen (JSON)",
"optionsTagGroupsDescription": "Zusammengesetzte boolesche Tag-Ausdrücke zur Filterung bei der Aktualisierung. Überschreibt flache Tags, wenn gesetzt.",
Expand Down Expand Up @@ -839,6 +840,7 @@
"tagsMatchAll": "Alle (inkl. ohne Tags)",
"tagsMatchAnyStrict": "Beliebig (strikt)",
"tagsMatchAllStrict": "Alle (strikt)",
"tagsMatchExact": "Exakt (Mengengleich)",
"excludeMentalModels": "Mentale Modelle ausschließen",
"excludeIdsLabel": "IDs ausschließen:",
"excludeIdsPlaceholder": "modell-a, modell-b",
Expand Down Expand Up @@ -915,6 +917,7 @@
"tagsMatchAll": "Alle (inkl. ohne Tags)",
"tagsMatchAnyStrict": "Beliebig (strikt)",
"tagsMatchAllStrict": "Alle (strikt)",
"tagsMatchExact": "Exakt (Mengengleich)",
"budgetLow": "Niedrig",
"budgetMid": "Mittel",
"budgetHigh": "Hoch",
Expand Down
3 changes: 3 additions & 0 deletions hindsight-control-plane/src/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@
"optionsTagsMatchAll": "all — AND matching, includes untagged",
"optionsTagsMatchAnyStrict": "any_strict — OR matching, excludes untagged",
"optionsTagsMatchAllStrict": "all_strict — AND matching, excludes untagged",
"optionsTagsMatchExact": "exact — set equality, excludes untagged",
"optionsTagsMatchDescription": "Controls how the model's tags filter memories during refresh.",
"optionsTagGroupsLabel": "Tag Groups (JSON)",
"optionsTagGroupsDescription": "Compound boolean tag expressions for refresh filtering. Overrides flat tags when set.",
Expand Down Expand Up @@ -839,6 +840,7 @@
"tagsMatchAll": "All (incl. untagged)",
"tagsMatchAnyStrict": "Any (strict)",
"tagsMatchAllStrict": "All (strict)",
"tagsMatchExact": "Exact (set match)",
"excludeMentalModels": "Exclude mental models",
"excludeIdsLabel": "Exclude IDs:",
"excludeIdsPlaceholder": "model-a, model-b",
Expand Down Expand Up @@ -915,6 +917,7 @@
"tagsMatchAll": "All (incl. untagged)",
"tagsMatchAnyStrict": "Any (strict)",
"tagsMatchAllStrict": "All (strict)",
"tagsMatchExact": "Exact (set match)",
"budgetLow": "Low",
"budgetMid": "Mid",
"budgetHigh": "High",
Expand Down
3 changes: 3 additions & 0 deletions hindsight-control-plane/src/messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@
"optionsTagsMatchAll": "all — coincidencia AND, incluye sin etiqueta",
"optionsTagsMatchAnyStrict": "any_strict — coincidencia OR, excluye sin etiqueta",
"optionsTagsMatchAllStrict": "all_strict — coincidencia AND, excluye sin etiqueta",
"optionsTagsMatchExact": "exact — igualdad de conjuntos, excluye sin etiqueta",
"optionsTagsMatchDescription": "Controla cómo las etiquetas del modelo filtran las memorias durante la actualización.",
"optionsTagGroupsLabel": "Grupos de etiquetas (JSON)",
"optionsTagGroupsDescription": "Expresiones booleanas compuestas de etiquetas para filtrar durante la actualización. Anula las etiquetas planas cuando está configurado.",
Expand Down Expand Up @@ -839,6 +840,7 @@
"tagsMatchAll": "Todas (incl. sin etiqueta)",
"tagsMatchAnyStrict": "Cualquiera (estricto)",
"tagsMatchAllStrict": "Todas (estricto)",
"tagsMatchExact": "Exacto (conjunto)",
"excludeMentalModels": "Excluir modelos mentales",
"excludeIdsLabel": "Excluir IDs:",
"excludeIdsPlaceholder": "modelo-a, modelo-b",
Expand Down Expand Up @@ -915,6 +917,7 @@
"tagsMatchAll": "Todas (incl. sin etiqueta)",
"tagsMatchAnyStrict": "Cualquiera (estricto)",
"tagsMatchAllStrict": "Todas (estricto)",
"tagsMatchExact": "Exacto (conjunto)",
"budgetLow": "Bajo",
"budgetMid": "Medio",
"budgetHigh": "Alto",
Expand Down
3 changes: 3 additions & 0 deletions hindsight-control-plane/src/messages/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@
"optionsTagsMatchAll": "all — correspondance ET, inclut non taggés",
"optionsTagsMatchAnyStrict": "any_strict — correspondance OU, exclut non taggés",
"optionsTagsMatchAllStrict": "all_strict — correspondance ET, exclut non taggés",
"optionsTagsMatchExact": "exact — égalité d'ensembles, exclut non taggés",
"optionsTagsMatchDescription": "Contrôle la façon dont les tags du modèle filtrent les souvenirs lors de l'actualisation.",
"optionsTagGroupsLabel": "Groupes de tags (JSON)",
"optionsTagGroupsDescription": "Expressions booléennes composées de tags pour le filtrage lors de l'actualisation. Remplace les tags plats lorsque défini.",
Expand Down Expand Up @@ -839,6 +840,7 @@
"tagsMatchAll": "Tous (incl. non taggés)",
"tagsMatchAnyStrict": "N'importe lequel (strict)",
"tagsMatchAllStrict": "Tous (strict)",
"tagsMatchExact": "Exact (ensemble)",
"excludeMentalModels": "Exclure les modèles mentaux",
"excludeIdsLabel": "Exclure les IDs :",
"excludeIdsPlaceholder": "modèle-a, modèle-b",
Expand Down Expand Up @@ -915,6 +917,7 @@
"tagsMatchAll": "Tous (incl. non taggés)",
"tagsMatchAnyStrict": "N'importe lequel (strict)",
"tagsMatchAllStrict": "Tous (strict)",
"tagsMatchExact": "Exact (ensemble)",
"budgetLow": "Faible",
"budgetMid": "Moyen",
"budgetHigh": "Élevé",
Expand Down
3 changes: 3 additions & 0 deletions hindsight-control-plane/src/messages/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@
"optionsTagsMatchAll": "all — AND一致、タグなし含む",
"optionsTagsMatchAnyStrict": "any_strict — OR一致、タグなし除く",
"optionsTagsMatchAllStrict": "all_strict — AND一致、タグなし除く",
"optionsTagsMatchExact": "exact — 集合一致、タグなし除く",
"optionsTagsMatchDescription": "更新中にモデルのタグがメモリをフィルタリングする方法を制御します。",
"optionsTagGroupsLabel": "タググループ(JSON)",
"optionsTagGroupsDescription": "更新フィルタリング用の複合ブール型タグ式。設定された場合、フラットタグより優先されます。",
Expand Down Expand Up @@ -839,6 +840,7 @@
"tagsMatchAll": "すべて(タグなし含む)",
"tagsMatchAnyStrict": "いずれか(厳密)",
"tagsMatchAllStrict": "すべて(厳密)",
"tagsMatchExact": "完全一致(集合)",
"excludeMentalModels": "メンタルモデルを除外",
"excludeIdsLabel": "IDを除外:",
"excludeIdsPlaceholder": "model-a, model-b",
Expand Down Expand Up @@ -915,6 +917,7 @@
"tagsMatchAll": "すべて(タグなし含む)",
"tagsMatchAnyStrict": "いずれか(厳密)",
"tagsMatchAllStrict": "すべて(厳密)",
"tagsMatchExact": "完全一致(集合)",
"budgetLow": "低",
"budgetMid": "中",
"budgetHigh": "高",
Expand Down
3 changes: 3 additions & 0 deletions hindsight-control-plane/src/messages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@
"optionsTagsMatchAll": "all — AND 일치, 태그 없는 항목 포함",
"optionsTagsMatchAnyStrict": "any_strict — OR 일치, 태그 없는 항목 제외",
"optionsTagsMatchAllStrict": "all_strict — AND 일치, 태그 없는 항목 제외",
"optionsTagsMatchExact": "exact — 집합 일치, 태그 없는 항목 제외",
"optionsTagsMatchDescription": "새로고침 중에 모델의 태그가 메모리를 필터링하는 방식을 제어합니다.",
"optionsTagGroupsLabel": "태그 그룹 (JSON)",
"optionsTagGroupsDescription": "새로고침 필터링을 위한 복합 불리언 태그 표현식. 설정 시 단순 태그를 재정의합니다.",
Expand Down Expand Up @@ -839,6 +840,7 @@
"tagsMatchAll": "전체 (태그 없는 항목 포함)",
"tagsMatchAnyStrict": "모두 (엄격)",
"tagsMatchAllStrict": "전체 (엄격)",
"tagsMatchExact": "정확 (집합 일치)",
"excludeMentalModels": "멘탈 모델 제외",
"excludeIdsLabel": "ID 제외:",
"excludeIdsPlaceholder": "model-a, model-b",
Expand Down Expand Up @@ -915,6 +917,7 @@
"tagsMatchAll": "전체 (태그 없는 항목 포함)",
"tagsMatchAnyStrict": "모두 (엄격)",
"tagsMatchAllStrict": "전체 (엄격)",
"tagsMatchExact": "정확 (집합 일치)",
"budgetLow": "낮음",
"budgetMid": "중간",
"budgetHigh": "높음",
Expand Down
3 changes: 3 additions & 0 deletions hindsight-control-plane/src/messages/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,7 @@
"optionsTagsMatchAll": "all — correspondência E, inclui sem tag",
"optionsTagsMatchAnyStrict": "any_strict — correspondência OU, exclui sem tag",
"optionsTagsMatchAllStrict": "all_strict — correspondência E, exclui sem tag",
"optionsTagsMatchExact": "exact — igualdade de conjuntos, exclui sem tag",
"optionsTagsMatchDescription": "Controla como as tags do modelo filtram as memórias durante a atualização.",
"optionsTagGroupsLabel": "Grupos de Tags (JSON)",
"optionsTagGroupsDescription": "Expressões booleanas compostas de tags para filtragem na atualização. Substitui as tags simples quando definido.",
Expand Down Expand Up @@ -839,6 +840,7 @@
"tagsMatchAll": "Todos (incl. sem tag)",
"tagsMatchAnyStrict": "Qualquer (estrito)",
"tagsMatchAllStrict": "Todos (estrito)",
"tagsMatchExact": "Exato (conjunto)",
"excludeMentalModels": "Excluir modelos mentais",
"excludeIdsLabel": "Excluir IDs:",
"excludeIdsPlaceholder": "modelo-a, modelo-b",
Expand Down Expand Up @@ -915,6 +917,7 @@
"tagsMatchAll": "Todos (incl. sem tag)",
"tagsMatchAnyStrict": "Qualquer (estrito)",
"tagsMatchAllStrict": "Todos (estrito)",
"tagsMatchExact": "Exato (conjunto)",
"budgetLow": "Baixo",
"budgetMid": "Médio",
"budgetHigh": "Alto",
Expand Down
Loading