Backend:
- Document + MemoryEntry models with Alembic migration (GIN FTS index)
- File upload endpoint with path traversal protection (sanitized filenames)
- Background document text extraction (PyMuPDF)
- Full-text search on extracted_text via PostgreSQL tsvector/tsquery
- Memory CRUD with enum-validated categories/importance, field allow-list
- AI tools: save_memory, search_documents, get_memory (Claude function calling)
- Tool execution loop in stream_ai_response (multi-turn tool use)
- Context assembly: injects critical memory + relevant doc excerpts
- File storage abstraction (local filesystem, S3-swappable)
- Secure file deletion (DB flush before disk delete)
Frontend:
- Document upload dialog (drag-and-drop + file picker)
- Document list with status badges, search, download (via authenticated blob)
- Document viewer with extracted text preview
- Memory list grouped by category with importance color coding
- Memory editor with category/importance dropdowns
- Documents + Memory pages with full CRUD
- Enabled sidebar navigation for both sections
Review fixes applied:
- Sanitized upload filenames (path traversal prevention)
- Download via axios blob (not bare <a href>, preserves auth)
- Route ordering: /search before /{id}/reindex
- Memory update allows is_active=False + field allow-list
- MemoryEditor form resets on mode switch
- Literal enum validation on category/importance schemas
- DB flush before file deletion for data integrity
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
37 lines
820 B
TOML
37 lines
820 B
TOML
[project]
|
|
name = "ai-assistant-backend"
|
|
version = "0.1.0"
|
|
description = "Personal AI Assistant - Backend"
|
|
requires-python = ">=3.12"
|
|
dependencies = [
|
|
"fastapi>=0.115.0",
|
|
"uvicorn[standard]>=0.30.0",
|
|
"sqlalchemy[asyncio]>=2.0.30",
|
|
"asyncpg>=0.30.0",
|
|
"alembic>=1.13.0",
|
|
"pydantic[email]>=2.9.0",
|
|
"pydantic-settings>=2.5.0",
|
|
"passlib[bcrypt]>=1.7.4",
|
|
"python-jose[cryptography]>=3.3.0",
|
|
"python-multipart>=0.0.9",
|
|
"httpx>=0.27.0",
|
|
"anthropic>=0.40.0",
|
|
"pymupdf>=1.24.0",
|
|
"aiofiles>=24.0.0",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
dev = [
|
|
"pytest>=8.0.0",
|
|
"pytest-asyncio>=0.24.0",
|
|
"httpx>=0.27.0",
|
|
]
|
|
|
|
[build-system]
|
|
requires = ["setuptools>=69.0"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[tool.pytest.ini_options]
|
|
asyncio_mode = "auto"
|
|
testpaths = ["tests"]
|