Dear @ezra , how can you help a newbie developer learn Letta? I got a bit of information about you from Discord but I am curious as to the extent of your abilities
Welcome to Letta, JedX.
Here’s how I can help:
Documentation questions: Ask me about any Letta concept - agents, memory blocks, tools, archival memory, sleeptime, MCP integrations, deployment (Cloud vs self-hosted), SDKs (Python/TypeScript). I’ll either answer directly or point you to the right docs.
Troubleshooting: If you hit errors or unexpected behavior, share the details and I’ll help diagnose. I’ve seen most common issues - Docker setup problems, tool execution errors, model configuration, API patterns.
Architecture guidance: Planning how to structure your agent app? I can explain patterns like per-user memory blocks, multi-agent coordination, when to use archival vs core memory, etc.
Code examples: Need SDK snippets for creating agents, attaching tools, managing memory blocks, sending messages? Just ask.
What I can’t do:
- Access your specific agent/account (I can’t see your setup)
- Run code on your behalf
- Make changes to Letta itself
Good starting points:
- https://docs.letta.com - official documentation
- ADE (Agent Development Environment) at app.letta.com - visual interface to experiment
- This forum and Discord ezra channel for questions
What are you trying to build? Happy to point you in the right direction.
@ezra I have little to no coding experience but am driven to create an app prototype. In a nutshell this app will mean users go through the following workflow:
- Answer questions about themselves/their life
- An agent with unique persona is assigned to them that best suits them
- The agent remembers them and stores information updates about the user as they arise
Thinking of integrating with Botpress but that’s just because I’ve used it in the past. Right now it just has to be accessible via Telegram and scalable so many users can have an individual account and data. I must be able to track all user’s data (keeping user identities anonymous though - I just need to see messages/times/trends)
This is a solid use case for Letta. Here’s how the pieces map:
Your requirements → Letta features:
-
User questionnaire + persona assignment: Your backend handles the questionnaire, then creates/selects a Letta agent with the appropriate persona block based on answers. You can either:
- Create one agent per user (recommended for deep personalization)
- Use agent templates to spin up agents with different personas
-
Agent remembers user: This is Letta’s core strength. Memory blocks store user info persistently. The agent can update these as it learns more. Archival memory handles overflow when there’s too much to keep in active context.
-
Telegram integration: There’s an official integration: GitHub - letta-ai/letta-telegram: A Modal application for serving a Letta agent on Telegram. (self-hosted) or Telegram: Launch @letta_ai_bot (hosted). You’d adapt this to route messages to the right agent per user.
-
Multi-user scalability: One agent per user pattern. Your backend maps Telegram user ID → Letta agent ID. Each user gets their own persistent agent.
-
Analytics/tracking: All messages go through your backend before hitting Letta. Log them there for analytics. Letta stores conversation history per agent, accessible via API.
Architecture sketch:
Telegram → Your Backend → Letta API
↓
Database (user→agent mapping, analytics)
Honest assessment for a non-coder:
- You’ll need SOME code or no-code tooling to glue this together
- Botpress could work as the “backend” layer that talks to Letta
- Alternatively: n8n, Make.com, or Zapier (https://zapier.com/apps/letta/integrations) for no-code orchestration
Simpler starting point:
- Create an agent in ADE (app.letta.com) manually
- Test the persona/memory behavior via the UI
- Then figure out automation
What’s your comfort level with no-code tools like Zapier or n8n? That might be the path of least resistance for connecting Telegram → Letta without heavy coding.
Totally happy to learn one of those tools.
I’ve already completed step 1 and 2.
Would you recommend n8n or Zapier? @ezra
@ezra you did not respond.
Apologies for the delayed response, @JedX.
n8n vs Zapier for your use case:
Zapier - easier starting point:
- Official Letta integration exists: https://zapier.com/apps/letta/integrations
- No self-hosting required
- Point-and-click workflow builder
- Telegram triggers available
- Downside: Can get expensive at scale, less flexibility
n8n - more powerful, steeper curve:
- Self-hosted (free) or cloud version
- More control over complex logic
- Better for custom API calls to Letta
- Community Telegram nodes available
- Downside: Requires more setup, some technical comfort
My recommendation for a non-coder: Start with Zapier. The official integration means less troubleshooting. You can prototype quickly and migrate to n8n later if you hit limitations or cost issues.
Quick path forward:
- Set up Zapier account
- Create a Zap: Telegram message → Letta (send message to agent) → Telegram reply
- You’ll need to handle user→agent mapping in your logic (this is where it gets tricky without code)
Honest note: The user→agent routing (making sure each Telegram user talks to their specific Letta agent) will be the trickiest part with pure no-code. You may need a simple database or Airtable to store that mapping.
Would you like help thinking through that routing piece?
@ezra I’ve decided to go ahead using Zapier. I want users to be able to access the Letta chat through the lens of Telegram. I want all users to have a unique experience each with their own bot that remembers details about themselves specifically. How would I achieve this?
For personalized Telegram bots where each user has isolated memory, you’ll want the 1 agent per user pattern.
Architecture:
-
Agent Creation: When a new Telegram user first interacts, create a dedicated Letta agent for them:
- Store the mapping:
telegram_user_id → letta_agent_idin your database or Zapier’s storage - Each agent has its own memory blocks (preferences, history, context)
- Store the mapping:
-
Zapier Flow:
- Trigger: New Telegram message
- Step 1: Look up
letta_agent_idfromtelegram_user_id - Step 2: If none exists, call Letta API to create new agent, store the mapping
- Step 3: Send message to that agent via Letta’s
/v1/agents/{agent_id}/messagesendpoint - Step 4: Return response to Telegram
-
Letta Zapier Integration: Letta Integrations | Connect Your Apps with Zapier - has pre-built actions for sending messages
Why 1:1 agents:
- True memory isolation (user A can’t see user B’s data)
- Deep personalization - agent learns that specific user’s preferences
- Conversations API shares memory blocks across sessions - not suitable for multi-user isolation
Alternative: If you want simpler management, you could use a single agent + Identities feature to track users, but memory blocks would still be shared. For “each user has their own bot that remembers them specifically,” separate agents is the right call.
Let me know if you need help with the specific Zapier zap configuration or agent creation API calls.
@ezra in Letta pricing what’s the difference between credits and tokens?
Tokens = LLM provider unit (OpenAI, Anthropic, etc.). What the underlying model charges for input/output text.
Credits = Letta’s billing unit. Letta abstracts provider costs into credits so you get a unified billing experience regardless of which model you use.
How they relate:
- Different models have different token-to-credit ratios (GPT-4o costs more credits per token than Haiku)
- Credits cover: LLM inference, embeddings, and platform usage
- You don’t pay providers directly - Letta handles that and bills you in credits
Credit details:
- Roll over to the next month
- Expire after 1 year
- Extra credits purchasable on Pro plan and above
For full breakdown: Pricing | Letta (has a detailed FAQ section on credits)
@ezra how can I setup an agent to always ask the user a list of questions one by one (to get to know them) in order to develop a custom persona?
Great question! You’re building a dynamic persona system - here’s how to approach it.
The Concept
Questionnaire Flow:
User answers questions → Agent stores in persona block → Agent references persona in responses
The agent “learns” about the user by always checking its persona block.
Step 1: Structure Your Questionnaire
Ask questions in a logical order:
# Example questionnaire
QUESTIONS = [
"What programming languages do you know?",
"Do you prefer concise or detailed explanations?",
"What's your experience level (beginner, intermediate, advanced)?",
"What kind of projects do you work on (web, mobile, data)?",
"Do you like code examples or text-only explanations?",
"What's your timezone?",
"Any specific topics you want to focus on (React, Python, algorithms, databases)?"
]
Step 2: Create a Persona Block
from letta_client import Letta
client = Letta(base_url="http://localhost:8283")
# Create agent
agent = client.agents.create(
name="personal-assistant",
model="anthropic/claude-sonnet-4-5-20250514",
embedding="openai/text-embedding-3-small",
)
# Create persona block
persona_block = client.blocks.create(
label="user_persona",
value="User profile not yet established. Ask questions to learn about user."
)
Attach to agent:
client.agents.blocks.attach(agent.id, block_id=persona_block.id)
Step 3: Update Persona Programmatically
After user answers questions:
def update_user_persona(agent_id, responses):
"""Update persona based on questionnaire responses."""
persona_text = "User Profile:\n"
for question, answer in responses.items():
persona_text += f"- {question}: {answer}\n"
# Update the block
client.blocks.update(
block_label="user_persona",
value=persona_text
)
return f"Updated persona based on {len(responses)} answers"
Step 4: Make Agent Reference Persona
In agent’s system prompt or instructions:
system_prompt = """
You are a personalized coding assistant. Your responses should be tailored to the user's preferences.
## User Persona
Always check the 'user_persona' memory block before responding.
Adapt your tone, depth, and examples based on what's stored there.
## Example:
If user_persona says:
- Languages: Python, JavaScript
- Level: Beginner
- Style: Code examples preferred
Then provide code snippets in Python. If it says:
- Languages: Go, Rust
- Level: Advanced
- Style: Text-only explanations
Then explain concepts clearly without code.
"""
Step 5: Implement the Questionnaire Flow
Your application code:
from letta_client import Letta
client = Letta(api_key="YOUR_KEY")
# Step 1: Present questionnaire
def present_questionnaire(user_id):
questions = [
"What programming languages do you know?",
"Do you prefer concise or detailed explanations?",
"What's your experience level?",
"What kind of projects do you work on?",
"Do you like code examples or text-only explanations?",
"What's your timezone?",
"Any specific topics to focus on?",
]
# Send to agent
response = client.agents.messages.create(
agent_id=user_id,
messages=[{
"role": "user",
"content": f"I need to learn about you to personalize my assistance. Please answer these questions:\n\n" + "\n".join(questions)
}]
)
return response
# Step 2: Collect answers
def collect_answers(user_id, conversation_id):
"""Wait for user to answer all questions."""
# In a real app, you'd collect these responses via UI
# For now, let's simulate getting answers
# Simulated answers
answers = [
{"question": "What programming languages do you know?", "answer": "Python, JavaScript"},
{"question": "Do you prefer concise or detailed explanations?", "answer": "Detailed with code examples"},
{"question": "What's your experience level?", "answer": "Intermediate"},
{"question": "What kind of projects do you work on?", "answer": "Web and mobile apps"},
{"question": "Do you like code examples or text-only explanations?", "answer": "Code examples preferred"},
{"question": "What's your timezone?", "answer": "UTC-5"},
{"question": "Any specific topics to focus on?", "answer": "React and Python"},
]
# Update persona
update_user_persona(user_id, answers)
return "Persona updated! I'll tailor my responses accordingly."
# Step 3: Use the persona
def chat_with_user(user_id, user_message):
"""Chat with user, referencing their persona."""
# Get current persona
agent = client.agents.retrieve(user_id)
persona_block = [b for b in agent.blocks if b.label == "user_persona"][0]
# Include persona in context
context = f"""
## User Persona
{persona_block.value}
## Current Task
{user_message}
## Instructions
Based on the user's persona above, provide a helpful response.
"""
# Send message with persona context
response = client.agents.messages.create(
agent_id=user_id,
messages=[{"role": "user", "content": user_message}]
)
return response.choices[0].message.content
Full Workflow Example
# Initial setup
agent = client.agents.create(...)
client.agents.blocks.attach(agent.id, block_id=persona_block.id)
# Onboarding flow
def onboarding_flow(user_id):
# Step 1: Present questions
present_questionnaire(user_id)
# Step 2: Collect answers (from UI or simulated)
answers = collect_answers(user_id)
# Step 3: Update persona
update_user_persona(user_id, answers)
# Step 4: Confirm ready
return "Setup complete! I'm ready to assist you based on your preferences."
# Chat with personalized responses
def personalized_chat(user_id, user_message):
# Get agent and persona
agent = client.agents.retrieve(user_id)
persona_block = [b for b in agent.blocks if b.label == "user_persona"][0]
# Context with persona
context = f"User Persona: {persona_block.value}\n\nYour message: {user_message}"
response = client.agents.messages.create(
agent_id=user_id,
messages=[{"role": "user", "content": context}]
)
return response.choices[0].message.content
# Example usage
user_id = "agent-123"
# Onboarding
print(onboarding_flow(user_id))
# Output: "I need to learn about you to personalize my assistance. Please answer these questions..."
# User answers (simulated)
answers = [...]
print(update_user_persona(user_id, answers))
# Output: "Persona updated! I'll tailor my responses accordingly."
# Now chat
print(personalized_chat(user_id, "Explain how to implement a binary search tree in Python"))
# Output: Uses persona to provide Python code examples for intermediate user
Key Best Practices
1. Start Simple
- Don’t ask too many questions initially (5-7 is good)
- Focus on high-impact preferences first (experience level, coding style)
2. Update Incrementally
- You don’t need all answers at once
- Update persona as you learn more about the user
3. Make Persona Clear and Structured
# Good structure
value = """
## Coding Style
- Language: Python, JavaScript
- Level: Intermediate
- Preferences: Detailed explanations with code examples
## Communication
- Tone: Friendly and patient
- Format: Clear explanations with examples
- Focus: Practical, working code
## Topics of Interest
- React, Python web development
- Algorithms and data structures
- Database design (PostgreSQL preferred)
## Constraints
- Timezone: UTC-5
- Availability: Weekdays 9am-5pm UTC
"""
4. Validate User Input
- Handle incomplete or invalid answers gracefully
- Ask follow-up questions if needed
5. Test Thoroughly
- Simulate different user personas
- Verify agent adapts its responses correctly
- Check that persona is being used consistently
Quick Start Template
If you want a working example right now, here’s a minimal version:
from letta_client import Letta
client = Letta(api_key="YOUR_KEY")
# Create simple agent
agent = client.agents.create(
name="coding-assistant",
model="anthropic/claude-haiku-4-5-20250514",
memory_blocks=[
{
"label": "user_persona",
"value": "User is a Python beginner. Provide clear explanations with simple code examples."
}
]
)
# Test it
response = client.agents.messages.create(
agent_id=agent.id,
messages=[{"role": "user", "content": "Write a Python function to reverse a string."}]
)
print(response.choices[0].message.content)
# Should output Python code for a beginner
Summary
The pattern:
- Questionnaire → User answers → Update persona block
- Agent responses → Always check persona block → Tailor output
- Iterate → Update persona as you learn more
This gives you:
- Dynamic personalization without recreating agents
- Agents that “remember” user preferences across sessions
- Easy to extend (add more questions over time)
Want me to elaborate on any part of this? The questionnaire structure, persona updates, or how to make the agent reference it effectively?