Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Supermemory API key (get from https://console.supermemory.ai)
SUPERMEMORY_API_KEY=sm_...

# xAI Grok API key (get from https://console.x.ai/)
XAI_API_KEY=xai_...

# Optional: Anthropic (if you prefer Claude instead of Grok)
# ANTHROPIC_API_KEY=sk-ant-...

# LLM configuration
LLM_PROVIDER=xai # xai | anthropic
LLM_MODEL=grok-3 # For xai: grok-3, grok-4, grok-3-latest, etc.
# For anthropic: claude-3-7-sonnet-20250219, claude-3-5-haiku-20241022, etc.
LLM_TEMPERATURE=0.7
LLM_MAX_TOKENS=2048

# Default user/container for demo (change per user/session)
DEFAULT_USER_ID=demo-user

# --- DGX Spark Desktop Local LLM (single-node v1: 120b Nemotron via NIM on :8000) ---
# After `docker compose up nemotron` (or the manual nemotron-120b container), use this.
# The 120b-class model gives the best responsive quality currently practical on one DGX Spark.
# (340b-class requires 2-3x DGX Spark nodes clustered; same agent/voice code works unchanged.)
#LLM_PROVIDER=openai_compatible
#LLM_BASE_URL=http://localhost:8000/v1
#LLM_MODEL=nvidia/nemotron-3-super-120b-a12b
#OPENAI_API_KEY=dummy
#DEFAULT_USER_ID=grok-dgx-voice-agent
#
# Once the model is fully loaded, test with:
# make env
# make chat
# (or source .env and run the venv thelab-chat directly)
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install minimal CPU-only dependencies
# The full package depends on audio/GPU libraries (sounddevice / PortAudio,
# nvidia-riva-client) that the voice layer needs but the tests do not.
# We install the package without its deps, then add only the lightweight
# set required to import and test the agent brain on a plain CPU runner.
run: |
python -m pip install --upgrade pip
pip install -e . --no-deps
pip install \
"langchain-core>=0.3" \
"langgraph>=0.2" \
"pydantic>=2.0" \
"pydantic-settings>=2.0" \
"python-dotenv>=1.0" \
"rich>=13.0" \
"supermemory>=0.1" \
"pytest>=8.0" \
"pytest-asyncio>=0.23" \
"ruff>=0.4"

- name: Lint
run: ruff check .

- name: Test
run: pytest -q
165 changes: 165 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
Pipfile.lock

# poetry
poetry.lock

# pdm
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# IDEs
.idea/
.vscode/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# Project specific
supermemory.db
*.log

# Benchmark reports - keep the structure and .gitkeep + summary files,
# but large raw logs / binaries can be ignored if they get big.
benchmarks/reports/*/
!benchmarks/reports/*/.gitkeep
!benchmarks/reports/*/summary.md
!benchmarks/reports/*/metrics.json
!benchmarks/reports/*/events.jsonl
!benchmarks/reports/*/config.json

# Temporary benchmark artifacts
*.bench
bench-*.log
45 changes: 45 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Dockerfile for the thelab-voice-agent service
# Target: DGX Spark (and general NVIDIA GPU environments)

FROM python:3.12-slim AS builder

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*

# Copy everything needed for metadata + build
COPY pyproject.toml .
COPY README.md .
COPY src/ ./src/

# Build the wheel (non-editable, clean)
RUN pip install --no-cache-dir build && \
python -m build --wheel --outdir /wheels .

# ---- Runtime image ----
FROM python:3.12-slim

# Create non-root user
RUN useradd --create-home --shell /bin/bash appuser

WORKDIR /app

# Audio runtime for sounddevice (used by the voice layer for mic/speakers on desktop DGX Spark).
# This is only required when running `thelab-chat voice`. The text `chat` command works without it.
RUN apt-get update && apt-get install -y --no-install-recommends \
libportaudio2 \
&& rm -rf /var/lib/apt/lists/*

# Install the wheel + runtime deps only
COPY --from=builder /wheels /wheels
RUN pip install --no-cache-dir /wheels/*.whl && \
chown -R appuser:appuser /app

USER appuser

# Default command (override in compose or at runtime)
# Example for voice: thelab-chat voice --user derek
ENTRYPOINT ["thelab-chat"]
CMD ["--help"]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Derek Clair

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading