Multi-service software recommendation system built around a FastAPI RAG agent, a Spring Boot orchestration layer, and a React chat UI. The repository is structured for local experimentation with streaming responses, human-in-the-loop confirmation, layered memory, document ingestion, and evaluation tooling.
- Accepts software selection or implementation questions from a chat UI or API.
- Routes requests through a recommendation workflow with skill routing and planning.
- Retrieves evidence from local vector search, keyword search, web search, and memory.
- Supports human confirmation before continuing with generated sub-questions.
- Streams intermediate and final responses over Server-Sent Events.
- Persists conversations, messages, and extracted facts on the Spring side.
fastapi_demo/Primary recommendation engine. Contains the FastAPI app, LangGraph-style workflow, retrieval pipeline, layered memory, startup ingestion, tests, and evaluation scripts.ollama_springboot/demo/Spring Boot backend that fronts the FastAPI service, stores conversation state, exposes task-oriented APIs, and relays streaming responses.ollama_springboot/ollama-gui-reactjs/React frontend used as the main chat UI.scripts/Utility scripts for local model/router startup and model installation.spring_proxy/Small Spring streaming proxy experiment.react_frontend/Minimal frontend streaming prototype.
- Frontend runs on
http://127.0.0.1:3000 - Spring Boot runs on
http://127.0.0.1:8080 - FastAPI runs on
http://127.0.0.1:8000 - Spring Boot calls FastAPI for recommendation execution and session-state sync.
- FastAPI auto-ingests files from
fastapi_demo/ingest_docswhen the Chroma vector store is empty.
- Skill router with domain-specific profiles such as software comparison, architecture design, implementation guidance, and quick fact QA.
- Planner-driven retrieval flow with sub-question generation.
- Human-in-the-loop confirm and confirm-stream endpoints.
- Layered memory with fact, episodic, semantic, and working-memory retrieval.
- Parent-child chunking support for ingestion and retrieval.
- Evaluation scripts for retrieval benchmarks and end-to-end runs.
- Runtime logs written under service-local
.runtime/directories, includingfastapi_demo/.runtime/for startup, embedding, Tavily, and LLM invocation tracing.
- Python 3
- Java 21
- Node.js with
npmoryarn - An OpenAI-compatible or DashScope-compatible LLM/embedding setup for the FastAPI service
Optional but useful:
TAVILY_API_KEYfor web recall- PostgreSQL if you want to run Spring Boot with the
postgresprofile instead of the default in-memory H2 database
From the repository root:
.\start-all.ps1 -InstallDepsAlternatives:
start-all.cmd./start-all.shThe startup script launches:
- FastAPI on port
8000 - Spring Boot on port
8080 - React frontend on port
3000
It also writes started process IDs to .runtime/started-processes.txt.
Review and update:
fastapi_demo/.envfastapi_demo/software_recommend_system/.env
Important settings used by the FastAPI side include:
OPENAI_API_KEYorDASHSCOPE_API_KEYOPENAI_BASE_URLLLM_MODELTAVILY_API_KEYCHROMA_DB_PATHINGEST_PATHENABLE_PARENT_CHILD_CHUNKING
cd fastapi_demo
python -m pip install -r requirements.txt
python main.pyAlternative:
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadHealth check:
http://127.0.0.1:8000/health
cd ollama_springboot\demo
.\mvnw.cmd spring-boot:runNotes:
- Default profile uses in-memory H2.
- The optional
postgresprofile readsDB_URL,DB_USER, andDB_PASSWORD. - H2 console is enabled by default at
http://127.0.0.1:8080/h2-console.
cd ollama_springboot\ollama-gui-reactjs
npm install
npm run startOr:
yarn
yarn startAll /api/v1/* endpoints require an X-API-Key header when API_KEY is set
in fastapi_demo/.env. Leave API_KEY="" for dev (no auth). /initialize-db
is gated behind ADMIN_API_KEY (falls back to API_KEY if unset).
Generate keys:
python -c "import secrets; print(secrets.token_urlsafe(32))"A default 30/minute per-IP limit is applied to every FastAPI route via
slowapi. Tune via RATE_LIMIT_RECOMMEND in fastapi_demo/.env.
The repo ships a .pre-commit-config.yaml with gitleaks and standard
pre-commit hygiene hooks. Enable once:
pip install pre-commit
pre-commit installIf an API key is committed (or shared in chat / screenshots), treat it as compromised: rotate it in the provider dashboard (DashScope, Tavily, OpenAI) before removing it from the file. Removal from disk does not retroactively secure the key.
POST /api/v1/recommendPOST /api/v1/recommend/streamPOST /api/v1/recommend/confirmPOST /api/v1/recommend/confirm/streamGET /api/v1/session-state/{session_id}PUT /api/v1/session-state/{session_id}POST /api/v1/initialize-db(admin only)
POST /api/chatPOST /api/chat/streamPOST /api/chat/confirmPOST /api/chat/confirm/streamPOST /api/v1/conversationsPOST /api/v1/recommendGET /api/conversationsGET /api/session-state/{conversationId}
FastAPI tests are under fastapi_demo/tests/. They cover areas such as routing, planner logic, retrieval channels, memory store behavior, parent-child chunking, and evaluation metrics.
Run the test suite with the standard library test runner:
python -m unittest discover -s fastapi_demo\tests -p "test_*.py"Evaluation utilities live in fastapi_demo/evaluation/, including:
- retrieval benchmark scripts
- smoke and real end-to-end evaluation scripts
- LangSmith export/evaluation helpers
fastapi_demo/main.py,spring_proxy/, andreact_frontend/are smaller streaming-focused experiments and are not the main production path in this repository.- The main end-to-end path is: React UI -> Spring Boot -> FastAPI -> retrieval/LLM pipeline.
- Additional project notes and Chinese-language startup/process docs are in files such as
启动教程.md,workflow.txt, and the design guides in the repository root.
fastapi_demo/README.md启动教程.mdworkflow.txtprogress_report.md