gittech. site

for different kinds of informations and explorations.

Pica – Open-Source Rust SDK for Just-in-Time AI Tool Integration

Published at
Feb 5, 2025

Pica Logo

The Complete Agentic Infrastructure

Website Β· Documentation Β· Community Hub Β· Changelog Β· X Β· LinkedIn


Effortlessly build, deploy, and scale AI agentsβ€”Pica provides everything you need to power autonomous AI workflows.

Why Pica?

Pica simplifies AI agent development with our four core products:

βœ… OneTool – A single SDK to connect AI agents to 100+ APIs and tools.
βœ… AuthKit – Secure authentication for seamless tool integration.
βœ… Agent (Coming Soon) – Build adaptive AI agents tailored to your needs.
βœ… AgentFlow (Coming Soon) – Enable agents to collaborate and automate workflows.

Pica also provides full logging and action traceability, giving developers complete visibility into their agents' decisions and activities.

Getting started

Install

npm install @picahq/ai

Setup

  1. Create a new Pica account
  2. Create a Connection via the Dashboard
  3. Create an API key
  4. Set the API key as an environment variable: PICA_SECRET_KEY=<your-api-key>

Example Usage

Below is an example demonstrating how to integrate the Pica OneTool with the Vercel AI SDK for a GitHub use case:

import { openai } from "@ai-sdk/openai";
import { generateText } from "ai";
import { Pica } from "@picahq/ai";
import * as dotenv from "dotenv";
dotenv.config();

const pica = new Pica(process.env.PICA_SECRET_KEY!);

async function runAgentTask(message: string): Promise<string> {
  const system = await pica.generateSystemPrompt();

  const { text } = await generateText({
    model: openai("gpt-4o"),
    system,
    prompt: message,
    tools: { ...pica.oneTool },
    maxSteps: 10,
  });

  return text;
}

runAgentTask("Star the repo picahq/pica with github")
  .then((text) => {
    console.log(text);
  })
  .catch(console.error);

Try with Replit Badge

For more use cases, visit our Use Cases Library or our Awesome Pica Repository.

Next.js Integration

⭐️ You can see a full Next.js demo here

For more examples and detailed documentation, check out our SDK documentation.


Running Pica locally

[!IMPORTANT] The Pica dashboard is going open source! Stay tuned for the big release πŸš€

Prerequisites

Step 1: Install the Pica CLI

npm install -g @picahq/cli

Step 2: Initialize the Pica CLI

To generate the configuration file, run:

pica init

Step 3: Start the Pica Server

pica start

All the inputs are required. Seeding is optional, but recommended when running the command for the first time.

Example
# To start the docker containers
pica start
Enter the IOS Crypto Secret (32 characters long): xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Do you want to seed? (Y/N) y

The Pica API will be available at http://localhost:3005 πŸš€

To stop the docker containers, simply run:

pica stop

License

Pica is released under the GPL-3.0 license.