Skip to content

Commit

Permalink
How to make ai agents safer
Browse files Browse the repository at this point in the history
  • Loading branch information
sabaimran committed Oct 25, 2024
1 parent 311e98d commit 45ff68f
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 33 deletions.
Binary file added public/ballot_info_processor_agent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/network_lock_cropped.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion src/content/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const posts = defineCollection({
pubDate: z.coerce.date(),
updatedDate: z.coerce.date().optional(),
heroImage: z.string().optional(),
tldr: z.string().optional(),
author: z.string(),
keywords: z.array(z.string()).optional(),
}),
Expand Down
3 changes: 1 addition & 2 deletions src/content/posts/10k-stars-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
title: "10000 Stars Later"
author: saba
description: Reflecting back on the last few years of building Khoj, how we got here and the lessons we learnt along the way.
tldr: "The article chronicles the evolution of Khoj from a personal search engine to a cloud-scale personal AI with ability to paint, research online, provide specialized personas & run autonomously. It emphasizing key lessons learned in building an open-source company like prioritizing community engagement and iterative development to build human aligned AI."
heroImage: /blue_wave.png
pubDate: 2024-06-17
keywords: ["personal AI", "open-source", "community engagement"]
keywords: ["personal AI", "open-source", "community"]
---
## The Khoj Journey So Far

Expand Down
1 change: 0 additions & 1 deletion src/content/posts/ai-risks-safety-and-mitigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: "Personal AI must be open-source"
author: saba
description: Exploring the necessity of open-source frameworks in the development of personal AI to ensure trust, transparency, and user empowerment.
tldr: "The article discusses the limitations and concerns of proprietary personal AI services, using Google's AI assistant Gemini as a case study for censorship and bias in AI outputs. It argues for the necessity of open-source AI to ensure transparency, trust, and user control, highlighting Khoj's approach to open-source development as a model for creating ethical and user-empowering personal AI tools."
heroImage: /futuristic_green_utopia.png
pubDate: 2024-02-28
keywords: ["AI", "open-source", "safety", "trust", "personal AI"]
Expand Down
1 change: 0 additions & 1 deletion src/content/posts/how-khoj-generates-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: "How We Generate Personalized Images"
author: saba
description: Khoj offers a unique approach to generating images that are personalized to the user's preferences and context.
tldr: "Khoj personalizes content creation, particularly images, by using a Retrieval Augmented Generation (RAG) system. It enhances the interaction with large language models (LLMs) by incorporating your personal data, internet-sourced information, and cultural context to produce images that are meaningful and relevant to you."
heroImage: /pacific_coast_highway.png
pubDate: 2024-03-09
keywords: ["images", "personalization", "RAG", "AI"]
Expand Down
1 change: 0 additions & 1 deletion src/content/posts/how-to-use-automations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: "Automations for Personalized Newsletters, Reminders, and More"
author: saba
description: A brief tutorial on how to use Khoj's Automations feature
tldr: "Automations help you get repetitive tasks out of the way and curate more personalized content to stay focused."
heroImage: /nature_futurism.png
pubDate: 2024-06-14
keywords: ["automations", "AI newsletters", "personalized reminders"]
Expand Down
1 change: 0 additions & 1 deletion src/content/posts/khoj-ai-personal-accountant.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: "Khoj as My Personal AI Accountant"
author: debanjum
description: Learn how I use Khoj to keep my account synced and maintain an up-to-date view into all my finances.
tldr: "This post shares my personal workflow to do plaintext accounting using the Khoj app and API. I hope it inspires folks to create advanced, tailored AI workflows and share them to help everyone learn how to use these tools better."
heroImage: /ai_accountant_abstract.webp
pubDate: 2024-10-04
keywords: ["ai accountant", "plaintext accounting", "workflows"]
Expand Down
1 change: 0 additions & 1 deletion src/content/posts/new-ux-fresh.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: "Springing forward in our web stack"
author: saba
description: Khoj recently migrated to Next.js with static site generation, refreshing our front-end and paving the way for future scalability.
tldr: Khoj transitioned from a bespoke web stack using FastAPI, Django, and plain HTML/CSS/JS to a modern framework with Next.js, Tailwind, and Shadcn. This migration addressed development bottlenecks, improved scalability, and resulted in a significant UI upgrade, demonstrating the importance of evolving technology choices as a product grows.
heroImage: /abstract_orange_blue_dots.png
pubDate: 2024-08-07
keywords: ["front-end", "web stack", "UIUX"]
Expand Down
1 change: 0 additions & 1 deletion src/content/posts/obsidian-ux-revamp.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: "Extend your Second Brain in Obsidian with AI"
author: saba
description: The Khoj AI assistant now lives in the side panel of Obsidian, allowing you to stay in context while augmenting your digital brain.
tldr: "Khoj AI in Obsidian now features a side panel for seamless in-document assistance and a button for easy text integration, enhancing its compatibility with Obsidian's local-first philosophy and maintaining options for cloud scalability or local-only use."
heroImage: /two_phase_forest.png
pubDate: 2024-06-19
keywords: ["Obsidian", "second brain"]
Expand Down
28 changes: 28 additions & 0 deletions src/content/posts/safety-in-agents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: "How to Make AI Agents Safer"
author: saba
description: Customizable AI agents have massive potential, but they also come with risks. These are some things to keep in mind at the application layer.
heroImage: /network_lock_cropped.png
pubDate: 2024-10-24
keywords: ["personal AI", "ai agents", "community"]
---
As an application, Khoj helps people do better research with AI agents that can retrieve any publicly available information, read from your knowledge base, and perform some tasks on your behalf. Most of our use cases are centered around helping people learn, understand, and create.

