> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Manually Add Culture

> Manually add cultural knowledge to your Agents.

```python manually_add_culture.py theme={null}
"""
04 Manually Add Culture
=============================

Manually add cultural knowledge to your Agents.
"""

from agno.agent import Agent
from agno.culture.manager import CultureManager
from agno.db.schemas.culture import CulturalKnowledge
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIResponses
from rich.pretty import pprint

# ---------------------------------------------------------------------------
# Step 1. Initialize the database used for storing cultural knowledge
# ---------------------------------------------------------------------------
db = SqliteDb(db_file="tmp/demo.db")

# ---------------------------------------------------------------------------
# Step 2. Create the Culture Manager (no model needed for manual inserts)
# ---------------------------------------------------------------------------
culture_manager = CultureManager(db=db)

# ---------------------------------------------------------------------------
# Step 3. Manually add cultural knowledge
# ---------------------------------------------------------------------------
# Example: Response Format Standard (short and actionable)
response_format = CulturalKnowledge(
    name="Response Format Standard (Agno)",
    summary="Keep responses concise, scannable, and runnable-first where applicable.",
    categories=["communication", "ux"],
    content=(
        "- Lead with the minimal runnable snippet or example when possible.\n"
        "- Use numbered steps for procedures; keep each step testable.\n"
        "- Prefer metric units and explicit defaults (ports, paths, versions).\n"
        "- End with a short validation checklist."
    ),
    notes=["Derived from repeated feedback favoring actionable answers."],
    metadata={"source": "manual_seed", "version": 1},
)

# Persist the cultural knowledge
culture_manager.add_cultural_knowledge(response_format)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    # Optional: show what is stored
    print("\n=== Cultural Knowledge (Manual Add) ===")
    pprint(culture_manager.get_all_knowledge())

    # ---------------------------------------------------------------------------
    # Step 4. Initialize the Agent with cultural knowledge enabled
    # ---------------------------------------------------------------------------
    # The Agent will load shared cultural knowledge and include it in context.
    agent = Agent(
        db=db,
        model=OpenAIResponses(id="gpt-5.2"),
        add_culture_to_context=True,  # adds culture into the prompt context
        # update_cultural_knowledge=True,  # uncomment to let the agent update culture after runs
    )

    # (Optional) A/B without culture for contrast:
    # agent_no_culture = Agent(model=OpenAIResponses(id="gpt-5.2"))

    # ---------------------------------------------------------------------------
    # Step 5. Ask the Agent to generate a response that benefits from culture
    # ---------------------------------------------------------------------------
    print("\n=== With Culture ===\n")
    agent.print_response(
        "How do I set up a FastAPI service using Docker? ",
        stream=True,
        markdown=True,
    )

    # (Optional) Run without culture for contrast:
    # print("\n=== Without Culture ===\n")
    # agent_no_culture.print_response(
    #     "How do I set up a FastAPI service using Docker?",
    #     stream=True,
    #     markdown=True,
    # )
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno openai sqlalchemy
    ```
  </Step>

  <Step title="Export your OpenAI API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `manually_add_culture.py`, then run:

    ```bash theme={null}
    python manually_add_culture.py
    ```
  </Step>
</Steps>

Full source: [cookbook/02\_agents/14\_advanced/04\_manually\_add\_culture.py](https://github.com/agno-agi/agno/blob/main/cookbook/02_agents/14_advanced/04_manually_add_culture.py)
