···11-# Co - Knowledge Management Assistant
11+# co
2233-Co is a single-agent knowledge management assistant built with Letta's memory framework. Each user gets their own persistent Co agent that learns and remembers across conversations.
33+A minimalist chat interface for Letta AI agents. Each user gets their own persistent co agent that learns and remembers across conversations.
4455## Features
6677-- ๐ค **Single Agent Model**: One Co agent per user, tagged with `co-app`
77+- ๐ค **Single Agent**: One co agent per user, automatically created on first login
88- ๐ง **Persistent Memory**: Advanced memory blocks that evolve over time
99-- ๐ฌ **Real-time Streaming**: Token-by-token message streaming
99+- ๐ฌ **Smooth Streaming**: Token-buffered streaming (50 FPS) for consistent text appearance
1010+- ๐จ **Polished UI**: Clean, minimal interface with animated message transitions
1111+- ๐ **Theme Toggle**: Switch between light and dark modes
1012- ๐ง **Tool Support**: Web search, archival memory, conversation search
1113- ๐ฑ **Cross-platform**: iOS, Android, and Web support via React Native + Expo
1212-- ๐จ **Modern UI**: Clean, intuitive interface with memory viewer
1313-- ๐ **Secure**: API token storage with AsyncStorage
1414+- ๐ **Secure**: API token storage with AsyncStorage/SecureStore
14151516## Architecture
16171717-Co uses a simplified single-agent architecture:
1818+co uses a simplified single-agent architecture:
181919201. **Login**: User enters Letta API key
2020-2. **Agent Discovery**: App searches for agent with `co-app` tag using `client.agents.list(tags=["co-app"])`
2121-3. **Agent Creation**: If no Co agent exists, creates one with the `createCoAgent()` function
2222-4. **Chat**: User chats directly with their Co agent
2121+2. **Agent Discovery**: App searches for agent with `co-app` tag
2222+3. **Auto-creation**: If no co agent exists, creates one automatically
2323+4. **Chat**: User chats directly with their co agent
23242424-### Co Agent Configuration
2525+### co Agent Configuration
25262626-Co is created with:
2727+co is created with:
2728- **Model**: `anthropic/claude-sonnet-4-5-20250929`
2829- **Tools**: `send_message`, `archival_memory_insert`, `archival_memory_search`, `conversation_search`, `web_search`, `fetch_webpage`
2930- **Memory Blocks**:
3030- - `persona`: Co's adaptive personality
3131+ - `persona`: co's adaptive personality
3132 - `human`: User profile that evolves
3233 - `approach`: Conversation and memory approach
3334 - `working_theories`: Active theories about the user
···52535354# Start development server
5455npm start
5656+5757+# For production performance (recommended)
5858+npm run web:prod
5559```
56605761### Run Options
···656966701. Launch the app
67712. Enter your Letta API key
6868-3. Wait for Co to initialize (creates agent if needed)
7272+3. Wait for co to initialize (creates agent if needed)
69734. Start chatting!
70747175## Project Structure
72767377```
7474-ion/
7575-โโโ App.tsx # Main Co application
7676-โโโ CoLoginScreen.tsx # Login/authentication screen
7878+co/
7979+โโโ App.tsx # Main application
8080+โโโ CoLoginScreen.tsx # Login/authentication
8181+โโโ web-styles.css # Web-specific CSS for focus states and themes
7782โโโ src/
7883โ โโโ api/
7984โ โ โโโ lettaApi.ts # Letta API client
8085โ โโโ components/
8181-โ โ โโโ MessageContent.tsx
8282-โ โ โโโ ExpandableMessageContent.tsx
8383-โ โ โโโ ToolCallItem.tsx
8484-โ โ โโโ LogoLoader.tsx
8686+โ โ โโโ MessageContent.tsx # Markdown message rendering
8787+โ โ โโโ ExpandableMessageContent.tsx # Collapsible long messages
8888+โ โ โโโ ToolCallItem.tsx # Tool execution display
8989+โ โ โโโ LogoLoader.tsx # Loading animations
8590โ โโโ types/
8691โ โ โโโ letta.ts # TypeScript definitions
8792โ โโโ utils/
8888-โ โ โโโ ionAgent.ts # Co agent creation logic
9393+โ โ โโโ coAgent.ts # co agent creation logic
8994โ โ โโโ storage.ts # AsyncStorage wrapper
9095โ โโโ theme/
9191-โ โโโ index.ts # Design system
9696+โ โโโ index.ts # Theme system
9797+โ โโโ colors.ts # Color palette
9898+โ โโโ typography.ts # Font definitions
9299```
931009494-## Key Files
101101+## Key Features
102102+103103+### Smooth Token Streaming
104104+105105+Messages stream at 50 FPS with a token buffer that releases 1-3 characters at a time for consistent, natural text appearance. A hollow circle indicator (โ) appears at the end of streaming text.
106106+107107+### Animated Message Layout
951089696-### `src/utils/ionAgent.ts`
109109+When you send a message:
110110+1. Message appears at the bottom
111111+2. An animated spacer grows beneath it (400ms animation)
112112+3. Your message smoothly rises to the top of the viewport
113113+4. co's response fills the reserved space below
971149898-Contains the `createCoAgent()` function that defines Co's system prompt, memory blocks, and configuration. This is where you can customize Co's personality and capabilities.
115115+This creates a clean reading experience where your message stays visible with room for the response.
99116100100-### `src/api/lettaApi.ts`
117117+### Theme Support
101118102102-Letta API client with:
103103-- `findAgentByTags()`: Find agent by tags
104104-- `findOrCreateCo()`: Get or create Co agent
105105-- `sendMessageStream()`: Stream messages from Co
106106-- `listAgentBlocks()`: View memory blocks
119119+Toggle between light and dark modes with inverted text input styling:
120120+- **Dark mode**: White background input with black text
121121+- **Light mode**: Black background input with white text
107122108108-### `App.tsx`
123123+### Memory Viewer
109124110110-Main application with:
111111-- Authentication flow
112112-- Co initialization
113113-- Chat interface
114114-- Memory viewer sidebar
115115-- Tool approval modals
125125+Access co's memory blocks through the sidebar to see what co has learned about you and how it's evolving its understanding over time.
116126117117-## Customizing Co
127127+## Customizing co
118128119129### Modify Personality
120130121121-Edit `src/utils/ionAgent.ts` and update:
131131+Edit `src/utils/coAgent.ts` and update:
122132- System prompt
123133- Memory block initial values
124134- Available tools
···137147138148### Change Model
139149140140-Update the `model` field in `createCoAgent()`:
150150+Update the `model` field in `findOrCreateCo()`:
141151142152```typescript
143153model: 'openai/gpt-4.1', // or other supported models
···149159150160- **React Native** + **Expo**: Cross-platform framework
151161- **TypeScript**: Type safety
152152-- **Letta SDK**: AI agent framework
153153-- **AsyncStorage**: Persistent storage
162162+- **Letta SDK** (`@letta-ai/letta-client`): AI agent framework
163163+- **AsyncStorage/SecureStore**: Persistent storage
164164+- **React Native Markdown Display**: Markdown rendering
165165+- **Lexend Font**: Custom typography
154166155167### Available Scripts
156168157169- `npm start` - Start Expo dev server
158158-- `npm run web` - Run in browser
170170+- `npm run web` - Run in browser (dev mode)
159171- `npm run android` - Run on Android
160172- `npm run ios` - Run on iOS
161173- `npx expo start -c` - Clear cache and restart
162174163163-### Building for Production
175175+### Production Build
176176+177177+For better performance:
164178165179```bash
166166-# Web build
167167-npm run build:web
180180+# Development with production optimizations
181181+npx expo start --web --no-dev --minify
168182169169-# Mobile builds (requires EAS CLI)
170170-npx eas build --platform all
183183+# Static production build
184184+npx expo export:web
185185+npx serve web-build
171186```
172187173188## API Integration
174189175175-Co connects to Letta's API:
190190+co connects to Letta's API:
176191177177-- `GET /agents?tags=co-app` - Find Co agent
178178-- `POST /agents` - Create Co agent
192192+- `GET /agents?tags=co-app` - Find co agent
193193+- `POST /agents` - Create co agent
179194- `GET /agents/{id}/messages` - Load message history
180195- `POST /agents/{id}/messages/streaming` - Stream messages
181196- `GET /agents/{id}/blocks` - View memory blocks
···184199185200### Agent Not Found
186201187187-If Co fails to initialize:
188188-1. Check API token validity
202202+If co fails to initialize:
203203+1. Check API token validity at letta.com
1892042. Verify network connection
1902053. Check console logs for errors
206206+4. Try logging out and back in
191207192208### Memory Blocks Not Loading
193209···200216- Check network stability
201217- Verify streaming endpoint support
202218- Review console logs for chunk errors
219219+- Try clearing Expo cache: `npx expo start -c`
203220204204-## Contributing
221221+### Slow Performance
205222206206-Co is a reference implementation. To customize:
207207-208208-1. Fork the repository
209209-2. Modify Co's configuration in `src/utils/ionAgent.ts`
210210-3. Update UI components as needed
211211-4. Test on multiple platforms
212212-5. Submit pull request with clear description
223223+Run the app with production optimizations:
224224+```bash
225225+npx expo start --web --no-dev --minify
226226+```
213227214228## License
215229···218232## Resources
219233220234- [Letta Documentation](https://docs.letta.com)
235235+- [Letta LLMs.txt](https://docs.letta.com/llms.txt)
221236- [React Native Docs](https://reactnative.dev)
222237- [Expo Docs](https://docs.expo.dev)