Files
ai_agent/backend/.env.example
T
furyhawk 8351e73d39 feat: add Zustand stores for conversation, file preview, sidebar, theme, and knowledge base selection
- Implemented `conversation-store` for managing conversations and messages.
- Created `file-preview-store` to handle file preview state.
- Added `sidebar-store` for sidebar visibility management.
- Developed `theme-store` for theme persistence and management.
- Introduced `kb-selection-store` for managing active knowledge base selections with persistence.

chore: define API and chat types

- Added types for API responses, authentication, chat messages, conversations, and projects.
- Defined interfaces for various entities including users, sessions, and message ratings.

build: configure TypeScript and testing setup

- Set up `tsconfig.json` for TypeScript configuration.
- Created `vitest.config.ts` for testing configuration with Vitest.
- Added `vitest.setup.ts` for global test setup including mocks for Next.js router and media queries.
- Configured Vercel deployment settings in `vercel.json`.
2026-06-11 16:54:43 +08:00

104 lines
2.5 KiB
Bash

# ai_agent Environment Variables
# === Project ===
PROJECT_NAME=ai_agent
DEBUG=true
ENVIRONMENT=local
TIMEZONE=UTC # IANA timezone: UTC, Europe/Warsaw, America/New_York
MODELS_CACHE_DIR=./models_cache
# === Logfire ===
# Get your token at https://logfire.pydantic.dev
LOGFIRE_TOKEN=
LOGFIRE_SERVICE_NAME=ai_agent
LOGFIRE_ENVIRONMENT=development
# === PostgreSQL ===
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=ai_agent
# === JWT Auth ===
# Generate with: openssl rand -hex 32
SECRET_KEY=change-me-in-production-use-openssl-rand-hex-32
ACCESS_TOKEN_EXPIRE_MINUTES=10080
ALGORITHM=HS256
# === API Key Auth ===
API_KEY=change-me-in-production
API_KEY_HEADER=X-API-Key
# === Redis ===
REDIS_HOST=localhost
REDIS_PORT=6379
# REDIS_PASSWORD=
REDIS_DB=0
# === RAG Configuration ===
RAG_DEFAULT_COLLECTION=documents
RAG_TOP_K=10
RAG_CHUNK_SIZE=512
RAG_CHUNK_OVERLAP=50
RAG_CHUNKING_STRATEGY=recursive # recursive, markdown, or fixed
RAG_HYBRID_SEARCH=false # Enable BM25 + vector hybrid search
RAG_ENABLE_OCR=false # OCR fallback for scanned PDFs (requires tesseract-ocr installed)
# Vector Database (Milvus)
MILVUS_HOST=localhost
MILVUS_PORT=19530
MILVUS_DATABASE=default
MILVUS_TOKEN=root:Milvus
# Reranker
HF_TOKEN=
CROSS_ENCODER_MODEL=cross-encoder/ms-marco-MiniLM-L6-v2
# Image Description (LLM vision)
RAG_IMAGE_DESCRIPTION_MODEL= # empty = use AI_MODEL
# === Taskiq ===
TASKIQ_BROKER_URL=redis://localhost:6379/1
TASKIQ_RESULT_BACKEND=redis://localhost:6379/1
# === AI Agent (pydantic_ai, openai) ===
OPENAI_API_KEY=
AI_MODEL=gpt-5.5
AI_TEMPERATURE=0.7
AI_THINKING_ENABLED=false
AI_THINKING_EFFORT=medium # low, medium, high
# Embeddings
# OpenAI Embeddings
OPENAI_API_KEY=
EMBEDDING_MODEL=text-embedding-3-small
# Chunking
RAG_CHUNK_SIZE=512
RAG_CHUNK_OVERLAP=50
# Retrieval
RAG_DEFAULT_COLLECTION=documents
RAG_TOP_K=10
# Reranker
# PDF Parser
# Google Drive (optional, for document ingestion)
# === CORS ===
# JSON list of allowed origins (default: localhost:3000, localhost:8080)
# Note: "*" is blocked in production - specify explicit origins
CORS_ORIGINS=["http://localhost:3000","http://localhost:8080"]
# === Docker Production (Traefik) ===
# Domain for production deployment
DOMAIN=example.com
# Let's Encrypt email for SSL certificates
ACME_EMAIL=admin@example.com
# Traefik dashboard auth (generate with: htpasswd -nb admin password)
# TRAEFIK_DASHBOARD_AUTH=admin:$$apr1$$...
# Redis password for production
REDIS_PASSWORD=change-me-in-production