Documentation Index
Fetch the complete documentation index at: https://futureagi.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
JavaScript SDK
The FutureAGI JavaScript/TypeScript SDK provides two primary classes:Annotation for logging annotations via a DataFrame-style interface, and AnnotationQueue for full queue lifecycle management.
Installation
Annotation Class — Log Annotations
Initialize the client
Log annotations
Log annotations using DataFrame-style records. Each record is an object with column keys following the same naming convention as the Python SDK.Get labels
List projects
AnnotationQueue Class — Full Queue Management
TheAnnotationQueue class provides complete programmatic control over the annotation queue lifecycle: creating queues, adding items, assigning work, submitting annotations, and exporting results.
Initialize the client
Create a queue
Add items to a queue
Valid source types
| Source Type | Description |
|---|---|
trace | An LLM trace |
observation_span | A specific span in a trace |
trace_session | A conversation session |
dataset_row | A dataset row |
call_execution | A simulation call |
prototype_run | A prototype run |
Submit annotations
Create scores directly (without queue)
You can create scores against any source without going through a queue workflow.Bulk create scores
Queue lifecycle
Progress and analytics
Export
Complete Method Reference
AnnotationQueue methods
| Method | Description |
|---|---|
create(config) | Create a new queue |
list(options) | List queues |
get(queueId) | Get queue details |
update(queueId, updates) | Update queue configuration |
delete(queueId) | Delete a queue |
activate(queueId) | Set queue status to active |
completeQueue(queueId) | Set queue status to completed |
addLabel(queueId, labelId) | Add a label to a queue |
removeLabel(queueId, labelId) | Remove a label from a queue |
addItems(queueId, items) | Add source items to a queue |
listItems(queueId, options) | List queue items with optional filters |
removeItems(queueId, itemIds) | Remove items from a queue |
assignItems(queueId, itemIds, userId) | Assign items to a user |
submitAnnotations(queueId, itemId, annotations) | Submit annotations for an item |
getAnnotations(queueId, itemId) | Get annotations for an item |
completeItem(queueId, itemId) | Mark an item as completed |
skipItem(queueId, itemId) | Skip an item |
createScore(options) | Create a single score (no queue required) |
createScores(options) | Bulk create scores (no queue required) |
getScores(sourceType, sourceId) | Get scores for a source |
getProgress(queueId) | Get queue completion progress |
getAnalytics(queueId) | Get queue analytics and metrics |
getAgreement(queueId) | Get inter-annotator agreement metrics |
export(queueId, options) | Export annotations as JSON or CSV |
exportToDataset(queueId, options) | Export annotations to a FutureAGI dataset |
Best Practices
- Use
logAnnotations()for bulk SDK-based annotation — The DataFrame-style format is the fastest way to annotate many spans at once. - Use
AnnotationQueuefor programmatic queue management — Create, assign, and complete queues entirely from code. - Use
createScore()/createScores()for direct score creation — Bypass the queue workflow when you need to attach scores to traces directly. - Always handle errors — Check for partial failures in bulk operations. Both
logAnnotationsandaddItemscan succeed for some records and fail for others. - Use TypeScript — All SDK methods are fully typed. TypeScript catches column name typos and invalid configurations at compile time.
Next steps
Python SDK
DataFrame-based annotation logging with the Python SDK.
Scores API
Query and manage annotation scores via the REST API.
Queues API
REST API reference for queue CRUD operations.