Status:
Archived / Maintenance ModePurpose: portfolio demonstration (architecture + engineering execution).
License: LICENSE and PORTFOLIO_NOTICE.md
FastAPI backend for Raycast-focused quick Q&A workflows, built with Azure OpenAI, SQLite, and Qdrant.
Main goals:
- Low-latency daily Q&A
- Stable streaming behavior
- Controlled optional deep reasoning
- Practical long-term memory retrieval
This public repository intentionally excludes local/private operational assets:
scripts/(local ops scripts)tests/(private/internal validation set).env, local data files, and local archives
Use PUBLIC_RELEASE_CHECKLIST.md before publishing updates.
- Chat APIs
POST /api/chat/message(non-streaming)POST /api/chat/stream(SSE streaming)
- Strategy pipeline
autoandmanualstrategy modes- task-based decisions for deep thinking, web search, and long-term memory retrieval
- Memory system
- SQLite for conversation history
- Qdrant for semantic long-term memory and negative-feedback memory
- Runtime diagnostics
GET /api/chat/runtime/healthGET /api/chat/memory/health
- Feedback loop
POST /api/chat/feedback
- Primary stream transport: Azure/OpenAI
v1 /responses- incremental event:
response.output_text.delta - completion event:
response.completed(with[DONE]fallback support)
- incremental event:
- Compatibility behavior:
- emits legacy mirror
chunk/errorevents for older clients - automatically falls back to
v1 /chat/completionswhenresponsesis unsupported (typical400/404/422)
- emits legacy mirror
- Response headers:
X-Conversation-IdX-Stream-Deep-Thinking-Applied
Current extension request mode:
- always sends
strategy_mode="manual" - exposes two toggles only:
Deep ThinkingWeb Search
System:
GET /GET /api/healthGET /health(alias)
Conversation:
POST /api/chat/messagePOST /api/chat/streamGET /api/chat/conversationsGET /api/chat/conversations/{conversation_id}DELETE /api/chat/conversations/{conversation_id}
Strategy / Runtime:
GET /api/chat/reasoning-statsPOST /api/chat/strategy/previewGET /api/chat/runtime/health
Memory / Feedback:
GET /api/chat/memory/healthGET /api/chat/memory/statsGET /api/chat/memory/listGET /api/chat/memory/searchDELETE /api/chat/memory/reset(ALLOW_MEMORY_RESET=truerequired)POST /api/chat/feedback
Required:
AZURE_OPENAI_ENDPOINTAZURE_OPENAI_API_KEYAZURE_OPENAI_DEPLOYMENT_NAMEAZURE_OPENAI_EMBEDDING_DEPLOYMENT
Model routing defaults:
DEFAULT_MODEL=gpt-5.1-chatCS_SPECIALIST_MODEL=DeepSeek-R1-0528
See .env.example for full settings.
Local:
uv sync
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadDocker:
docker compose up -d --buildHealth checks:
curl http://127.0.0.1:8000/api/health
curl http://127.0.0.1:8000/api/chat/runtime/health
curl http://127.0.0.1:8000/api/chat/memory/healthraycast/
├── app/
├── Raycast_Extension/
├── docker-compose.yml
├── Dockerfile
├── pyproject.toml
├── requirements.txt
├── uv.lock
├── ARCHITECTURE.md
├── METRICS.md
├── PUBLIC_RELEASE_CHECKLIST.md
├── PORTFOLIO_NOTICE.md
├── LICENSE
└── README.md
本プロジェクトは、Raycast 向けの高速 Q&A 用バックエンドです。
技術スタックは FastAPI + Azure OpenAI + SQLite + Qdrant です。
目的:
- 日常利用での低遅延応答
- 安定したストリーミング
- 必要時のみ深い推論を有効化
- 実用的な長期記憶の再利用
この公開スナップショットには、以下のローカル資産は含めていません:
scripts/(ローカル運用スクリプト)tests/(内部検証用).env、ローカルデータ、ローカルアーカイブ
公開前チェックは PUBLIC_RELEASE_CHECKLIST.md を参照してください。
- 対話 API
POST /api/chat/message(非ストリーミング)POST /api/chat/stream(SSE ストリーミング)
- 戦略パイプライン
auto/manualモード- タスク特性に応じて deep thinking / web search / 長期記憶参照を制御
- 記憶
- 会話履歴: SQLite
- 長期記憶・負フィードバック記憶: Qdrant
- 運用診断
GET /api/chat/runtime/healthGET /api/chat/memory/health
- フィードバック
POST /api/chat/feedback
- 主経路: Azure/OpenAI
v1 /responses- 増分イベント:
response.output_text.delta - 完了イベント:
response.completed([DONE]フォールバック対応)
- 増分イベント:
- 互換性対策:
- 旧クライアント向けに
chunk/errorミラーイベントを出力 responses非対応時(主に400/404/422)はv1 /chat/completionsに自動フォールバック
- 旧クライアント向けに
- レスポンスヘッダ:
X-Conversation-IdX-Stream-Deep-Thinking-Applied
- リクエストは常に
strategy_mode="manual"を送信 - UI のトグルは 2 つのみ:
Deep ThinkingWeb Search
ローカル:
uv sync
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadDocker:
docker compose up -d --buildヘルスチェック:
curl http://127.0.0.1:8000/api/health
curl http://127.0.0.1:8000/api/chat/runtime/health
curl http://127.0.0.1:8000/api/chat/memory/health