Tensor
v0.3.1

Agents

Agents are the core entities in Tensor that perform tasks and interact with users. An agent is essentially an AI model with a set of skills and a configuration that determines its behavior.

Agent Architecture

Each agent in Tensor has the following components:

  • Model: The underlying AI model (e.g., GPT-4, Claude, etc.)
  • System Prompt: Initial instructions that define the agent's behavior
  • Skills: Capabilities that allow the agent to perform specific tasks
  • Workflows: Sequences of operations that the agent can execute
  • Knowledge Base: Information that the agent can access and utilize

Creating an Agent

To create an agent, you need to:

  1. Provide a name and description
  2. Select an AI model
  3. Define a system prompt
  4. Optionally configure additional settings like temperature

Agent Isolation

Tensor implements strict agent isolation to ensure security and performance:

  • Each agent gets its own database schema
  • Agents cannot access each other's data unless explicitly allowed
  • Skills and workflows are sandboxed to their respective agents

Agent Configuration

System Prompt

The system prompt is the initial instruction set given to the agent. It defines:

  • The agent's role and personality
  • Constraints and limitations
  • Response formatting preferences
  • Task-specific instructions

Example system prompt:

You are a customer service agent for Acme Corporation.
Always be polite and helpful.
When asked about products, reference the knowledge base.
Format currency values with two decimal places and include the currency symbol.

Model Parameters

You can configure various parameters for the AI model:

  • Temperature: Controls randomness (0.0 to 2.0)
  • Top P: Controls diversity via nucleus sampling
  • Max Tokens: Maximum response length
  • Frequency Penalty: Reduces repetition
  • Presence Penalty: Encourages the model to cover new topics

Agent Monitoring

Tensor provides comprehensive monitoring for agents:

  • Request and response logging
  • Performance metrics
  • Error tracking
  • Usage statistics

Best Practices

For effective agent design:

  1. Be specific in system prompts: Clearly define the agent's role and constraints
  2. Start with lower temperatures: Use 0.2-0.5 for more predictable responses
  3. Use skills for complex tasks: Don't rely on the model for specialized functions
  4. Implement proper error handling: Catch and process errors in workflows
  5. Test with diverse inputs: Ensure your agent handles various scenarios correctly

Next Steps

  • Learn about Skills to enhance your agent's capabilities
  • Explore Workflows for complex automation
  • Set up a Knowledge Base to provide reference information to your agent