Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
00ce6e2
refactor: reorganize Pinecone integration with hybrid search and memo…
techwithanirudh Jul 27, 2025
a84a66c
refactor: reorganize pinecone code into dedicated module with improve…
techwithanirudh Jul 27, 2025
641ba49
refactor: reorganize pinecone code into dedicated module with improve…
techwithanirudh Jul 27, 2025
5a3ccb1
refactor: reorganize pinecone code into dedicated module with improve…
techwithanirudh Jul 27, 2025
4e871a7
refactor: replace BM25 hybrid search with memory query system using P…
techwithanirudh Jul 27, 2025
bb3ae73
refactor: consolidate memory operations into dedicated modules with i…
techwithanirudh Jul 27, 2025
5c68624
feat: implement memory querying with age filters and metadata updates
techwithanirudh Jul 27, 2025
c58d75b
chore: fix typos, formatting and import order across documentation an…
techwithanirudh Jul 27, 2025
6d34e1c
feat: store chat history in Pinecone after successful bot responses
techwithanirudh Jul 27, 2025
09510a5
feat: add getUserInfo tool for fetching Discord user details
techwithanirudh Jul 27, 2025
ee1bd50
feat: add searchMemories tool and store guild/channel context in memo…
techwithanirudh Jul 27, 2025
6c2ab8a
refactor: remove hash field from memory metadata and search results
techwithanirudh Jul 27, 2025
bf8a358
feat: improve prompt security and reduce typing delay for faster resp…
techwithanirudh Jul 27, 2025
aa9ed10
feat: improve prompt security and reduce typing delay for faster resp…
techwithanirudh Jul 27, 2025
f86c2a7
feat: add message reactions and switch MinimalContext to Message type
techwithanirudh Jul 28, 2025
95cf974
chore: remove unused message type definitions
techwithanirudh Jul 28, 2025
5bc603a
feat: add HTTP error handling for attachments and expand model fallba…
techwithanirudh Jul 28, 2025
95b85b3
refactor: update error logging, import paths and prompt guidelines ac…
techwithanirudh Jul 28, 2025
9d8d203
feat: increase rate limit, add search logging and improve prompt clarity
techwithanirudh Jul 28, 2025
43d6944
refactor: split prompts into separate modules and add memory tool fun…
techwithanirudh Jul 28, 2025
56f6fc2
feat: improve image attachment handling and fix message prefix stripping
techwithanirudh Jul 28, 2025
2bf46e6
style: capitalize 'DO NOT' for consistency in core prompt text
techwithanirudh Jul 28, 2025
1478770
feat: improve message handling with ping validation and zero delay re…
techwithanirudh Jul 28, 2025
e06efc1
feat: add Docker support and update core prompts and message handling
techwithanirudh Jul 28, 2025
829ae66
feat: add Python3 installation to Docker base image
techwithanirudh Jul 28, 2025
2c433b0
feat: add Python3 installation to Docker base image
techwithanirudh Jul 28, 2025
d3dfa45
fix: disable preinstall scripts during production dependency installa…
techwithanirudh Jul 28, 2025
d2c8a61
fix: update bun install flags to use --ignore-scripts instead of BUN_…
techwithanirudh Jul 28, 2025
960c7b3
fix: copy entire app directory from builder stage instead of individu…
techwithanirudh Jul 28, 2025
39aa61b
feat: create logs directory with write permissions in Docker container
techwithanirudh Jul 28, 2025
274706c
feat: add HTTP error handling for attachments and expand model fallba…
techwithanirudh Jul 29, 2025
8a96357
docs: clarify user message format and bot response guidelines in core…
techwithanirudh Jul 29, 2025
110c982
feat: implement tool call memory storage and auto-create Pinecone index
techwithanirudh Jul 29, 2025
f6fc38b
refactor: improve pinecone metadata validation with zod schema and JS…
techwithanirudh Jul 29, 2025
67ffb52
refactor: standardize memory context storage and retrieval in Pinecone
techwithanirudh Jul 29, 2025
1875741
refactor: move context field from base metadata to chat-specific schema
techwithanirudh Jul 29, 2025
552f22d
refactor: update pinecone queries to use namespace and standardize ti…
techwithanirudh Jul 29, 2025
784b797
refactor: update pinecone queries to use namespace and standardize ti…
techwithanirudh Jul 29, 2025
bc94a39
refactor: move queryMemories function to dedicated operations file an…
techwithanirudh Jul 29, 2025
309f08b
refactor: implement namespaced logging system with createLogger factory
techwithanirudh Jul 29, 2025
39dd0e4
refactor: migrate to scoped logger instances with createLogger factory
techwithanirudh Jul 29, 2025
3eb9c83
chore: downgrade memory operation log levels from info to debug
techwithanirudh Jul 29, 2025
295fd1f
chore: optimize Dockerfile by consolidating apt commands and removing…
techwithanirudh Jul 29, 2025
6a8ab89
feat: enhance message relevance detection with improved examples and …
techwithanirudh Jul 29, 2025
05dc352
feat: enhance message relevance detection with improved examples and …
techwithanirudh Jul 30, 2025
a2e95e3
feat: enhance message relevance detection with improved examples and …
techwithanirudh Jul 30, 2025
e69ba2c
feat: enhance message relevance detection with improved examples and …
techwithanirudh Jul 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@
"livecrawl",
"grok",
"gork",
"imgork",
"dalle",
"dall",
"arcas",
"techwithanirudh",
"selfbot",
"shitposter",
"cynicist",
"autobotting"
"autobotting",
"dotproduct",
"rerankinig",
"textembbeding",
"lefthook"
]
}
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DISCORD_DEFAULT_GUILD_ID=your_discord_default_guild_id_here
OPENAI_API_KEY=your_openai_api_key_here
# HACKCLUB_API_KEY=your_hackclub_api_key_here
# OPENROUTER_API_KEY=your_openrouter_api_key_here
# COHERE_API_KEY=your_cohere_api_key_here

