new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

LangChain & LangGraph · all subjects

memory/procedural

3 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Procedural memory modification via reflection

Procedural memory for agents is modified through reflection or meta-prompting. This involves prompting the agent with its current system prompt along with recent conversations or explicit user feedback. The agent then refines its own instructions based on this input. This approach is particularly useful for tasks where instructions are challenging to specify upfront, allowing the agent to learn and adapt from interactions.

Procedural memory update implementation pattern

This example demonstrates how to implement procedural memory updates using LangGraph's memory store with a call_model node that uses stored instructions and an update_instructions node that modifies them: ```python # Node that *uses* the instructions def call_model(state: State, store: BaseStore): namespace = ("agent_instructions", ) instructions = store.get(namespace, key="agent_a")[0] prompt = prompt_template.format(instructions=instructions.value["instructions"]) # Application logic ... # Node that updates instructions def update_instructions(state: State, store: BaseStore): namespace = ("instructions",) instructions = store.search(namespace)[0] prompt = prompt_template.format(instructions=instructions.value["instructions"], conversation=state["messages"]) output = llm.invoke(prompt) new_instructions = output['new_instructions'] store.put(("agent_instructions",), "agent_a", {"instructions": new_instructions}) ```

Procedural memory update implementation pattern TypeScript

This example demonstrates how to implement procedural memory updates using LangGraph's memory store in TypeScript with a callModel node that uses stored instructions and an updateInstructions node that modifies them: ```typescript // Node that *uses* the instructions const callModel = async (state: State, store: BaseStore) => { const namespace = ["agent_instructions"]; const instructions = await store.get(namespace, "agent_a"); const prompt = promptTemplate.format({ instructions: instructions[0].value.instructions }); // Application logic // ... }; // Node that updates instructions const updateInstructions = async (state: State, store: BaseStore) => { const namespace = ["instructions"]; const currentInstructions = await store.search(namespace); const prompt = promptTemplate.format({ instructions: currentInstructions[0].value.instructions, conversation: state.messages }); const output = await llm.invoke(prompt); const newInstructions = output.new_instructions; await store.put(["agent_instructions"], "agent_a", { instructions: newInstructions }); }; ```

Give your agent this brain