File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,9 +58,23 @@ C4Context
5858
5959### API Endpoints
6060
61- * `POST /books` — Add a book with title and description; stores embedding in DB
62- * `GET /search?q=your+query` — Search books semantically by query text
63- * `GET /ping` — Health check endpoint
61+ * **`POST /books`**
62+ Add a new book by providing its title and description. The service generates and stores a semantic embedding of the description in the database.
63+
64+ * **`GET /search?q=your+query`**
65+ Perform a semantic search on the stored books using the query text. Returns a list of matching books ranked by relevance.
66+
67+ * **`GET /ping`**
68+ Simple health check endpoint to verify if the service is running.
69+
70+ #### Example Usage
71+
72+ Search for books related to *Science fiction that describe Social Hierarchy*:
73+
74+ ```bash
75+ curl -sG "http://localhost:8080/search" --data-urlencode "q=Science fiction that describe Social Hierarchy" | jq
76+ ```
77+ <img width =" 1331 " height =" 705 " alt =" image " src =" https://github.com/user-attachments/assets/d11a4a23-1260-4809-8416-bcf2986f5154 " />
6478
6579### Setup PostgreSQL
6680
You can’t perform that action at this time.
0 commit comments