# ---------------------------------------------------------------------------------------------------------
# Redis
Expand Down
38 changes: 38 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# use the official Bun image
# see all versions at https://hub.docker.com/r/oven/bun/tags
FROM oven/bun:1 AS base
WORKDIR /usr/src/app

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl git sudo python3 python3-pip make \
&& rm -rf /var/lib/apt/lists/*

# install dependencies into temp directory
# this will cache them and speed up future builds
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lock /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile

# install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod
COPY package.json bun.lock /temp/prod/
RUN cd /temp/prod && bun install --production --ignore-scripts --frozen-lockfile

# copy node_modules from temp directory
# then copy all (non-ignored) project files into the image
FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .

# copy production dependencies and source code into final image
FROM base AS release
COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /usr/src/app .
RUN mkdir -p logs \
&& chmod 0777 logs

# run the app
USER bun
ENTRYPOINT [ "bun", "run", "start" ]
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
2. 🚀 [Tech Stack](#tech-stack)
3. 📚 [Getting Started](#getting-started)
4. 🧠 [Memory](#memory)
4. 📝 [License](#license)
5. 📝 [License](#license)

## <a name="introduction">🤖 Introduction</a>

Expand Down Expand Up @@ -55,6 +55,7 @@ Set the `PINECONE_API_KEY` environment variable to your Pinecone API key.
Then, create a Pinecone index and set the `PINECONE_INDEX` environment variable to the name of your Pinecone index.

Spec:

- Pinecone index should be dense
- Dimension: 1536
- Metric: dotproduct
Expand Down
42 changes: 38 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,42 @@ Add context to when the bot is triggered—for example, whether it’s due to a

Switch from Mem0 (free, limited plan) to a more efficient memory system like Pinecone or another vector store. Implement a better memory workflow with both long-term and short-term memory. This way, the bot can retain conversation history, summarize previous messages, and maintain context over time.

Look into CrewAI or build your own custom memory system (a custom approach is likely more flexible). The goal is for Zenix to be more tightly integrated with both voice chat and text messages.

Zenix should have unified memory per user across all servers—not separate memories per server. That way, the bot always remembers the same person no matter where they interact with it.
Fix commands (broken on autobotting)
Cleanup memory part later
Cleanup memory part later

use lefthook instead of husky

Add tool calling to memory, also use a FIFO queue instead of async sending and calculate WPM + ai response assumptions
Properly refactor the memory system with querying like B does it
Cleanup the code a bit
Implement the BM25 thing
give llm choice to reply or to generally not

When pinging users mention @username then convert it to user ID like frank
Improve system prompt to include tools
When there is an attachment which it cant see add Right now it just adds [Attachments: png, zip, png, png] for each file attached
when if it is not a type it can process, remove all blank stuff messages (https://github.com/DomBom16/frank/blob/main/src/utils/aiResponse.ts)
convert status or whatever in discord the yellow white block to text like frank
Also another issue is the build context thing's reference replies are broken

Refactor the ping system, the bot pings random people and doesn't know who is who
Add edit delete messages functionality for gork, meaning it can understand when messages were edited and also edit it's own messages liek Frank

Refactor logging system with child loggers

Refactor the adding metadata so guild and channel are not strings, and are JSON but the retrieval converts JSON to string and vice versa

Implement text management logic like https://github.com/Giantpizzahead/bob-bot/blob/6574d0e988d6249c8df2a72179503e0d16f95a3c/src/bobbot/discord_helpers/text_channel_history.py#L127
Do not INGEST the searchMemories tool when using addTool
Give the AI Ability to use custom filters to searchMemories through tool calling, and ask it to use the info in the first searchMemories calls to call the second one, say that serve rnames etc are very important also give it what metadta params it has
Give it the ability to raise a feature request which opens a jira ticket
Have a custom memory manager like text channel history
Improve logging to add a debug mode or reduce excessive loggin

The bot has a habit of not replying to the designated message
Input what activity the bot is performing, and add more set of activites
Add debug tools like bob
Add a agent before tasks which checks if it is a command or prompt inj
Add a database (drizzle) with statistics on chat with servers

Have a mode called selfbot and real bot, selfbot doesn't have commands etc, newinfra wow
41 changes: 23 additions & 18 deletions VECTOR.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# Vector
Let's use Pinecone for the following:
1. As we use the AI SDK, we will use OpenAI compatible models for embedding, like embedding large (use models, embedding in models.ts), same with searching for data.
2. We use a dense index in Pinecone for semantic search, matching the output of modern embedding models and the bot's use case. (https://docs.pinecone.io/guides/index-data/create-an-index#bring-your-own-vectors), include metdata like timestamp, user, server, channel, etc. So when searching we can limit the search to a specific server, channel, etc. (https://docs.pinecone.io/guides/search/filter-by-metadata#search-with-a-metadata-filter)
3. We do NOT need to chunk the data as discord messages are already short and concise.
4. When a message is deleted or edited, we should remove the embedding from the index, or update it. (https://docs.pinecone.io/guides/index-data/data-modeling#delete-chunks, https://docs.pinecone.io/guides/index-data/data-modeling#update-chunks). Have a way to easily connect message and embedding id.
5. After all this we can upsert the embeddings to the index. (https://docs.pinecone.io/guides/index-data/upsert-data#upsert-dense-vectors) (https://docs.pinecone.io/guides/index-data/indexing-overview#bring-your-own-vectors)
6. Setup a hybrid search index (https://docs.pinecone.io/guides/search/hybrid-search#use-a-single-hybrid-index)

# Searches
- When searching have a sophisticated algo (bob), check through server, recent messages, and a lot of context aswell so we get the data. w/metadata timeframes, users etc. (https://docs.pinecone.io/guides/get-started/quickstart#5-semantic-search)


# TODO
Learn about namespaces
Learn about rerankinig (https://docs.pinecone.io/guides/get-started/quickstart#6-rerank-results)
Look at bob code (https://docs.pinecone.io/guides/get-started/quickstart#7-improve-results)
Look at AI SDK pinecone example so we can implement it
# Vector

Let's use Pinecone for the following:

1. As we use the AI SDK, we will use OpenAI compatible models for embedding, like embedding large (use models, embedding in models.ts), same with searching for data.
2. We use a dense index in Pinecone for semantic search, matching the output of modern embedding models and the bot's use case. (https://docs.pinecone.io/guides/index-data/create-an-index#bring-your-own-vectors), include metadata like timestamp, user, server, channel, etc. So when searching we can limit the search to a specific server, channel, etc. (https://docs.pinecone.io/guides/search/filter-by-metadata#search-with-a-metadata-filter)
3. We do NOT need to chunk the data as discord messages are already short and concise.
4. When a message is deleted or edited, we should remove the embedding from the index, or update it. (https://docs.pinecone.io/guides/index-data/data-modeling#delete-chunks, https://docs.pinecone.io/guides/index-data/data-modeling#update-chunks). Have a way to easily connect message and embedding id.
5. After all this we can upsert the embeddings to the index. (https://docs.pinecone.io/guides/index-data/upsert-data#upsert-dense-vectors) (https://docs.pinecone.io/guides/index-data/indexing-overview#bring-your-own-vectors)
6. Setup a hybrid search index (https://docs.pinecone.io/guides/search/hybrid-search#use-a-single-hybrid-index)

# Searches

- When searching have a sophisticated algo (bob), check through server, recent messages, and a lot of context as well so we get the data. w/metadata timeframes, users etc. (https://docs.pinecone.io/guides/get-started/quickstart#5-semantic-search)

# TODO

Learn about namespaces
Learn about rerankinig (https://docs.pinecone.io/guides/get-started/quickstart#6-rerank-results)
Look at bob code (https://docs.pinecone.io/guides/get-started/quickstart#7-improve-results)
Look at AI SDK pinecone example so we can implement it

3-large-textembbeding
Loading