Skip to content

Conversation

@wsimmonds
Copy link
Contributor

Addresses #55

Introduce effective_date
Instead of using just occurred_start for display/ordering I've introduced an effective_date property to object in the withDates array: This will be occurred_start if present but otherwise will fallback to mentioned_at (or null if not set).

Sort order
It now sorts by effective_date in descending order, which seems to be consistent with the query on the api:

units = await conn.fetch(
f"""
SELECT id, text, event_date, context, fact_type, mentioned_at, occurred_start, occurred_end, chunk_id
FROM memory_units
{where_clause}
ORDER BY mentioned_at DESC NULLS LAST, created_at DESC
LIMIT {limit_param} OFFSET {offset_param}
""",
*query_params,
)

Testing
I've tested this manually with a memory bank of mine, verifying that opinions which previously were hidden now show and are ordered correctly.

…tioned_at for experiences and opinions which were previously hidden due to lacking occurred_start that facts have.
Copy link
Collaborator

@nicoloboschi nicoloboschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to a UI control (a switch) that let the user see mentioned vs occurred

I think using a effective date might be confusing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants