A Python multimodal agent for interacting with Gemini models via text, images, and CLI.
Project description
Multimodal-Agent
A lightweight, production-ready multimodal wrapper for Google Gemini โ with RAG memory, session-based chat, embeddings, retry logic, and a clean CLI.
Features (v0.2.7)
Core
-
๐น RAG Memory (SQLite vector store, embedding retrieval)
-
๐น Session-based chat (
agent chat --session <id>) -
๐น Cross-session RAG retrieval
-
๐น History management CLI
(
show / delete / clear / summary) -
๐น Text + Image multimodal generation
Engine
- ๐น Token-safe chunking (sentence-aware, fallback for long text)
- ๐น Exponential backoff retry logic
- ๐น Custom exception hierarchy
- ๐น Production logging
- ๐น Extensible & test-covered architecture
Tooling
- ๐น Minimal CLI:
agent - ๐น 94% unit test coverage
Installation
From PyPI (recommended)
From source
Requirements
- Python 3.9+
GOOGLE_API_KEYset in.envfile:
Dependencies (google-genai, google-adk) are installed automatically.
CLI Usage
Ask a question
Ask about an image
Interactive chat (stateful)
Chat with a custom session
Each session stores its own memory and embeddings.
RAG Memory (0.2.6+)
Multimodal-Agent now includes a Retrieval-Augmented Generation (RAG) engine powered by an internal SQLite vector store.
What RAG does:
- Stores all user and assistant messages in a database
- Splits large messages into normalized chunks before embedding (0.2.7+)
- Generates embeddings for each chunk
- Retrieves the most relevant past chunks during answers
- Uses both current session and cross-session memory
- Improves contextual accuracy
Disable RAG:
Chunk Tokenization (0.2.7+)
Multimodal-Agent now includes a robust token-safe chunking engine to improve embedding quality and RAG retrieval.
What this adds:
- Sentence-aware splitting (
split_into_chunks) - Paragraph + sentence windowing (
chunk_text) - Safe handling of long unbroken strings
- Ensures embeddings stay within expected token limits
- More consistent similarity search results
Tokenization happens automatically whenever text is added to the RAG store.
History Commands (RAG-backed)
Show recent stored chunks
Show history for a specific session
Delete a specific chunk
Clear the entire database
Summarize all history using the LLM
Python API
Text
Image + text
Chunking Utilities (0.2.7+)
Project Structure
Tests
Coverage is enforced in CI.
Roadmap
- RAG Memory (0.2.6)
- Token-safe chunking (0.2.7)
- Token usage logging
- Async agent (
AsyncMultiModalAgent) - Plugin system (tools, external modules)
- Flutter extension (planned)
- IDE extensions (later)
- Streaming support
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file multimodal_agent-0.2.8.tar.gz.
File metadata
- Download URL: multimodal_agent-0.2.8.tar.gz
- Upload date:
- Size: 27.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2b59c63aa2fd1fa6091dac66cc6804fef34fea9f3aafc59f5b29c9c4469de48
|
|
| MD5 |
061b92c7dd6e050f9a74824bcaec92a3
|
|
| BLAKE2b-256 |
917156a49a9bf3269ea5596b89a955241b8bc33e4be4b73deb85c2207b99076f
|
File details
Details for the file multimodal_agent-0.2.8-py3-none-any.whl.
File metadata
- Download URL: multimodal_agent-0.2.8-py3-none-any.whl
- Upload date:
- Size: 31.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44c731f6f47af65fd1ea5e948c1ecc7b92833112c9326284e5c00fee3118a58e
|
|
| MD5 |
7236e347d4c1090bc7270fde4cc517ea
|
|
| BLAKE2b-256 |
172bad9ccbe1d7725c537bd05591162055e67c3c296ab5654d61b59f57ea51ea
|