TonkBook is a highly-extensible LLM-assisted research platform. Create notes, chat with AI about your sources, and vibe code powerful interfaces over your intelligence.
Install the Tonk CLI globally:
npm i -g @tonk/cli-
Install dependencies:
cd tonkbook pnpm install -
Start the main application:
pnpm dev
This starts the web interface at
http://localhost:3000 -
Start the AI worker (required for chat functionality):
cd workers/ai pnpm install pnpm build tonk worker register tonk worker start aiThe AI worker runs on
http://localhost:5556 -
Start the web scraper worker (optional, for web search sources):
cd workers/web-scraper pnpm install pnpm build tonk worker register tonk worker start web-scraperThe AI worker runs on
http://localhost:5555
The AI worker requires an OpenAI API key:
cd workers/ai
pnpm authFor web search functionality in sources, you'll need a Brave Search API key:
-
Get a Brave Search API key from Brave Search API
-
Set the environment variable:
export BRAVE_SEARCH_API_KEY=your_api_key_hereOr add it to your
.envfile:BRAVE_SEARCH_API_KEY=your_api_key_here
TonkBook will use this key to authenticate requests to the Brave Search API.
TonkBook uses a modular architecture:
- Frontend: React app with Tailwind CSS
- AI Worker: Handles LLM interactions and document indexing with ChromaDB
- Web Scraper: Extracts content from web searches
- Keepsync: Real-time data synchronization between components
pnpm buildThis will build the frontend application and export the API configuration for production.
You can deploy your app to a running Tonk server using the Tonk CLI:
tonk pushThis will:
- Build your application
- Upload the bundle to your Tonk server
To start an uploaded Tonk app:
tonk start <bundleName>This application comes with Docker support for easy self-hosting using the Tonk server.
- Docker and Docker Compose installed on your system
# Build your application first
pnpm build
# Start the Tonk server container with your app
docker-compose up -d
# View logs
docker-compose logs -f
# Stop the container
docker-compose downThe Docker setup:
- Uses the official Tonk server container
- Automatically deploys your built application as a bundle
- Starts your application on port 8000
Edit the docker-compose.yml file to add any required API keys or environment variables for your services.
The Docker setup creates two persistent volumes:
tonk-data: Stores the Tonk server's datatonk-bundles: Stores application bundles
You can customize the Docker setup by editing the docker-compose.yml file.