This document outlines gaps, missing features, and improvement opportunities for KeepAI, organized by priority.
- P0 — Must fix before production (security, data integrity, broken features)
- P1 — Should fix soon (important UX gaps, missing test coverage, incomplete features)
- P2 — Nice to have (enhancements, polish)
- P3 — Future (ecosystem, advanced features)
The AuditLog model and record_usage() method exist in src/modules/analytics/ but are never invoked by any router or service. The audit_logs table is created in the schema but never written to. UsageRecord is also never populated.
Files affected: analytics/service.py, prompts/service.py, conversations/service.py, documents/service.py, api_keys/service.py, ws/router.py
Fix: Inject AnalyticsService into every mutation service. Call record_usage() for:
- Prompt creation (prompts/service.py)
- Conversation chat messages (conversations/service.py, ws/router.py)
- Document upload/deletion (documents/service.py)
- API key creation/revocation (api_keys/service.py)
Call
AuditLogcreation for security-relevant actions: login, register, admin operations.
main.py adds CORS middleware but no security headers middleware. Missing:
Content-Security-PolicyStrict-Transport-SecurityX-Frame-OptionsX-Content-Type-OptionsReferrer-Policy
Fix: Add a SecureHeadersMiddleware in src/core/middleware.py.
CORS_ORIGINS = ["*"] in config.py allows any origin in production.
Fix: Restrict to specific origins in production (e.g., the frontend domain). Document how to configure.
The Docker deployment uses a known default secret key.
Fix: Document openssl rand -hex 32 generation. Add a startup check that warns if the key is the default.
POST /auth/login and POST /auth/register have no rate limiting, enabling brute force attacks.
Fix: Add @limiter.limit("5/minute") on login, @limiter.limit("2/minute") on register.
DocumentService.generate_embeddings() uses the LLM with a text prompt ("Generate an embedding for...") instead of a real embedding model. This produces text, not vectors.
Fix: Pull nomic-embed-text via Ollama and call /api/embeddings. Or integrate pgvector with a real embedding provider.
| Module | Endpoints | Test Status |
|---|---|---|
| Conversations | 6 REST + WebSocket | No tests |
| API Keys | 3 (list, create, revoke) | No tests |
| Analytics | 2 (stats, user-stats) | No tests |
| Documents/RAG | 8 (CRUD, search, upload, embed) | No tests |
Fix: Write test suites following patterns in tests/api/test_auth.py (FastAPI TestClient + mocked DB) and tests/services/test_prompt_service.py (service-level with mocked dependencies).
backend/DEPLOYMENT_GUIDE.md references docker-compose.prod.yml multiple times (lines 119, 166, 411) — a file that does not exist anywhere in the repo. Also uses cd fastapi-ollama-backend (wrong directory name) and has 12+ stale docker-compose path references.
Fix: Rewrite deployment guide to use docker compose -f docker/docker-compose.yml. Either create a docker/docker-compose.prod.yml or remove all references.
✅ DONE: Consolidated into docs/guides/deployment.md with correct docker paths. Old file removed.
Backend has POST /prompts/stream and POST /chat/stream endpoints, but no frontend page offers streaming. The WebSocket chat doesn't stream tokens either — it waits for the full response.
Fix: Add streaming toggle to Chat page (switch between WS batch mode and SSE streaming). Add streaming demo to Playground. Implement token-by-token streaming over WebSocket via LLMInterface.stream_chat().
No "forgot password" mechanism exists. Users cannot recover accounts.
Fix: Add email-based password reset flow:
POST /auth/forgot-password— generates reset token, emails userPOST /auth/reset-password— validates token, updates password- Frontend password reset page
Only email/password authentication. No Google, GitHub, or Microsoft login.
Fix: Add OAuth integration (e.g., authlib) with provider configuration. Frontend social login buttons.
Documents RAG uses _simple_score() — a keyword overlap scoring function. No vector embeddings, no semantic similarity.
Fix: Upgrade to pgvector:
- Add pgvector extension migration
- Replace
generate_embeddings()with real embedding model - Replace
_simple_score()with<=>cosine distance query - Add HNSW index for performance
Users can search documents but cannot chat with document context injected into the LLM prompt.
Fix: Add POST /documents/chat endpoint that:
- Searches relevant chunks
- Injects context into system prompt
- Returns LLM response grounded in documents
AdminUsers.tsx and AdminPrompts.tsx fetch all records at once with no pagination controls (hard-coded limit of 100). Admin pages may become slow with many records.
Fix: Add Previous/Next pagination with skip/limit controls, matching the pattern in Conversations.tsx and History.tsx.
Every page uses <p>Loading...</p> instead of skeleton loaders.
Files: AdminPrompts.tsx:17, AdminUsers.tsx:17, Analytics.tsx:77, ApiKeys.tsx:125, Conversations.tsx:89, Documents.tsx:192, History.tsx:32, ProtectedRoute.tsx:8
Fix: Create <Skeleton>, <SkeletonTable>, <SkeletonCard> components. Replace all text loaders.
A crash in any page component takes down the entire app.
Fix: Create <ErrorBoundary> component wrapping each route or the entire <Layout>. Add friendly fallback UI with "Retry" button.
Frontend uses alert() and confirm() for all user feedback:
Chat.tsx—alert(data.message)for WebSocket errorsConversations.tsx—confirm()for deletionDocuments.tsx—confirm()for deletionApiKeys.tsx—confirm()for revocationModels.tsx—confirm()for model deletion
Fix: Create <ToastProvider> context + <Toast> component with success/error/info/warning variants. Replace all alert()/confirm() calls.
LLM responses contain markdown (headers, lists, code blocks, bold) but are displayed as raw text.
Fix: Install react-markdown + remark-gfm. Render message content through markdown. Add prose styling.
docker/docker-compose.yml has no Redis service. Multi-instance rate limiting and caching require Redis.
Fix: Add redis service to docker-compose.yml. Configure slowapi to use Redis storage backend. Optionally add response caching.
GitHub Actions CI only runs backend tests and linting. Frontend changes can break the build unnoticed.
Fix: Add frontend npm run lint && npm run build step to .github/workflows/ci.yml.
Uploads and large prompts are unbounded, risking OOM from huge payloads.
Fix: Add middleware limiting request body size (e.g., 10 MB for uploads, 1 MB for prompts).
UsageRecord.prompt_tokens and response_tokens are never populated from Ollama responses.
Fix: Parse Ollama response metadata for token counts. Update record_usage() calls to pass token data.
rag/__init__.py exists but is empty. No models, schemas, service, or router.
Fix: Either implement the RAG module (agents, orchestration) or remove the stub.
docker/docker-compose.prod.yml does not exist. For production deployments, users need a compose file with resource limits, port restrictions, and non-root users. The current docker-compose.yml is dev-oriented (wide-open CORS, default secrets, exposed ports).
Fix: Create docker/docker-compose.prod.yml with production hardening: resource limits, env_file: support, non-root users, restricted port ranges, healthcheck tuning.
8+ features marked 📋 (Planned) that are actually ✅ done:
- Conversation history, WebSocket chat, React UI, multi-model routing
- Model management API, custom system prompts, temperature controls
- API key management, usage analytics, audit logging
Fix: Update roadmap to reflect current v1.2.0 state. Move done items to "Completed" section.
✅ DONE: Roadmap rewritten at docs/community/roadmap.md with all v1.2.0 items checked. Old file removed.
Admin users, admin prompts, and conversations pages have no search input.
CSS uses only light theme colors. No @media (prefers-color-scheme: dark), no toggle.
Fix: Add dark theme CSS variables, ThemeContext/ThemeProvider, toggle in sidebar footer, persist in localStorage.
Zero @media queries in index.css. Sidebar is fixed 240px with no collapse. Tables don't scroll horizontally on small screens.
Fix: Add media query breakpoints (768px, 480px), collapsible sidebar with hamburger menu, responsive table containers.
PUT /conversations/{id}/title endpoint exists but no frontend UI for renaming. Conversations.tsx and Chat.tsx sidebar both show "Untitled" with no edit capability.
GET /documents/{id} endpoint returns content and chunk count, but no frontend page consumes it.
POST /documents/{id}/embed endpoint exists but no UI action for it.
Only InvoiceAgent exists. No agents for code generation, project scaffolding, file editing, or sandbox execution.
No /metrics endpoint exposing request counters, latency histograms, or error rates.
Long-running operations (model pulls, large document processing) block the request thread.
No batch delete for conversations or API keys. No batch endpoints.
No easy way to copy LLM responses from the chat interface.
No shortcut system. No hint overlay.
Dashboard uses CSS bar charts. No chart library (Chart.js, Recharts) for proper visualizations.
UsageRecord and AuditLog tables grow unboundedly with no cleanup mechanism.
No user-facing settings page. No way to change password or preferences. No route or sidebar link.
Chat.tsx's connectWs() only connects on mount with no reconnection logic. ws.onclose sets wsRef.current = null but never retries. No exponential backoff, no heartbeat/ping.
Models.tsx shows "Pulling..." status text but doesn't display real-time progress from Ollama's streaming pull response.
Scrolling up to read history loses position when new messages arrive.
CHANGELOG.md (and backend/docs/community/changelog.md) only document v1.0.0. Missing:
- v1.1.0: WebSocket chat, conversation threads, model management, multi-model routing
- v1.2.0: API keys, document RAG, usage analytics, audit logging, React frontend (8 pages), monorepo restructure
✅ DONE: Changelog rewritten at docs/community/changelog.md covering v1.0.0, v1.1.0, and v1.2.0. Old files removed.
Only backend/.env.example exists. New developers scanning the repo root won't immediately find required env vars.
Proxy /v1/chat/completions to Ollama for drop-in client compatibility.
Client library for programmatic access to KeepAI API.
Client library for Node.js/TypeScript applications.
Plugin loader and extension API for third-party modules.
Pull models directly from HuggingFace instead of Ollama.
Fine-tune models on user-provided datasets.
Organization-scoped isolation of users, conversations, documents, and keys.
Isolated code execution environment for generated code.
Besides the docker path issues (item 24) and roadmap (item 25), several other backend/docs/ files have stale content referencing old project structure and files.
✅ DONE: All documentation consolidated into docs/ directory with comprehensive rewrites — 19 files total (index, getting-started, architecture, api reference, 4 guides, 3 dev docs, 6 community docs, claude.md, next-steps.md). All backend/docs/, backend/*.md, and root *.md files removed.
The following gaps were identified and fixed in recent sessions:
- User.role type mismatch: Frontend typed
roleasRoleobject, backend returned plain string. Fixed types and display. - user.id was email string: JWT lacked
user_idclaim. Added to backend, decoded in frontend AuthContext. - Missing CSS (~63 classes): Chat sidebar, data tables, stat cards, bar charts, badges, buttons, forms, and search results were unstyled. Added 350 lines of CSS.
- PromptResponse missing
updated_at: Schema field added. - WebSocket responses incomplete:
message_count,user_id,created_at,updated_atadded to WS responses. - ChatRequest type too narrow: Added
temperature,top_p,max_tokens. - Hardcoded WS URL: Changed to derive from
window.location. - Playground invoice tab: Wired up
extractInvoicefunction with form UI. - Admin pagination: API functions accept
skip/limit. - Document search: Sends
top_kparameter. - Unused types removed:
Role,Permission,AuthState,LoginForm,RegisterFormcleaned. - ModelInfo/ConversationMessage types: Added missing fields from backend schemas.
- Docker files consolidated: All Docker configs moved from root/backend/frontend into
docker/directory..dockerignoreconsolidated at repo root. - Stale docker paths fixed across 14 documentation files — all
docker composecommands updated todocker compose -f docker/docker-compose.ymlin README, CONTRIBUTING, CLAUDE, TROUBLESHOOTING, WALKTHROUGH, FAQ, DEPLOYMENT_GUIDE, and allbackend/docs/guides. - All documentation consolidated into
docs/directory — 19 files covering setup, architecture, API, guides, development, community, and roadmap. All oldbackend/docs/,backend/*.md, and root*.mdfiles removed.