This project is not polished and is currently buggy in multiple areas. Expect rough edges, incomplete flows, and behavior changes at this stage.
Tech
- React/TanStack Start frontend
- Python/FastAPI backend
- Multi-agent
/chatrouting (document, knowledge graph, data analysis, general) - Cloudflare deployment (frontend Worker + backend Cloudflare Containers)
- Upload PDF documents and ask grounded questions about selected docs.
- Upload CSV/XLS/XLSX datasets and run analysis/modeling prompts through
/chat. - Trigger knowledge-graph extraction from
/chatwhen a document is selected. - Show memory, knowledge graph, models, and recent conversations in the frontend.
- Render dataset visualizations returned by backend analysis.
talk2doc/
├── backend/ # FastAPI backend
│ ├── cloudflare/container-worker.js
│ ├── wrangler.containers.jsonc
│ └── CLOUDFLARE_CONTAINERS.md
├── src/ # Frontend app
├── wrangler.jsonc # Frontend Cloudflare Worker config
└── ...
- Bun (for frontend and deploy scripts)
- Python 3.11+ (project currently uses 3.13 in Docker)
- Docker (required for Cloudflare Containers deploy)
bun install
cd backend
uv sync
cd ..Create backend/.env from backend/.env.example and fill real values:
DATABASE_URLOPENAI_API_KEYr2_account_idr2_access_key_idr2_secret_access_keyr2_bucket_name
cd backend
uv run devBackend default URL: http://localhost:8000
bun run devFrontend default URL: http://localhost:3000
- Local Swagger UI:
http://localhost:8000/docs - Local OpenAPI JSON:
http://localhost:8000/openapi.json
Deployed backend Swagger UI:
https://talk2doc-backend.hla-htuncs.workers.dev/docs
npm run deployCurrent deployed frontend URL:
https://tanstack-start-app.hla-htuncs.workers.dev
See backend/CLOUDFLARE_CONTAINERS.md for full steps.
Minimum flow:
npx wrangler login
npx wrangler secret put DATABASE_URL -c backend/wrangler.containers.jsonc
npx wrangler secret put OPENAI_API_KEY -c backend/wrangler.containers.jsonc
npx wrangler secret put R2_ACCOUNT_ID -c backend/wrangler.containers.jsonc
npx wrangler secret put R2_ACCESS_KEY_ID -c backend/wrangler.containers.jsonc
npx wrangler secret put R2_SECRET_ACCESS_KEY -c backend/wrangler.containers.jsonc
npm run deploy:backendCurrent deployed backend URL:
https://talk2doc-backend.hla-htuncs.workers.dev
Frontend API base URL resolves in this order:
VITE_BACKEND_URLSERVER_URL- Auto-derived
workers.devbackend URL in production http://localhost:8000fallback
Implementation: src/routes/index.tsx.
- Cloudflare Containers cold starts can intermittently fail the first request right after deploy/idle; retry usually succeeds.
- CORS is currently configured permissively (
CORS_ORIGINS="*"in backend container vars). - No user authentication/authorization is implemented yet.
Frontend:
bun run testBackend includes integration-style test scripts under backend/tests/ that are intended to run against a configured backend environment.