1from kern.agent import Agent
2from kern.db.sqlite import SqliteDb
3from kern.models.google import GeminiInteractions
4
5agent = Agent(
6 model=GeminiInteractions(id="gemini-3-flash-preview"),
7 add_history_to_context=True,
8 db=SqliteDb(db_file="tmp/data.db"),
9 markdown=True,
10)
11
12if __name__ == "__main__":
13 # First turn - establishes the interaction
14 agent.print_response("My name is Alice and I love hiking in the mountains.")
15
16 # Second turn - references the previous interaction for context
17 agent.print_response("What did I just tell you about myself?")
18
19 # Third turn - continues the conversation chain
20 agent.print_response(
21 "Suggest a hiking destination based on what you know about me."
22 )