Documentation
Rest API references
For the full and updated reference list please refer to https://docs.circlemind.co/api-reference.
Introduction
The Circlemind REST API allows you to interact with our platform programmatically. You can use the API to perform various operations such as creating, reading, updating, and deleting resources.
Base URL
All API requests are made to the following base URL:
Authentication
The API uses api key authentication. You need to include your API key in the apiKey
header of each request:
Response Format
All responses are in JSON format.
Error Handling
The API uses standard HTTP status codes to indicate the success or failure of a request. A 2xx status code indicates success, while a 4xx or 5xx status code indicates an error. The response body will include an error message with more details (.detail
).
Example Request
Here is an example of a request to fetch the list of your graphs:
All requests, except add and query, immediately return a response.
Adding and Quering Memories
After creating a graph, the two most important operations are add and query. Both operations send a request to our workers that get switfly processed and can be tracked until completion.
Add Request
In order to perform a memory addition, we need to send an add
request to the workers. The processing is asynchronous and can be optionally tracked until completion.
Query Request
Similarly, here is an example of how to query using the CircleMind API in JavaScript:
In this example:
-
Replace
YOUR_API_KEY
with your actual API key. -
Replace
your_graph_name
with the name of your graph. -
The
query
field should contain your query. -
The
parameters
field is an optional JSON string that can include:-
only_context
: Set totrue
to return only the context of the query instead of processing it via an LLM. -
with_references
: Set totrue
to include references in the response. -
entities_max_tokens
,relations_max_tokens
,chunks_max_tokens
to control the maxmimum amount of tokens allowed in the context. Check the sdk documentation for more information.
-
To get the answer, we track the status of the query
request. Upon completion, the querying result can be found in answer
(the LLM generated answer) and context
(the context passed to the LLM).
Note that the same procedure can be used to track add
requests using the endpoint https://api.circlemind.co/graph/{graph_name}/insert/{request_id}
.
For more detailed information on each endpoint, refer to the full API reference at https://docs.circlemind.co/api-reference.