A Bun-powered CLI agent that combines Gemini, local conversation memory, tool calling, movie retrieval, and an evaluation dashboard.
- Answers normal text prompts with Gemini through Google's OpenAI-compatible API
- Uses tools for movies, Reddit, weather, location lookup, dad jokes, and image generation
- Stores conversation state in
db.jsonso later runs can continue the same thread - Supports human approval before image generation
- Includes evals and a React dashboard for browsing experiment results
src/
ai/
agent.ts Agent loop and approval flow
ai.ts Gemini client configuration
llm.ts Chat and structured output helpers
memory.ts Persistent conversation history in db.json
tools/ Tool definitions and implementations
evals/ Evaluation runner and experiments
rag/ Movie ingest and retrieval code
dashboard/ Vite app for visualizing eval results
- Bun
- A
GEMINI_API_KEY - Optional API keys for tools you want to use
Copy .env.example to .env and fill in the keys you need.
GEMINI_API_KEY=
ANTHROPIC_API_KEY=
HF_ACCESS_TOKEN=
OPENAI_API_KEY=
GEO_CODE_API_KEY=
UPSTASH_VECTOR_REST_URL=
UPSTASH_VECTOR_REST_TOKEN=Notes:
GEMINI_API_KEYis required for the main agent.- Weather, location, Reddit, RAG, and image-related flows may need additional keys depending on which tools you use.
- The app now fails early with a clear error if
GEMINI_API_KEYis missing.
bun installThe CLI takes the user message as the first argument:
bun start "recommend me a sci-fi movie"Examples:
bun start "hi"
bun start "find me a good Christopher Nolan movie"
bun start "generate an image of a neon city at sunset"Behavior notes:
- Simple greetings like
hishould be answered directly without unnecessary tool calls. - The image tool should only run when the user explicitly asks for an image.
- Image generation requires approval before execution.
- Conversation history is persisted in
db.json, so repeated runs continue prior context unless you clear that file.
bun start "your prompt"
bun eval allTools
bun eval dadJoke
bun eval reddit
bun eval weather
bun eval location
bun eval generateImage
bun ingestThe dashboard is a separate Vite app for exploring eval output.
cd dashboard
npm install
npm run devSee dashboard/README.md for dashboard-specific notes.
db.jsonstores the running conversation history and summaries.results.jsonstores eval output used by the dashboard.- Generated images are saved under
images/.
If the agent seems to answer with stale context, inspect or clear db.json before rerunning.