Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sidekick

A LangGraph personal co-worker: a worker agent with tools (web search, browser, files, Python, Wikipedia) and an evaluator that loops until success criteria are met or the user must respond.

Based on the Agentic AI course Sidekick pattern (worker → tools → evaluator loop).

Prerequisites

Setup

From the project root (langgraph/sidekick):

uv sync
uv run playwright install chromium
cp .env.example .env
# Edit .env with your keys

Environment variables

Variable Required Description
OPENAI_API_KEY Yes OpenAI API key
OPENAI_MODEL No Model name (default: gpt-4o-mini)
TAVILY_API_KEY Recommended Primary web search via Tavily
SERPER_API_KEY Recommended Fallback Google search via Serper
PLAYWRIGHT_HEADLESS No true to run Chromium headless; false to show the browser window
PUSHOVER_TOKEN / PUSHOVER_USER No Mobile push notifications via Pushover
LANGSMITH_* No Optional tracing in LangSmith

Run the Gradio UI

uv run sidekick

Or:

uv run python -m sidekick.app

Gradio prints a local URL (for example http://127.0.0.1:7860). Open it in your browser, wait for the page to finish loading (the agent initializes on load), then enter a request and success criteria and click Go!.

After code or .env changes, stop the server with Ctrl+C and run the command again.

Demo

End-to-end walkthrough: research IT relocation in Europe, save markdown reports, and send Pushover summaries.

1. Launch the UI

Start the app with uv run sidekick. The Gradio UI opens with an empty chat, a request box, a success-criteria box, and Reset / Go! buttons.

Gradio UI on first load

2. Enter request and success criteria

Request — describe your background and what you want Sidekick to do:

I am in Amazon India as a SDE-III… I am working towards finding IT Backend Jobs in Europe. Can you give me a list of countries which allows easy re-location… Can you also give me relevant companies… Please create separate markdown files and send 2 separate push notifications directly with country names and companies names.

Success criteria — how the evaluator should judge completion:

The results should be backed by authentic web sources.

Click Go! to start the worker → tools → evaluator loop.

Request and success criteria filled in

3. Review the chat response

Sidekick searches the web, may browse pages, and returns a structured answer in the chatbot. The reply lists countries and companies with brief notes and source links for transparency.

Chat response with countries, companies, and sources

4. Inspect files in workspace/

The agent writes deliverables under workspace/ using the save_file tool (for example european_countries_for_it_jobs.md and it_companies_in_europe.md). Open them in your editor to review the full markdown reports.

VS Code showing generated markdown in workspace/

5. Optional: trace execution in LangSmith

If LangSmith tracing is enabled in .env, you can inspect each run: worker LLM calls, search tool invocations, save_file writes, and token/cost breakdowns.

LangSmith trace of worker, search, and save_file steps

6. Receive Pushover notifications

When PUSHOVER_TOKEN and PUSHOVER_USER are set, Sidekick sends two push notifications—one summarizing countries and one summarizing companies—so you get the highlights on your phone without opening the app.

Pushover notifications on a phone lock screen

How it works

flowchart LR
    START --> worker
    worker -->|tool calls| tools
    tools --> worker
    worker -->|no tools| evaluator
    evaluator -->|retry| worker
    evaluator -->|done| END
Loading
  1. Worker — plans and acts with tools until it has a non-tool reply.
  2. Tools — search (Tavily with Serper fallback), Playwright browser, file I/O, structured save_file, Python REPL, Wikipedia, optional Pushover.
  3. Evaluator — checks the reply against your success criteria; loops back to the worker if not satisfied.

Outputs and saved files go under workspace/.

Project layout

sidekick/
├── src/sidekick/
│   ├── graph.py      # LangGraph StateGraph + Sidekick class
│   ├── tools.py      # Playwright, search, save_file, Pushover, etc.
│   ├── app.py        # Gradio UI entry point
│   └── assets/       # README demo screenshots
├── workspace/        # Agent-written files (created at runtime)
├── .env.example
├── pyproject.toml
└── uv.lock

Docs

About

AI co-worker that researches, browses, writes files, and pings your phone — worker/evaluator loop built with LangGraph, Playwright, Pushover and Gradio

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages