supermemory/apps/cf-ai-backend
2024-06-12 23:37:06 -05:00
..
src chat UI and markdown renderer 2024-06-12 23:37:06 -05:00
.gitignore feat: Rewrite backend to hono 2024-05-18 17:32:14 -05:00
package.json feat: Rewrite backend to hono 2024-05-18 17:32:14 -05:00
README.md some documentation for backend 2024-06-11 19:27:13 -05:00
tsconfig.json refactored UI, with shared components and UI, better rules and million lint 2024-05-25 18:41:26 -05:00
vite.config.ts feat: Rewrite backend to hono 2024-05-18 17:32:14 -05:00
wrangler.toml refactored UI, with shared components and UI, better rules and million lint 2024-05-25 18:41:26 -05:00

baseURL: https://new-cf-ai-backend.dhravya.workers.dev

Authentication: You must authenticate with a header and Authorization: bearer token for each request in /api/* routes.

Add content:

POST /api/add with

body {
  pageContent: z.string(),
  title: z.string().optional(),
  description: z.string().optional(),
  space: z.string().optional(),
  url: z.string(),
  user: z.string(),
}

Query without user data

GET /api/ask with query ?query=testing

(this is temp but works perfectly, will change soon for chat use cases specifically)

Query vectorize and get results in natural language

POST /api/chat with

query paramters (?query=...&" {
      query: z.string(),
      topK: z.number().optional().default(10),
      user: z.string(),
      spaces: z.string().optional(),
      sourcesOnly: z.string().optional().default("false"),
      model: z.string().optional().default("gpt-4o"),
    }

body z.object({
  chatHistory: z.array(contentObj).optional(),
});

Delete vectors

DELETE /api/delete with query param websiteUrl, user