Skip to main content
A chief of staff remembers what was decided, who committed to what, and what has changed since. This cookbook builds one from two types of context: meetings and email as knowledge, and the decisions drawn from them as memories that HydraDB keeps current. No benchmark tests a chief of staff end to end. BEAM 1M tests the memory underneath it.

Prerequisites

  • A HydraDB API key from dashboard.hydradb.com, set as HYDRADB_API_KEY.
  • An OpenAI API key, set as OPENAI_API_KEY. HydraDB returns context, not answers, so any model works; swap the answer function below for your own.
  • Python 3.10 or later, with the SDKs: pip install "hydradb-sdk>=2.1.7,<3" openai.
Save this as hydra.py. Every cookbook imports it. It holds what every HydraDB application does around its own logic: wait for the database, check what an ingest accepted, wait for indexing, and pass query results to a model.
hydra.py

1. Create a database with two collections

Work records go in one collection. The executive’s own decisions and commitments go in another, so they can be queried alone or together with the records.
chief_of_staff.py

2. Ingest meetings and email as knowledge

Meetings and email are app sources. The meeting and email kinds keep participants, senders, and dates, which is what lets a query answer “what did Priya agree to on the September call”.
chief_of_staff.py

3. Save decisions as memories

After each meeting or thread, save what was decided as a memory. With infer: true, HydraDB extracts the facts and checks them against what the collection already holds, so the October change to the launch date is reconciled with the September decision instead of sitting beside it.
chief_of_staff.py

4. Ask what is current

Query both collections at once with type: "all". recency_bias favors newer context, and thinking mode reranks, so the current launch date ranks above the one it replaced.
chief_of_staff.py

Run it

The answer should give November 17, note that the date moved from November 3, and list Priya’s data residency review as the open commitment.

Use real data

Connect the calendar, meeting, and email apps with connectors in place of step 2. Keep step 3 in your application: decide what counts as a decision, and save it when the meeting ends.

Common mistakes

  • Saving decisions as knowledge only: a transcript records what was said. A memory records what is true now. Save both.
  • Querying one collection: a query that names only RECORDS does not read the memories. Use collections with both names.
  • Leaving dates out of memories: write the date into the memory text. It is what lets a later change supersede an earlier one.

Next steps