You can find all public agents here: https://app.khoj.dev/agents. Custom agent creation is currently limited to the [Futurist tier](https://khoj.dev/#pricing).

Customization is a necessity for any research utility. You'll find yourself often wanting to tweak the agent's behavior to better suit your needs. This could be changing the system prompt, defining the capabilities of the agent, changing what information it has access to.

You can create a coding agent that specializes in Rust, a outdoorsy travel planning agent for Kyrgyzstan, a study buddy that helps you with applied linear algebra, or a creative partner that helps update the copy for your marketing campaign.

You always have the general-purpose Khoj agent available, but we recognize that deeper projects require specialization. We're really psyched to see what people come up with here.

We've made custom agents very easy to share, because distributing knowledge and expertise amongst each other should be trivial. Currently, you can share your "protected" agents with a direct link. Once we're more confident in the safety of the system, we'll allow you to share your agents publicly.

![ballot info processor agent screenshot](/ballot_info_processor_agent.png)

That being said, ease of sharing also demands increased guardrails. We're acutely aware of the dangers that come with viral systems in the AI economy. That's why we've baked a few safety features into Khoj:
- **Prompt verification**: When you save your custom protected or public agent, we'll verify that the system prompt is responsible and abides by our community guidelines. Our agents will not support propagation of hate speech, misinformation, or any other harmful content.
- **Prompt transparency**: Anyone you share your agent with can see the system prompt you've configured. Transparency is critical to making sure all parties are aware of the goal function of the technology they're interacting with.
- **Manual agent review**: When you share your agent with the world, we'll review it to make sure it's safe for everyone.

With all that said, these principles will not be perfect. We're constantly iterating on how to make Khoj a safer place for everyone. If you have any suggestions, please reach out to us.
7 changes: 2 additions & 5 deletions src/content/posts/timely_date_aware.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
title: "Timely: A Date-Aware Embedding Model"
author: raghav
description: Timely is an embedding model that improves temporal reasoning in AI systems. Learn how it was developed and how it can enhance date-aware dataset generation and model fine-tuning.
tldr: "Khoj introduces Timely, an embedding model designed to enhance temporal reasoning in AI systems by improving the identification and handling of date-related information in queries and documents. The project involves fine-tuning existing embedding models using a diverse dataset of date formats, resulting model variants that demonstrate improved performance on temporal tasks while maintaining general reasoning capabilities."
heroImage: /rivers.png
pubDate: 2024-08-14
keywords: ["embeddings", "date awareness", "temporal"]
---
#### HuggingFace
Pre-trained models in various sizes are available [here](https://huggingface.co/khoj-ai).

# Timely: An Embedding Model For Temporal Reasoning
## Introduction

At Khoj, we develop open-source personal AI to simplify how people engage with machines. The RAG component in modern AI systems commonly uses an embedding model to retrieve relevant documents for a user query. This retrieved-context enables accurate and personalized responses.

Expand Down Expand Up @@ -198,7 +194,7 @@ Our future focus includes:
# Reproduce

## Pretrained Models, Benchmarks, Datasets
To download our fine-tuned Timely models visit our huggingface page here: [huggingface](https://huggingface.co/khoj-ai)
To download our fine-tuned Timely models visit our HuggingFace page here: [huggingface](https://huggingface.co/khoj-ai)

## Dataset Generation
To replicate dataset generation use the following steps:
Expand All @@ -223,5 +219,6 @@ To replicate dataset generation use the following steps:
1. Load the desired benchmark and trained model
2. Run all code blocks in `testing.ipynb`


## Questions
For any questions or suggestions feel free to contact [email protected]
1 change: 0 additions & 1 deletion src/content/posts/using-khoj-for-studying.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: "AI Tutors: Hyper-Personalized Education"
author: saba
description: There's a massive opportunity to improve the way we learn by leveraging AI to directly cater to student needs.
tldr: "The post highlights the struggle students face due to a lack of personalized attention in education. It shows how Khoj can be a solution to enhance learning outcomes by providing tailored study assistance. It emphasizes the importance of open-source development and transparency in AI technologies for ethical and effective use in education."
heroImage: /future_library.png
pubDate: 2024-03-29
keywords: ["AI education", "personalized tutoring", "open-source"]
Expand Down
18 changes: 0 additions & 18 deletions src/layouts/BlogPost.astro
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const {
updatedDate,
heroImage,
author,
tldr,
keywords,
} = Astro.props;
Expand Down Expand Up @@ -61,11 +60,6 @@ const authorObj = AUTHOR_METADATA[author as keyof typeof AUTHOR_METADATA];
.last-updated-on {
font-style: italic;
}
p.tldr {
padding: 1em;
box-shadow: var(--box-shadow);
border: 1px solid var(--accent);
}
div.author {
display: grid;
grid-template-columns: auto 1fr;
Expand Down Expand Up @@ -140,20 +134,8 @@ const authorObj = AUTHOR_METADATA[author as keyof typeof AUTHOR_METADATA];
</a>
</div>
</div>

<hr />
</div>
{
tldr && (
<span class="rounded-lg text-sm text-green-50 bg-slate-800 dark:bg-slate-400 w-fit py-1 px-2 m-1">
TLDR
</span>
<div class="rounded-lg text-md shadow-sm bg-gradient-to-br from-slate-200 dark:from-slate-800 to-slate-300 dark:to-slate-700 p-2 my-4 text-md">
<div class="m-0 p-0 mb-0">{tldr}</div>
</div>
)
}
<hr />
<slot />
</div>
</article>
Expand Down

0 comments on commit 45ff68f

Please sign in to comment.