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

# Image analysis with memory example using CometAPI

> Analyze an image with CometAPI and recall it later from SQLite session history.

```python image_agent_with_memory.py theme={null}
"""
Image analysis with memory example using CometAPI.
"""

from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.media import Image
from agno.models.cometapi import CometAPI

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

agent = Agent(
    model=CometAPI(id="gpt-5.6-luna"),  # gpt-5.6-luna has vision capabilities
    db=SqliteDb(db_file="tmp/cometapi_image_agent.db"),
    session_id="cometapi_image_session",
    markdown=True,
)

# First interaction with an image
agent.print_response(
    "Look at this image and remember what you see. Describe the character in detail.",
    images=[
        Image(
            url="https://httpbin.org/image/png"  # Reliable test image
        )
    ],
)

print("\n" + "=" * 50 + "\n")

# Follow-up question using memory
agent.print_response(
    "What was the main color of the character in the image I showed you earlier?"
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass
```

## Run the Example

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

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno openai sqlalchemy
```

**2. Export environment variables**

```bash Mac/Linux theme={null}
export COMETAPI_KEY="your_cometapi_key_here"
```

```bash Windows theme={null}
$Env:COMETAPI_KEY="your_cometapi_key_here"
```

**3. Run the example**

Save the code above as `image_agent_with_memory.py`, then run:

```bash theme={null}
python image_agent_with_memory.py
```

Full source: [cookbook/90\_models/cometapi/image\_agent\_with\_memory.py](https://github.com/agno-agi/agno/blob/v3.0.4/cookbook/90_models/cometapi/image_agent_with_memory.py)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.