To build applications on top of the Foundry platform, you can embed agents into your applications using the Palantir APIs.
Easily build multi-shot interactions with your agents over the API, using its options to:
parameter
previously used in Agent Studio, now available as Application state/variables. Use the parameterInputs
field in requests to provide inputs. Use the parameterUpdates
field for blocking responses (or load the session exchange after streaming) to read custom outputs.For straightforward, single-use tasks that do not need extensive session management, consider using agents as functions. You can access an agent as a function from a third-party application using the Palantir OSDK.
Once you have configured and published your AIP Agent, you can create and configure a Developer Console application to interact with your AIP Agent in a custom application.
To enable your Developer Console application to interact with your AIP Agent using platform APIs, follow the steps in create a new Developer Console application to create a new SDK application with access to Platform SDK resources:
To use an AIP Agent from an Ontology SDK application, you must configure the AIP Agent to only use object types, action types or function types from a single Ontology.
To allow your Developer Console application to create and send messages in conversation sessions with an AIP Agent, you must enable the AIP Agents write permission.
Once you have configured a Developer Console application to allow interaction with an AIP Agent through Platform SDK resources, you will need to update the application if any of the Ontology or platform resources used by your AIP Agent are modified.
For example, if you add any new object types, action types or function types to the AIP Agent, you must add these to the Ontology SDK resources for your application in Developer Console. Similarly, if you add any platform resources to your AIP Agent, such as additional media sets for document context retrieval, you must add these to the Platform SDK resources for your application. Developer Console application resources are not updated automatically when changes occur to the types of resources used by your AIP Agent.
To get started bootstrapping a new application, refer to the documentation examples for TypeScript or Python, or add the SDK to an existing application.
Once you have created your application, use the Create Session platform API to create a new conversation with your AIP Agent.
The Sessions APIs for AIP Agents require you to specify the agentRid
for the AIP Agent to use for conversation session interactions.
You can find this by opening the project for your AIP Agent, selecting the AIP Agent and using the Copy to clipboard option for the RID under Metadata in the file overview.
Once you have created a new session, use the sessionRid
value in the returned response to send a new message to the AIP Agent and get responses using the Blocking continue session
or Streaming continue session
platform APIs. Use the blocking API to wait to receive the full AIP Agent response once it is fully generated, or use the streaming API to receive a stream of the AIP Agent's answer text as it is generated.
You can load conversation metadata for a session using the Get Session
API, and load the history of exchanges (messages sent by your application and responses from the AIP Agent) for a session with the Get Content
API.
Refer to the platform API documentation for code examples on how to use these APIs in your target application language.