From 4a2fc672372723b56cbf7f6513b9ac612fe6c9e4 Mon Sep 17 00:00:00 2001 From: Milo Gu Date: Wed, 4 Feb 2026 22:08:55 +0800 Subject: [PATCH] fix: ollama db content duplicate with agent storage so remove --- docs.json | 1 - models/providers/local/ollama/usage/db.mdx | 53 ---------------------- 2 files changed, 54 deletions(-) delete mode 100644 models/providers/local/ollama/usage/db.mdx diff --git a/docs.json b/docs.json index 8b965f986..4f27b9fa1 100644 --- a/docs.json +++ b/docs.json @@ -1181,7 +1181,6 @@ "models/providers/local/ollama/usage/async-basic-stream", "models/providers/local/ollama/usage/tool-use", "models/providers/local/ollama/usage/tool-use-stream", - "models/providers/local/ollama/usage/db", "models/providers/local/ollama/usage/knowledge", "models/providers/local/ollama/usage/memory", "models/providers/local/ollama/usage/demo-deepseek-r1", diff --git a/models/providers/local/ollama/usage/db.mdx b/models/providers/local/ollama/usage/db.mdx deleted file mode 100644 index 8cc098d9b..000000000 --- a/models/providers/local/ollama/usage/db.mdx +++ /dev/null @@ -1,53 +0,0 @@ ---- -title: Db ---- - -## Code - -```python cookbook/11_models/ollama/db.py -"""Run `uv pip install sqlalchemy ollama` to install dependencies.""" - -from agno.agent import Agent -from agno.db.postgres import PostgresDb -from agno.models.ollama import Ollama -from agno.tools.hackernews import HackerNewsTools - -# Setup the database -db_url = "postgresql+psycopg://ai:ai@localhost:5532/ai" -db = PostgresDb(db_url=db_url) - -agent = Agent( - model=Ollama(id="llama3.1:8b"), - db=db, - tools=[HackerNewsTools()], - add_history_to_context=True, -) -agent.print_response("How many people live in Canada?") -agent.print_response("What is their national anthem called?") - -``` - -## Usage - - - - - - Follow the [Ollama installation guide](https://github.com/ollama/ollama?tab=readme-ov-file#macos) and run: - ```bash - ollama pull llama3.1:8b - ``` - - - - ```bash - uv pip install -U ollama agno - ``` - - - - ```bash - python cookbook/11_models/ollama/db.py - ``` - -