Creating an AI Agent with Your Own Personality
In this tutorial, we'll explore how to create an AI agent that embodies your own personality using data from your Twitter archive, videos, markdown files, and PDFs. We'll leverage the Characterfile repo and Eliza framework to generate and integrate the character data.
Video: https://youtu.be/uouSdtcWXTQ?si=cm13L4T7DQUMXd0C
Prerequisites​
- Twitter Developer account
- Anthropic API key
- Your Twitter archive (download instructions below)
- (Optional) Videos, markdown files, PDFs about you
Generating Your Character File​
From Twitter Archive​
-
Request your Twitter archive:
- Go to your Twitter settings
- Click "Download an archive of your data"
- Wait to receive the archive (timing depends on your account age/activity)
-
Clone the Characterfile repo:
git clone https://github.com/ai16z/characterfile.git
-
Run the
tweets-to-character
script:npx tweets-to-character path/to/archive.zip
- Select model (e.g. Claude)
- (Optional) Add any additional user information
-
Script will generate a
character.json
file from your Tweets
From Other Files​
-
Put videos, PDFs, text, markdown, images in a folder
-
Run the
folder-to-knowledge
script:npx folder-to-knowledge path/to/folder
-
Run
knowledge-to-character
to add knowledge to your character file
Setting Up the Agent​
-
Clone Eliza repo and check out latest version:
git clone https://github.com/elizaOS/eliza.git
git checkout <latest-tag> -
Install dependencies:
pnpm install
pnpm build -
Add your character JSON file to
characters/
-
Modify character file:
- Add
clients
,modelProvider
,plugins
fields - Remove
voice
field
- Add
-
Set up
.env
with Twitter and Anthropic credentials
Running the Agent​
-
Start agent with your character file:
pnpm start --character characters/yourcharacter.json
-
Agent will log in and post an initial tweet
-
Check your Twitter profile to see the agent in action!
Next Steps​
- Implement dynamic prompting to enhance agent interactions
- Extend agent with additional plugins and integrations