Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@manuhortet
Copy link
Contributor

@manuhortet manuhortet commented Oct 20, 2025

Changes:

  • Introduces a Culture Manager to define and manage the cultural context within your Agents.
  • Related cookbooks showing usage


return await self.db.get_cultural_knowledge(id=id)

def get_all_knowledge(self, name: Optional[str] = None) -> Optional[List[CulturalKnowledge]]:
Copy link
Contributor

Choose a reason for hiding this comment

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

get_knowledge and get_all_knowledge can be combined with optional filters for id and name?
Btw why is name here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • Can be combined. We should do the same for Memory.
  • Name is there as potential filter

Comment on lines +179 to +180
message: Optional[str] = None,
messages: Optional[List[Message]] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this actually a good pattern? It made sense when we had message and messages, but should it not just be str for our experiment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

message is used when we generate the item given the user message, messages when it's based on a conversation --- it could totally be just messages here. Would need refactor in the agent logic

We should also adjust for both memory and culture



@dataclass
class CultureManager:
Copy link
Contributor

Choose a reason for hiding this comment

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

wdyt about a base class, and then we have CultureManager and AsyncCultureManager with the same functions, but one is sync and other is async?

Copy link
Contributor

Choose a reason for hiding this comment

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

In general I think that is a better pattern for these kinds of classes (we should do memory like that as well I think)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah good - we actually just introduced that pattern with the async dbs. It is cleaner.

We should also adjust for both memory and culture


return response

def update_culture_task(self, task: str) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the difference really with the above? Could they be the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These orchestrate generation of the learning, the other ones are to persist the generated learning I think. The pattern comes from the MemoryManager too. Combining both would simplify usage from the Agent if I'm understanding the setup

We should adjust for both memory and culture

return Message(role="system", content=self.system_message)

# Default capture instructions
culture_capture_instructions = self.culture_capture_instructions or dedent(
Copy link
Contributor

Choose a reason for hiding this comment

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

Only such a small part is configurable... but this is fine for now

@manuhortet manuhortet merged commit 12fb566 into main Oct 21, 2025
5 checks passed
@manuhortet manuhortet deleted the feat/culture branch October 21, 2025 14:27
Mustafa-Esoofally pushed a commit that referenced this pull request Oct 23, 2025
Changes:

- Introduces a Culture Manager to define and manage the cultural context
within your Agents.
- Related cookbooks showing usage

---------

Co-authored-by: Ashpreet <[email protected]>
Co-authored-by: Yash Pratap Solanky <[email protected]>
Co-authored-by: ysolanky <[email protected]>
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.

4 participants