Skip to content

Commit c6b9e45

Browse files
committed
initial commit
Signed-off-by: Tyler Slaton <tyler@copilotkit.ai>
0 parents  commit c6b9e45

File tree

21 files changed

+487
-0
lines changed

21 files changed

+487
-0
lines changed

.gitignore

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts
42+
43+
.mastra/
44+
45+
# lock files
46+
package-lock.json
47+
yarn.lock
48+
pnpm-lock.yaml
49+
bun.lockb
50+
51+
# python
52+
agent/venv/
53+
agent/__pycache__/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) Atai Barkai
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# CopilotKit <> Agno Starter
2+
3+
This is a starter template for building AI agents using [Agno](https://agno.com) and [CopilotKit](https://copilotkit.ai). It provides a modern Next.js application with an integrated investment analyst agent that can research stocks, analyze market data, and provide investment insights.
4+
5+
## Prerequisites
6+
7+
- Node.js 18+
8+
- Python 3.8+
9+
- OpenAI API Key (for the Agno agent)
10+
- Any of the following package managers:
11+
- pnpm (recommended)
12+
- npm
13+
- yarn
14+
- bun
15+
16+
> **Note:** This repository ignores lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, bun.lockb) to avoid conflicts between different package managers. Each developer should generate their own lock file using their preferred package manager. After that, make sure to delete it from the .gitignore.
17+
18+
## Getting Started
19+
20+
1. Install dependencies using your preferred package manager:
21+
```bash
22+
# Using pnpm (recommended)
23+
pnpm install
24+
25+
# Using npm
26+
npm install
27+
28+
# Using yarn
29+
yarn install
30+
31+
# Using bun
32+
bun install
33+
```
34+
35+
2. Install Python dependencies for the Agno agent:
36+
```bash
37+
# Using pnpm
38+
pnpm install:agent
39+
40+
# Using npm
41+
npm run install:agent
42+
43+
# Using yarn
44+
yarn install:agent
45+
46+
# Using bun
47+
bun run install:agent
48+
```
49+
50+
3. Set up your OpenAI API key:
51+
```bash
52+
export OPENAI_API_KEY="your-openai-api-key-here"
53+
```
54+
55+
4. Start the development server:
56+
```bash
57+
# Using pnpm
58+
pnpm dev
59+
60+
# Using npm
61+
npm run dev
62+
63+
# Using yarn
64+
yarn dev
65+
66+
# Using bun
67+
bun run dev
68+
```
69+
70+
This will start both the UI and agent servers concurrently.
71+
72+
## Available Scripts
73+
The following scripts can also be run using your preferred package manager:
74+
- `dev` - Starts both UI and agent servers in development mode
75+
- `dev:debug` - Starts development servers with debug logging enabled
76+
- `dev:ui` - Starts only the Next.js UI server
77+
- `dev:agent` - Starts only the Agno agent server
78+
- `build` - Builds the Next.js application for production
79+
- `start` - Starts the production server
80+
- `lint` - Runs ESLint for code linting
81+
- `install:agent` - Installs Python dependencies for the agent
82+
83+
## Documentation
84+
85+
The main UI component is in `src/app/page.tsx`. You can:
86+
- Modify the theme colors and styling
87+
- Add new frontend actions
88+
- Customize the CopilotKit sidebar appearance
89+
90+
## 📚 Documentation
91+
92+
- [Agno Documentation](https://docs.agno.com/introduction) - Learn more about Agno and its features
93+
- [CopilotKit Documentation](https://docs.copilotkit.ai) - Explore CopilotKit's capabilities
94+
- [Next.js Documentation](https://nextjs.org/docs) - Learn about Next.js features and API
95+
- [YFinance Documentation](https://pypi.org/project/yfinance/) - Financial data tools
96+
97+
## Contributing
98+
99+
Feel free to submit issues and enhancement requests! This starter is designed to be easily extensible.
100+
101+
## License
102+
103+
This project is licensed under the MIT License - see the LICENSE file for details.
104+
105+
## Troubleshooting
106+
107+
### Agent Connection Issues
108+
If you see "I'm having trouble connecting to my tools", make sure:
109+
1. The Agno agent is running on port 8000
110+
2. Your OpenAI API key is set correctly
111+
3. Both servers started successfully
112+
113+
### Python Dependencies
114+
If you encounter Python import errors:
115+
```bash
116+
cd agent
117+
pip install -r requirements.txt
118+
```

agent/agent.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
"""Example: Agno Agent with Finance tools
2+
3+
This example shows how to create an Agno Agent with tools (YFinanceTools) and expose it in an AG-UI compatible way.
4+
"""
5+
6+
from agno.agent.agent import Agent
7+
from agno.app.agui.app import AGUIApp
8+
from agno.models.openai import OpenAIChat
9+
from agno.tools.yfinance import YFinanceTools
10+
11+
agent = Agent(
12+
model=OpenAIChat(id="gpt-4o"),
13+
tools=[
14+
YFinanceTools(
15+
stock_price=True, analyst_recommendations=True, stock_fundamentals=True
16+
)
17+
],
18+
description="You are an investment analyst that researches stock prices, analyst recommendations, and stock fundamentals.",
19+
instructions="Format your response using markdown and use tables to display data where possible.",
20+
)
21+
22+
agui_app = AGUIApp(
23+
agent=agent,
24+
name="Investment Analyst",
25+
app_id="investment_analyst",
26+
description="An investment analyst that researches stock prices, analyst recommendations, and stock fundamentals.",
27+
)
28+
29+
app = agui_app.get_app()
30+
31+
if __name__ == "__main__":
32+
agui_app.serve(app="agent:app", port=8000, reload=True)

agent/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
agno>=1.6.3
2+
openai>=1.88.0
3+
yfinance>=0.2.63
4+
fastapi>=0.115.13
5+
uvicorn>=0.34.3
6+
ag-ui-protocol>=0.1.5

eslint.config.mjs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { dirname } from "path";
2+
import { fileURLToPath } from "url";
3+
import { FlatCompat } from "@eslint/eslintrc";
4+
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = dirname(__filename);
7+
8+
const compat = new FlatCompat({
9+
baseDirectory: __dirname,
10+
});
11+
12+
const eslintConfig = [
13+
...compat.extends("next/core-web-vitals", "next/typescript"),
14+
];
15+
16+
export default eslintConfig;

next.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
4+
/* config options here */
5+
};
6+
7+
export default nextConfig;

package.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "agno-starter",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "concurrently \"npm run dev:ui\" \"npm run dev:agent\" --names ui,agent --prefix-colors blue,green --kill-others",
7+
"dev:debug": "LOG_LEVEL=debug npm run dev",
8+
"dev:agent": "cd agent && python agent.py",
9+
"dev:ui": "next dev --turbopack",
10+
"build": "next build",
11+
"start": "next start",
12+
"lint": "next lint",
13+
"install:agent": "cd agent && pip install -r requirements.txt"
14+
},
15+
"dependencies": {
16+
"@ai-sdk/openai": "^1.3.22",
17+
"@ag-ui/agno": "^0.0.1",
18+
"@copilotkit/react-core": "^1.9.1",
19+
"@copilotkit/react-ui": "^1.9.1",
20+
"@copilotkit/runtime": "^1.9.1",
21+
"next": "15.3.2",
22+
"react": "^19.0.0",
23+
"react-dom": "^19.0.0",
24+
"zod": "^3.24.4"
25+
},
26+
"devDependencies": {
27+
"@eslint/eslintrc": "^3",
28+
"@tailwindcss/postcss": "^4",
29+
"@types/node": "^20",
30+
"@types/react": "^19",
31+
"@types/react-dom": "^19",
32+
"concurrently": "^9.1.2",
33+
"eslint": "^9",
34+
"eslint-config-next": "15.3.2",
35+
"tailwindcss": "^4",
36+
"typescript": "^5"
37+
}
38+
}

postcss.config.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const config = {
2+
plugins: ["@tailwindcss/postcss"],
3+
};
4+
5+
export default config;

public/file.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)