Copy the example environment file from the repository:
cp .env.example .env
Or create one manually:
.env
# OpenAIOPENAI_API_KEY=sk-...OPENAI_BASE_URL=https://api.openai.com/OPENAI_MODEL=gpt-4oOPENAI_MODEL_SUMMARIZER=gpt-4o-miniOPENAI_MODEL_REASONING=o3-mini# Anthropic (if using @agentlib/anthropic in the future)ANTHROPIC_API_KEY=sk-ant-...# Google Gemini (if using @agentlib/gemini in the future)GOOGLE_GENERATIVE_AI_API_KEY=...# Groq (if using @agentlib/groq in the future)GROQ_API_KEY=gsk_...# Mistral (if using @agentlib/mistral in the future)MISTRAL_API_KEY=...
Never commit .env files to version control. Add .env to your .gitignore.
If you want to contribute or run the examples from the source repository:
# Clone the repositorygit clone https://github.com/sammwy/agentlib.gitcd agentlib# Install dependencies (requires pnpm 9.0.0+)pnpm install# Build all packagespnpm build# Run an examplepnpm example example/basic-agent.tspnpm example example/chat-history.tspnpm example example/reasoning/react.ts# Watch mode (rebuild on changes)pnpm dev
The monorepo uses Turborepo for build orchestration and pnpm workspaces for dependency management.