Spaces:
Paused
Paused
Commit
Β·
15b5ac0
1
Parent(s):
f14671d
Add README.md with project overview, installation instructions, usage guidelines, and programmatic access details for AI Sidekick.
Browse files
README.md
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AI Sidekick
|
| 2 |
+
|
| 3 |
+
## Overview
|
| 4 |
+
AI Sidekick is an autonomous "co-worker" that can collaborate with you on almost any knowledge-working task.
|
| 5 |
+
Under the hood it combines:
|
| 6 |
+
* **LangGraph** β orchestrates a two-node graph consisting of a **worker** agent that tries to complete your task and an **evaluator** agent that inspects the worker's answers against the success criteria you provide.
|
| 7 |
+
* **LangChain** tools β web search, Wikipedia, ArXiv, file-system access, a Python REPL, safe symbolic math and a fully-featured Chromium browser driven through Playwright.
|
| 8 |
+
* **Gradio** β delivers a clean, one-page chat interface so you can talk to the sidekick in your browser.
|
| 9 |
+
|
| 10 |
+
The result is a self-reflective assistant able to:
|
| 11 |
+
1. Use the above tools to gather information, crunch numbers or automate the browser.
|
| 12 |
+
2. Evaluate its own answers and iterate until the predefined success criteria are met.
|
| 13 |
+
|
| 14 |
+
All conversations (and any artefacts it writes to the `sandbox/` directory) are saved locally so the context persists between sessions.
|
| 15 |
+
|
| 16 |
+
## Installation
|
| 17 |
+
### Prerequisites
|
| 18 |
+
* Python **3.12+** (matching the constraint in `pyproject.toml`)
|
| 19 |
+
* An OpenAI API key stored as the environment variable `OPENAI_API_KEY`
|
| 20 |
+
* Optional β to change the LLM models set `OPENAI_CHAT_MODEL_WORKER` and `OPENAI_CHAT_MODEL_EVALUATOR`.
|
| 21 |
+
|
| 22 |
+
### Steps
|
| 23 |
+
```bash
|
| 24 |
+
# 1. Clone the repo
|
| 25 |
+
git clone https://github.com/your-org/ai_sidekick.git
|
| 26 |
+
cd ai_sidekick
|
| 27 |
+
|
| 28 |
+
# 2. Install uv
|
| 29 |
+
pip install uv
|
| 30 |
+
|
| 31 |
+
# 3. Create and sync venv
|
| 32 |
+
uv sync
|
| 33 |
+
|
| 34 |
+
# 4. Activate the enviroment
|
| 35 |
+
source .venv/bin/activate # .venv/Scripts/activate
|
| 36 |
+
|
| 37 |
+
# 5. Create a .env file for your keys
|
| 38 |
+
cp .env.example .env # then edit the values
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Usage
|
| 42 |
+
Start the Gradio application:
|
| 43 |
+
```bash
|
| 44 |
+
uv run app.py
|
| 45 |
+
```
|
| 46 |
+
This will launch a local web server (by default at `http://localhost:7860`) presenting the chat UI.
|
| 47 |
+
|
| 48 |
+
1. Type your request in the *Your request to the Sidekick* box.
|
| 49 |
+
2. Optionally describe what "done" looks like in the *success criteria* field. The evaluator agent will use this text to decide when to stop.
|
| 50 |
+
3. Press **Go!** and watch the conversation unfold.
|
| 51 |
+
|
| 52 |
+
UI tips:
|
| 53 |
+
* **Reset** β clears the current chat but keeps the long-term memory on disk.
|
| 54 |
+
* **Clear Memory** β deletes `sidekick_memory.json` and starts a completely fresh session.
|
| 55 |
+
|
| 56 |
+
### Programmatic access
|
| 57 |
+
If you want to embed the sidekick in your own code you can import the `Sidekick` class:
|
| 58 |
+
```python
|
| 59 |
+
from sidekick import Sidekick
|
| 60 |
+
|
| 61 |
+
sidekick = Sidekick()
|
| 62 |
+
await sidekick.setup()
|
| 63 |
+
result = await sidekick.run_superstep(
|
| 64 |
+
"Write a short poem about the sea",
|
| 65 |
+
success_criteria="The poem is exactly four lines long.",
|
| 66 |
+
history=[],
|
| 67 |
+
)
|
| 68 |
+
print(result[-2]["content"]) # assistant's reply
|
| 69 |
+
```
|