An assistant for Farcaster/onchain data
Cortex is an AI assistant built around Farcaster and onchain data to make it easier to find information and take actions. Outputs are optimized to show widgets that the user can use to learn more or take an action directly from the chat(eg. RSVP to an event, take an onchain action, send a message etc).
Built by Dylan Steck
The core foundation of Cortex is built on top of:
- Next.js
- shadcn UI
- Drizzle ORM
- Postgres
- Vercel AI SDK
- OpenAI models(currently GPT-4o and 4o mini)
- Upstash Redis
- NextAuth
Cortex leverages LLM tool calling to power the core of its functionality. The following tools are currently supported:
- Farcaster (using Neynar APIs)
- ENS Data
- Events.xyz
- Bountycaster
- Icebreaker
- Nouns Builder
- Clanker
- Wow
- Tavily
- Open-Meteo
- Zapper
For a further understanding of how the assistant tools are defined / to learn how to add your own tool, check out tools.ts
We welcome contributions of all kinds, especially those that introduce new tools/widgets! Here are the main guidelines for contributing:
- Follow the traditional conventions of the repo(eg: add a new environment variable to
.env.example
if you need to add one, follow the schema for adding other tools, don't add excessive comments, etc) - Check out
tools.ts
for how tools are defined and search the name of a tool to follow its lifecycle(eg. a tool definition, the corresponding API call for it, and the component that handles the UI rendering for that tool) - Open a pull request that succintly describes your changes
- If you need help or have questions, feel free to reach out to me on Farcaster or tag me in a GitHub discussion
Thanks for your support in making Cortex better!
You will need to use the environment variables defined in .env.example
to run Cortex.
Note: You should not commit your
.env
file or it will expose secrets that will allow others to control access to your various OpenAI and authentication provider accounts.
pnpm install
pnpm dev
Cortex should now be running on localhost:3000.
Originally foked from this Next.js AI Chatbot Starter Template