Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(documentation): Init #984

Merged
merged 63 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
f9ebbf3
feat(documentation): Init
creatorrr Dec 23, 2024
6e1d59a
wip(documentation): Work on mintlify docs
creatorrr Dec 24, 2024
30835e3
docs(mintlify): Add task walkthrough & other misc improvements
HamadaSalhab Jan 9, 2025
61b3377
Merge pull request #1036 from julep-ai/d/docs-improvement
creatorrr Jan 9, 2025
d9c37cd
wip(docs): mintlify sidebar
creatorrr Jan 15, 2025
06bc976
Merge branch 'dev' into mintlify-docs
creatorrr Jan 15, 2025
9ef7044
feat(docs): finalised mintlify sidebar
Vedantsahai18 Jan 16, 2025
9e9ff9d
docs(integration): intital draft of supported models added
Vedantsahai18 Jan 16, 2025
13fd68b
chore:supported model page update
Vedantsahai18 Jan 17, 2025
96e7afd
wip: added note to support model
Vedantsahai18 Jan 17, 2025
3470cbd
wip: initial integration docuemntaion added + icons to sidebar
Vedantsahai18 Jan 17, 2025
171ebc4
doc(documentation): ADd trip planning tutorial page
HamadaSalhab Jan 17, 2025
9a65a94
doc(documentation): Add browser use tutorial page
HamadaSalhab Jan 17, 2025
a5ece05
doc(documentation): Add rag workflow tutorial page
HamadaSalhab Jan 17, 2025
d211aff
doc(documentation): Add video processing tutorial page
HamadaSalhab Jan 17, 2025
0764f3b
wip: complete integration pages
Vedantsahai18 Jan 17, 2025
c4fc0c2
chore: misc fixes
Vedantsahai18 Jan 17, 2025
8a45bc2
wip: misc fixes
Vedantsahai18 Jan 18, 2025
f309f31
chore: minro refactor
Vedantsahai18 Jan 18, 2025
2d04a86
Merge pull request #1064 from julep-ai/mintlify-vedant
Vedantsahai18 Jan 18, 2025
738d0a7
Merge branch 'mintlify-docs' into d/tutorials
HamadaSalhab Jan 18, 2025
ff25d07
chore: python expr placeholder
Vedantsahai18 Jan 19, 2025
41d19b5
chore: misc fix
Vedantsahai18 Jan 19, 2025
b476438
chore(docs): Refactor browser-use tutorial
HamadaSalhab Jan 19, 2025
a2933cb
chore(docs): Refactor crawling-rag tutorial
HamadaSalhab Jan 19, 2025
85db166
chore(docs): Refactor trip-planning tutorial
HamadaSalhab Jan 19, 2025
5daaec9
chore(docs): Refactor video-processing tutorial
HamadaSalhab Jan 19, 2025
9fc25df
chore(docs:) Remove multi-agent-research tutorial
HamadaSalhab Jan 20, 2025
db4e4ab
Merge pull request #1067 from julep-ai/d/tutorials
Vedantsahai18 Jan 20, 2025
813836a
misc fix
Vedantsahai18 Jan 20, 2025
3907fcd
wip: get started + advanve topics
Vedantsahai18 Jan 20, 2025
525ff85
Merge pull request #1070 from julep-ai/mintlify-vedant
Vedantsahai18 Jan 21, 2025
028da2f
wip(documentation): Notes on agents
creatorrr Jan 21, 2025
6c277f1
wip(documentation): added agent concept structure
Vedantsahai18 Jan 21, 2025
a50cae1
wip(documentation): agent structure finalized
Vedantsahai18 Jan 21, 2025
fffa570
docs(advanced-topics): Add python expression page
HamadaSalhab Jan 21, 2025
373050a
docs(advanced-topics): Add files page
HamadaSalhab Jan 21, 2025
5704ae0
docs(advanced-topics): Add Agentic Patterns page (wip)
HamadaSalhab Jan 21, 2025
ae796ec
docs(advanced-topics): Modify Agentic Patterns page
HamadaSalhab Jan 21, 2025
09e7266
wip: Add tasks concept
creatorrr Jan 21, 2025
0ac13ae
wip(documentation): refactors + added data to agents,tasks in concept
Vedantsahai18 Jan 22, 2025
3b37ece
chore: minor fix
Vedantsahai18 Jan 22, 2025
9b9c70f
chore: minor fixes + refactors
Vedantsahai18 Jan 22, 2025
e771773
wip(documentation): refactors + concepts structure added
Vedantsahai18 Jan 22, 2025
eba1a01
Merge branch 'mintlify-docs' into d/advanced-topics
HamadaSalhab Jan 22, 2025
d3e2f0f
docs(advanced-topics): Refactor Agentic Patterns page
HamadaSalhab Jan 22, 2025
c26d921
docs(advanced-topics): Refactor Files page
HamadaSalhab Jan 22, 2025
aab611f
docs(advanced-topics): Add function signatures to Python Expressions …
HamadaSalhab Jan 22, 2025
6b6b27e
docs(advanced-topics): Point available functions to Python Expression…
HamadaSalhab Jan 22, 2025
7336f74
Merge pull request #1073 from julep-ai/d/advanced-topics
HamadaSalhab Jan 22, 2025
fe68e4e
docs(advanced-topics): Add chart images to Agentic Patterns Page
HamadaSalhab Jan 22, 2025
e7bb50c
docs(advanced-topics): Add Sessions page
HamadaSalhab Jan 22, 2025
c1e3b61
docs(core-concepts): Add Executions page
HamadaSalhab Jan 22, 2025
9549b3b
docs(cpore-concepts): Add Users page
HamadaSalhab Jan 22, 2025
0b95b66
docs(core-concepts): Add Docs page (wip)
HamadaSalhab Jan 22, 2025
b7563da
Merge pull request #1077 from julep-ai/d/advanced-topics
HamadaSalhab Jan 22, 2025
b63db74
wip(documentation): fixes
Vedantsahai18 Jan 23, 2025
e4deeb3
chore: o1 access enabled
Vedantsahai18 Jan 23, 2025
4e3b069
wip: refactors, fixes
Vedantsahai18 Jan 23, 2025
e36b301
docs(concepts): Finalize docs page content
HamadaSalhab Jan 23, 2025
3afce50
feat(documentation): Add dark version of hero image
creatorrr Jan 23, 2025
9b19b5b
Merge branch 'dev' into mintlify-docs
HamadaSalhab Jan 23, 2025
bd70f2d
Remove old `docs` directory
HamadaSalhab Jan 23, 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
1 change: 0 additions & 1 deletion agents-api/agents_api/activities/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ def get_handler(system: SystemDef) -> Callable:
from ..models.docs.list_docs import list_docs as list_docs_query
from ..models.entry.get_history import get_history as get_history_query
from ..models.session.create_session import create_session as create_session_query
from ..models.session.delete_session import delete_session as delete_session_query
from ..models.session.get_session import get_session as get_session_query
from ..models.session.list_sessions import list_sessions as list_sessions_query
from ..models.session.update_session import update_session as update_session_query
Expand Down
8 changes: 4 additions & 4 deletions agents-api/agents_api/metrics/counters.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
INF,
)
counter = Counter(
f"db_query_counter",
f"Number of db calls",
"db_query_counter",
"Number of db calls",
labelnames=labelnames,
)
summary = Summary(
f"db_query_latency_summary",
"db_query_latency_summary",
"Database query latency summary",
labelnames=labelnames,
)
hist = Histogram(
f"db_query_latency_hist",
"db_query_latency_hist",
"Database query latency histogram",
labelnames=labelnames,
buckets=buckets,
Expand Down
3 changes: 1 addition & 2 deletions agents-api/agents_api/routers/healthz/check_health.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging
from uuid import UUID

from ...autogen.openapi_model import Agent, ListResponse
from ...models.agent.list_agents import list_agents as list_agents_query
from .router import router

Expand All @@ -10,7 +9,7 @@
async def check_health() -> dict:
try:
# Check if the database is reachable
agents = list_agents_query(
list_agents_query(
developer_id=UUID("00000000-0000-0000-0000-000000000000"),
)
except Exception as e:
Expand Down
20 changes: 20 additions & 0 deletions documentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Julep Mintlify Documentation

## Development

Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command

```
npm i -g mintlify
```

Run the following command at the root of your documentation (where mint.json is)

```
mintlify dev
```

### Troubleshooting

- Mintlify dev isn't running - Run `mintlify install` it'll re-install dependencies.
- Page loads as a 404 - Make sure you are running in a folder with `mint.json`
51 changes: 51 additions & 0 deletions documentation/api-reference/introduction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
title: Introduction
description: 'Introduction to the Julep REST API'
---

<CardGroup cols={2}>
<Card
title="Agent Endpoints"
icon="robot"
href="/api-reference/agents/create"
>
Create, update, and manage AI agents
</Card>
<Card
title="Task Endpoints"
icon="list-check"
href="/api-reference/tasks/create"
>
Create and execute AI tasks and workflows
</Card>
<Card
title="Session Endpoints"
icon="comments"
href="/api-reference/sessions/create"
>
Manage conversation sessions and state
</Card>
<Card
title="Tool Endpoints"
icon="plug"
href="/api-reference/tools/register"
>
Register and manage agent tools
</Card>
</CardGroup>

## Authentication

<Note>
Authentication is done via API keys.
</Note>

API keys are used to authenticate requests to the Julep API. They can be created in the [Julep dashboard](https://dashboard.julep.ai).

To create an API key, go to the Julep dashboard and navigate to the "API Keys" section.

To use an API key, include it in the `Authorization` header of your request.

```
Authorization: Bearer YOUR_API_KEY
```
195 changes: 195 additions & 0 deletions documentation/building-blocks/agents/agent-memory.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
---
title: 'Agent Memory'
description: 'Understanding how agents maintain state and context across interactions'
---

## Overview

Agent memory in Julep allows AI agents to maintain state and context across multiple interactions. This enables more coherent and contextually aware conversations and task executions.

## Types of Memory

Julep provides several types of memory for agents:

### 1. Session Memory

Session memory persists throughout a single conversation session:

```python Python
# Create a session with memory
session = client.sessions.create(
agent_id=agent.id,
user_id=user.id,
context_overflow="adaptive" # Memory management strategy
)
```

### 2. Long-term Memory

Long-term memory persists across sessions and is stored in the agent's document store:

```python Python
# Store information in long-term memory
document = client.agents.docs.create(
agent_id=agent.id,
title="User Preferences",
content="User prefers dark mode and concise responses",
metadata={"type": "preferences"}
)
```

### 3. Working Memory

Working memory is available during task execution:

```yaml
main:
- evaluate:
remembered_value: "some_value"

- prompt:
- role: user
content: "Use the remembered value: {{_.remembered_value}}"
```

## Memory Management

### Context Window Management

Julep offers different strategies for managing context windows:

1. **Fixed**: Maintains a fixed number of messages
2. **Adaptive**: Dynamically adjusts based on token usage
3. **Summary**: Periodically summarizes older context

```python Python
session = client.sessions.create(
agent_id=agent.id,
context_overflow="adaptive",
max_messages=50 # Optional: limit number of messages
)
```

### Document Store

The document store serves as long-term memory:

```python Python
# Store a document
doc = client.agents.docs.create(
agent_id=agent.id,
title="Meeting Notes",
content="Important points from the meeting...",
metadata={"date": "2024-03-24"}
)

# Search stored documents
results = client.agents.docs.search(
agent_id=agent.id,
text="meeting points",
metadata_filter={"date": "2024-03-24"}
)
```

## Memory Access in Tasks

Tasks can access different types of memory:

```yaml
main:
# Access session context
- prompt:
- role: system
content: "Previous context: {{session.context}}"

# Search long-term memory
- tool: search_documents
arguments:
query: "user preferences"

# Use working memory
- evaluate:
stored_value: "important_data"
- prompt:
- role: user
content: "Use the stored value: {{_.stored_value}}"
```

## Best Practices

1. **Memory Organization**
- Use clear document titles and metadata
- Organize documents by type and purpose
- Regularly clean up outdated information

2. **Context Management**
- Choose appropriate context overflow strategies
- Monitor token usage in sessions
- Use summaries for long conversations

3. **Memory Usage**
- Store important information in long-term memory
- Use working memory for temporary data
- Leverage session memory for conversation context

## Example: Complex Memory Usage

Here's an example combining different types of memory:

```python Python
# Create a session with memory management
session = client.sessions.create(
agent_id=agent.id,
user_id=user.id,
context_overflow="adaptive",
metadata={
"preferences": {
"language": "en",
"style": "formal"
}
}
)

# Store long-term information
client.agents.docs.create(
agent_id=agent.id,
title="User Profile",
content="Detailed user preferences and history...",
metadata={
"type": "profile",
"last_updated": "2024-03-24"
}
)

# Create a task that uses multiple memory types
task = client.tasks.create(
agent_id=agent.id,
yaml="""
main:
# Access session context
- prompt:
- role: system
content: "Session context: {{session.context}}"

# Search long-term memory
- tool: search_documents
arguments:
query: "user profile"

# Store in working memory
- evaluate:
profile_data: _.documents[0].content

# Use the combined information
- prompt:
- role: user
content: "Use profile data: {{_.profile_data}}"
"""
)
```

## Next Steps

1. [Learn about agent tools](/building-blocks/agents/agent-tools)
2. [Understand task basics](/building-blocks/tasks/task-basics)
3. [Explore session management](/building-blocks/sessions/session-management)
Loading
Loading